Skip to content

Commit

Permalink
Use disabled icons for CheckBox in DefaultTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkMessiah committed Nov 19, 2023
1 parent 5945768 commit ff59496
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions scene/gui/popup_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,7 @@ void PopupMenu::_draw_items() {
}
}

Color icon_color(1, 1, 1, items[i].disabled && !items[i].separator ? 0.5 : 1);

icon_color *= items[i].icon_modulate;
Color icon_color = items[i].icon_modulate;

// For non-separator items, add some padding for the content.
if (!items[i].separator) {
Expand Down
16 changes: 8 additions & 8 deletions scene/theme/default_theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("focus", "CheckBox", cbx_focus);

theme->set_icon("checked", "CheckBox", icons["checked"]);
theme->set_icon("checked_disabled", "CheckBox", icons["checked"]);
theme->set_icon("checked_disabled", "CheckBox", icons["checked_disabled"]);
theme->set_icon("unchecked", "CheckBox", icons["unchecked"]);
theme->set_icon("unchecked_disabled", "CheckBox", icons["unchecked"]);
theme->set_icon("unchecked_disabled", "CheckBox", icons["unchecked_disabled"]);
theme->set_icon("radio_checked", "CheckBox", icons["radio_checked"]);
theme->set_icon("radio_checked_disabled", "CheckBox", icons["radio_checked"]);
theme->set_icon("radio_checked_disabled", "CheckBox", icons["radio_checked_disabled"]);
theme->set_icon("radio_unchecked", "CheckBox", icons["radio_unchecked"]);
theme->set_icon("radio_unchecked_disabled", "CheckBox", icons["radio_unchecked"]);
theme->set_icon("radio_unchecked_disabled", "CheckBox", icons["radio_unchecked_disabled"]);

theme->set_font("font", "CheckBox", Ref<Font>());
theme->set_font_size("font_size", "CheckBox", -1);
Expand Down Expand Up @@ -685,13 +685,13 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("labeled_separator_right", "PopupMenu", separator_horizontal);

theme->set_icon("checked", "PopupMenu", icons["checked"]);
theme->set_icon("checked_disabled", "PopupMenu", icons["checked"]);
theme->set_icon("checked_disabled", "PopupMenu", icons["checked_disabled"]);
theme->set_icon("unchecked", "PopupMenu", icons["unchecked"]);
theme->set_icon("unchecked_disabled", "PopupMenu", icons["unchecked"]);
theme->set_icon("unchecked_disabled", "PopupMenu", icons["unchecked_disabled"]);
theme->set_icon("radio_checked", "PopupMenu", icons["radio_checked"]);
theme->set_icon("radio_checked_disabled", "PopupMenu", icons["radio_checked"]);
theme->set_icon("radio_checked_disabled", "PopupMenu", icons["radio_checked_disabled"]);
theme->set_icon("radio_unchecked", "PopupMenu", icons["radio_unchecked"]);
theme->set_icon("radio_unchecked_disabled", "PopupMenu", icons["radio_unchecked"]);
theme->set_icon("radio_unchecked_disabled", "PopupMenu", icons["radio_unchecked_disabled"]);
theme->set_icon("submenu", "PopupMenu", icons["popup_menu_arrow_right"]);
theme->set_icon("submenu_mirrored", "PopupMenu", icons["popup_menu_arrow_left"]);

Expand Down

0 comments on commit ff59496

Please sign in to comment.