summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-09 10:41:55 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-09 10:41:55 +0200
commit59363d3e230a0e9702e31936309473fb576ecec5 (patch)
tree672ba27334fa1ef6dcf9b680be20680c7115cdd6 /src
parent1f4271ea540b85243df593d64b5d2230ad023343 (diff)
Style consistency: popup frames
A colored popup frame indicates an active UI element, like a dropdown selection of values. A popup with a separator-colored frame is a passive element, like a context menu.
Diffstat (limited to 'src')
-rw-r--r--src/ui/util.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 8e71dcec..d0d24eb2 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -903,6 +903,7 @@ iWidget *makeMenu_Widget(iWidget *parent, const iMenuItem *items, size_t n) {
903#else 903#else
904 /* Non-native custom popup menu. This may still be displayed inside a separate window. */ 904 /* Non-native custom popup menu. This may still be displayed inside a separate window. */
905 setDrawBufferEnabled_Widget(menu, iTrue); 905 setDrawBufferEnabled_Widget(menu, iTrue);
906 setFrameColor_Widget(menu, uiSeparator_ColorId);
906 setBackgroundColor_Widget(menu, uiBackgroundMenu_ColorId); 907 setBackgroundColor_Widget(menu, uiBackgroundMenu_ColorId);
907 if (deviceType_App() != desktop_AppDeviceType) { 908 if (deviceType_App() != desktop_AppDeviceType) {
908 setPadding1_Widget(menu, 2 * gap_UI); 909 setPadding1_Widget(menu, 2 * gap_UI);
@@ -1084,12 +1085,12 @@ void openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, int menuOpenFlags) {
1084 setFlags_Widget(d, hidden_WidgetFlag, iFalse); 1085 setFlags_Widget(d, hidden_WidgetFlag, iFalse);
1085 setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue); 1086 setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue);
1086 setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); 1087 setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse);
1087 if (!isPortraitPhone) { 1088// if (!isPortraitPhone) {
1088 setFrameColor_Widget(d, uiBackgroundSelected_ColorId); 1089// setFrameColor_Widget(d, uiSeparator_ColorId);
1089 } 1090// }
1090 else { 1091// else {
1091 setFrameColor_Widget(d, none_ColorId); 1092// setFrameColor_Widget(d, none_ColorId);
1092 } 1093// }
1093 arrange_Widget(d); /* need to know the height */ 1094 arrange_Widget(d); /* need to know the height */
1094 iBool allowOverflow = iFalse; 1095 iBool allowOverflow = iFalse;
1095 /* A vertical offset determined by a possible selected label in the menu. */ 1096 /* A vertical offset determined by a possible selected label in the menu. */
@@ -1327,6 +1328,7 @@ int checkContextMenu_Widget(iWidget *menu, const SDL_Event *ev) {
1327iLabelWidget *makeMenuButton_LabelWidget(const char *label, const iMenuItem *items, size_t n) { 1328iLabelWidget *makeMenuButton_LabelWidget(const char *label, const iMenuItem *items, size_t n) {
1328 iLabelWidget *button = new_LabelWidget(label, "menu.open"); 1329 iLabelWidget *button = new_LabelWidget(label, "menu.open");
1329 iWidget *menu = makeMenu_Widget(as_Widget(button), items, n); 1330 iWidget *menu = makeMenu_Widget(as_Widget(button), items, n);
1331 setFrameColor_Widget(menu, uiBackgroundSelected_ColorId);
1330 setId_Widget(menu, "menu"); 1332 setId_Widget(menu, "menu");
1331 return button; 1333 return button;
1332} 1334}