Merge branch 'omega-dev' of https://github.com/M4xi1m3/Omega into M4xi1m3-omega-dev

This commit is contained in:
Quentin
2020-06-12 22:13:31 +02:00
4 changed files with 10 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ namespace Home {
AppCell::AppCell() :
HighlightCell(),
m_nameView(KDFont::SmallFont, (I18n::Message)0, 0.5f, 0.5f, Palette::HomeCellText, Palette::HomeCellTextActive),
m_visible(true)
m_visible(true), m_external_app(false)
{
}
@@ -34,17 +34,19 @@ void AppCell::layoutSubviews(bool force) {
}
void AppCell::setExtAppDescriptor(const char* name, const Image* icon) {
m_external_app = true;
m_iconView.setImage(icon);
m_nameView.setText(name);
m_nameView.setTextColor(Palette::AccentText);
m_nameView.setTextColor(Palette::HomeCellTextExternal);
m_nameView.setMessage(I18n::Message::Default);
layoutSubviews();
}
void AppCell::setAppDescriptor(::App::Descriptor * descriptor) {
m_external_app = false;
m_iconView.setImage(descriptor->icon());
m_nameView.setMessage(descriptor->name());
m_nameView.setTextColor(Palette::PrimaryText);
m_nameView.setTextColor(Palette::HomeCellText);
m_nameView.setText(nullptr);
layoutSubviews();
}
@@ -57,7 +59,7 @@ void AppCell::setVisible(bool visible) {
}
void AppCell::reloadCell() {
m_nameView.setTextColor(isHighlighted() ? Palette::HomeCellTextActive : Palette::HomeCellText);
m_nameView.setTextColor(isHighlighted() ? (m_external_app ? Palette::HomeCellTextExternalActive : Palette::HomeCellTextActive) : (m_external_app ? Palette::HomeCellTextExternal : Palette::HomeCellText));
m_nameView.setBackgroundColor(isHighlighted() ? Palette::HomeCellBackgroundActive : Palette::HomeCellBackground);
}

View File

@@ -27,6 +27,7 @@ private:
ImageView m_iconView;
MessageTextView m_nameView;
bool m_visible;
bool m_external_app;
};
}

View File

@@ -3,6 +3,7 @@
PLATFORM ?= device
DEBUG ?= 0
HOME_DISPLAY_EXTERNALS ?= 1
EPSILON_VERSION ?= 13.1.0
OMEGA_VERSION ?= 1.20.0
# USERNAME ?= N/A

View File

@@ -98,6 +98,8 @@ constexpr KDColor Palette::HomeCellBackground;
constexpr KDColor Palette::HomeCellBackgroundActive;
constexpr KDColor Palette::HomeCellText;
constexpr KDColor Palette::HomeCellTextActive;
constexpr KDColor Palette::HomeCellTextExternal;
constexpr KDColor Palette::HomeCellTextExternalActive;
constexpr KDColor Palette::YellowDark; // Done
constexpr KDColor Palette::YellowLight; // Done