From 9560bc206198438675c0ba1938418214ca579aea Mon Sep 17 00:00:00 2001 From: poire-z Date: Thu, 14 Mar 2019 22:09:55 +0100 Subject: [PATCH] ConfigDialog: fix some gray mismatch in prev commit (#4797) Remove gray underline on text items (font size items). Adjust gray color of ButtonProgressWidget to match the one of ToggleSwitch (just need to invert it, as it's used to select button, which cause this color to be inverted). --- frontend/ui/widget/buttonprogresswidget.lua | 4 +++- frontend/ui/widget/configdialog.lua | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/ui/widget/buttonprogresswidget.lua b/frontend/ui/widget/buttonprogresswidget.lua index 431959bae..739f62caa 100644 --- a/frontend/ui/widget/buttonprogresswidget.lua +++ b/frontend/ui/widget/buttonprogresswidget.lua @@ -75,7 +75,9 @@ function ButtonProgressWidget:update() if self.thin_grey_style then button.frame.color = Blitbuffer.COLOR_DARK_GRAY -- no black border around gray squares if highlighted then - button.frame.background = Blitbuffer.COLOR_DARK_GRAY + -- The button and its frame background will be inverted, + -- so invert the color we want so it gets inverted back + button.frame.background = Blitbuffer.COLOR_DARK_GRAY:invert() button = FrameContainer:new{ -- add margin back margin = button_margin, padding = 0, diff --git a/frontend/ui/widget/configdialog.lua b/frontend/ui/widget/configdialog.lua index 47bdc07c1..569dd2ece 100644 --- a/frontend/ui/widget/configdialog.lua +++ b/frontend/ui/widget/configdialog.lua @@ -391,7 +391,7 @@ function ConfigOption:init() underline_padding = padding_button, padding_left = d > 1 and horizontal_half_padding, padding_right = d < #self.options[c].item_text and horizontal_half_padding, - color = d == current_item and enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY or Blitbuffer.COLOR_WHITE, + color = d == current_item and (enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY) or Blitbuffer.COLOR_WHITE, enabled = enabled, } else @@ -410,7 +410,7 @@ function ConfigOption:init() underline_padding = -padding_button, padding_left = d > 1 and horizontal_half_padding, padding_right = d < #self.options[c].item_text and horizontal_half_padding, - color = d == current_item and enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY or Blitbuffer.COLOR_WHITE, + color = d == current_item and (enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY) or Blitbuffer.COLOR_WHITE, enabled = enabled, } end @@ -448,7 +448,7 @@ function ConfigOption:init() underline_padding = -padding_button, padding_left = d > 1 and horizontal_half_padding, padding_right = d < #self.options[c].item_icons and horizontal_half_padding, - color = d == current_item and enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY or Blitbuffer.COLOR_WHITE, + color = d == current_item and (enabled and Blitbuffer.COLOR_BLACK or Blitbuffer.COLOR_DARK_GRAY) or Blitbuffer.COLOR_WHITE, enabled = enabled, } option_items[d] = option_item