Skip to content

Commit

Permalink
bugfix: Listbox selection color was hardcoded when inactive (fixes #1270
Browse files Browse the repository at this point in the history
)
  • Loading branch information
midwan committed Apr 5, 2024
1 parent d5d8cc2 commit 6e703f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions external/libguisan/src/widgets/listbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ namespace gcn
startRow = 0;
}

const auto inactive_color = Color(170, 170, 170);

// The y coordinate where we start to draw the text is
// simply the y coordinate multiplied with the font height.
auto y = rowHeight * startRow;
Expand All @@ -148,10 +146,7 @@ namespace gcn
{
if (i == mSelected)
{
if (isFocused())
graphics->setColor(getSelectionColor());
else
graphics->setColor(inactive_color);
graphics->setColor(getSelectionColor());
graphics->fillRectangle(Rectangle(0, y, getWidth(), rowHeight));
graphics->setColor(getForegroundColor());
}
Expand Down
4 changes: 2 additions & 2 deletions src/osdep/gui/PanelConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ void InitPanelConfig(const struct config_category& category)
const int list_height = category.panel->getHeight() - 2 * DISTANCE_BORDER - 2 * lblName->getHeight() - 3 * DISTANCE_NEXT_Y - 2 * BUTTON_HEIGHT;
lstConfigs = new gcn::ListBox(&configsList);
lstConfigs->setSize(list_width, list_height);
lstConfigs->setBaseColor(colTextboxBackground);
lstConfigs->setBaseColor(gui_baseCol);
lstConfigs->setBackgroundColor(colTextboxBackground);
lstConfigs->setSelectionColor(colSelectorActive);
lstConfigs->setSelectionColor(gui_selection_color);
lstConfigs->setWrappingEnabled(true);
lstConfigs->setId("ConfigList");
lstConfigs->addActionListener(configsListActionListener);
Expand Down

0 comments on commit 6e703f9

Please sign in to comment.