diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/questswindow.cpp | 12 | ||||
-rw-r--r-- | src/gui/serverdialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/skilldialog.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/listbox.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/shoplistbox.cpp | 3 |
6 files changed, 30 insertions, 8 deletions
diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp index c05df1de..6769815e 100644 --- a/src/gui/questswindow.cpp +++ b/src/gui/questswindow.cpp @@ -113,9 +113,16 @@ void QuestsListBox::draw(gcn::Graphics *gcnGraphics) graphics->setColor(Theme::getThemeColor(Theme::TEXT)); const int fontHeight = getFont()->getHeight(); - int y = 0; - for (auto &quest : model->getQuests()) + + for (int i = 0, y = 0; i < model->getNumberOfElements(); + ++i, y += rowHeight) { + if (mSelected == i) + graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT_TEXT)); + else + graphics->setColor(Theme::getThemeColor(Theme::TEXT)); + + auto &quest = model->getQuests()[i]; int x = 1; if (const Image *icon = quest.completed ? completeIcon : incompleteIcon) @@ -125,7 +132,6 @@ void QuestsListBox::draw(gcn::Graphics *gcnGraphics) } graphics->drawText(quest.name(), x, y + (rowHeight - fontHeight) / 2); - y += rowHeight; } } diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 872ecb28..e41c0bbe 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -115,7 +115,10 @@ public: { const ServerInfo &info = model->getServer(i); - graphics->setColor(Theme::getThemeColor(Theme::TEXT)); + if (mSelected == i) + graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT_TEXT)); + else + graphics->setColor(Theme::getThemeColor(Theme::TEXT)); if (!info.name.empty()) { diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 3112446a..49552421 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -147,11 +147,15 @@ public: } // Draw the list elements - graphics->setColor(Theme::getThemeColor(Theme::TEXT)); for (int i = 0, y = 1; i < model->getNumberOfElements(); ++i, y += getRowHeight()) { + if (mSelected == i) + graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT_TEXT)); + else + graphics->setColor(Theme::getThemeColor(Theme::TEXT)); + if (SkillInfo *e = model->getSkillAt(i)) e->draw(graphics, y, getWidth()); } diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 4a806d04..a5109267 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -76,11 +76,15 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics) auto offlineIcon = theme->getIcon("offline"); // Draw the list elements - graphics->setColor(Theme::getThemeColor(Theme::TEXT)); for (int i = 0, y = 0; i < model->getNumberOfElements(); ++i, y += rowHeight) { + if (mSelected == i) + graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT_TEXT)); + else + graphics->setColor(Theme::getThemeColor(Theme::TEXT)); + Avatar *a = model->getAvatarAt(i); int x = 1; diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 112de232..612e785f 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -56,10 +56,14 @@ void ListBox::draw(gcn::Graphics *graphics) } // Draw the list elements - graphics->setColor(Theme::getThemeColor(Theme::TEXT)); for (int i = 0, y = 0; i < mListModel->getNumberOfElements(); ++i, y += height) { + if (mSelected == i) + graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT_TEXT)); + else + graphics->setColor(Theme::getThemeColor(Theme::TEXT)); + graphics->drawText(mListModel->getElementAt(i), 1, y); } } diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index e2313c85..d745d74d 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -75,6 +75,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) auto backgroundColor = Theme::getThemeColor(Theme::BACKGROUND); auto warningColor = Theme::getThemeColor(Theme::SHOP_WARNING); auto textColor = Theme::getThemeColor(Theme::TEXT); + auto highlightTextColor = Theme::getThemeColor(Theme::HIGHLIGHT_TEXT); highlightColor.a = alpha; backgroundColor.a = alpha; warningColor.a = alpha; @@ -136,7 +137,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) } } - graphics->setColor(textColor); + graphics->setColor(i == mSelected ? highlightTextColor : textColor); graphics->drawText(mListModel->getElementAt(i), ITEM_ICON_SIZE + 5, y + (ITEM_ICON_SIZE - fontHeight) / 2); |