Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/frontend/mame/ui/confswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ void menu_confswitch::populate()
if (field.has_next_setting())
flags |= FLAG_RIGHT_ARROW;

if (field.live().value == field.defvalue())
flags |= FLAG_DEEMPHASIZE;

// add the menu item
item_append(field.name(), field.setting_name(), flags, &field);
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/ui/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,12 +884,12 @@ void menu::draw(uint32_t flags)
// customize subitem text color
if (!core_stricmp(pitem.subtext(), _("On")))
fgcolor2 = rgb_t(0x00,0xff,0x00);

if (!core_stricmp(pitem.subtext(), _("Off")))
fgcolor2 = rgb_t(0xff,0x00,0x00);

if (!core_stricmp(pitem.subtext(), _("Auto")))
fgcolor2 = rgb_t(0xff,0xff,0x00);
if (subitem_deemphasize)
fgcolor3 = fgcolor2.scale8(0.7F * 256); // 70%
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m going to back this part out, because it assumes a light-on-dark colour scheme, and makes an assumption about the relative brightness of the foreground and background colours. This assumption isn’t safe as the user can reconfigure the colour scheme.

(Yes, there are a couple of pre-existing issues in that the red/orange/green “traffic light” background colours can’t be changed, which limits the usable text colours, and the magically applied colours for the words “On”, “Off” and “Auto” limit the usable background colours. To be honest, I’m not a fan of the magically applied colours for those words. It came when MEWUI was integrated.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly to serve that red/green cases. The alternative is for On/Off define fg2 and fg3 simultaneously.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but it can’t safely do that without considering whether the background is light or dark, and the actual intensity. Simply scaling the brightness like this assumes that the background is dark and is substantially darker than 179 in 8-bit RGB. That isn’t a safe assumption, given the user can change the colours. On a light background, you'd probably have to desaturate the colours as well as dimming them to prevent the green from looking muddy, and dimming yellow is perilous at the best of times due to human perception of browns being rather quirky.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, we know background. I'll do "towards" background later

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be it: #15305


// draw the subitem right-justified
ui().draw_text_full(
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/mame/ui/sliders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ void menu_sliders::populate()
flags |= FLAG_LEFT_ARROW;
if (curval < slider->maxval)
flags |= FLAG_RIGHT_ARROW;
if (curval == slider->defval)
flags |= FLAG_DEEMPHASIZE;
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
}
}
Expand All @@ -225,6 +227,8 @@ void menu_sliders::populate()
flags |= FLAG_LEFT_ARROW;
if (curval < slider->maxval)
flags |= FLAG_RIGHT_ARROW;
if (curval == slider->defval)
flags |= FLAG_DEEMPHASIZE;
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
}
else
Expand Down
Loading