summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-30 15:34:38 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-30 15:36:58 +0200
commitd58ecc5cb293a7e5248beae95727d1301d1c907b (patch)
treeb1bba3c4902bc0b583fd60a04241a97f57cf63d9 /src/ui/util.c
parent02de94c9d94e70d2c8d5e4813c578111eba0d2b2 (diff)
SidebarWidget: Crash when switching Feeds mode
Updating items immediately destroys the action widgets. # Conflicts: # src/ui/sidebarwidget.c
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 84de4b74..fe5e5393 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1269,6 +1269,9 @@ const iString *removeMenuItemLabelPrefixes_String(const iString *d) {
1269} 1269}
1270 1270
1271void updateDropdownSelection_LabelWidget(iLabelWidget *dropButton, const char *selectedCommand) { 1271void updateDropdownSelection_LabelWidget(iLabelWidget *dropButton, const char *selectedCommand) {
1272 if (!dropButton) {
1273 return;
1274 }
1272 iWidget *menu = findChild_Widget(as_Widget(dropButton), "menu"); 1275 iWidget *menu = findChild_Widget(as_Widget(dropButton), "menu");
1273 if (flags_Widget(menu) & nativeMenu_WidgetFlag) { 1276 if (flags_Widget(menu) & nativeMenu_WidgetFlag) {
1274 unselectAllNativeMenuItems_Widget(menu); 1277 unselectAllNativeMenuItems_Widget(menu);
@@ -1277,6 +1280,7 @@ void updateDropdownSelection_LabelWidget(iLabelWidget *dropButton, const char *s
1277 setSelected_NativeMenuItem(item, iTrue); 1280 setSelected_NativeMenuItem(item, iTrue);
1278 updateText_LabelWidget( 1281 updateText_LabelWidget(
1279 dropButton, removeMenuItemLabelPrefixes_String(collectNewCStr_String(item->label))); 1282 dropButton, removeMenuItemLabelPrefixes_String(collectNewCStr_String(item->label)));
1283 checkIcon_LabelWidget(dropButton);
1280 } 1284 }
1281 return; 1285 return;
1282 } 1286 }
@@ -1287,6 +1291,7 @@ void updateDropdownSelection_LabelWidget(iLabelWidget *dropButton, const char *s
1287 setFlags_Widget(as_Widget(item), selected_WidgetFlag, isSelected); 1291 setFlags_Widget(as_Widget(item), selected_WidgetFlag, isSelected);
1288 if (isSelected) { 1292 if (isSelected) {
1289 updateText_LabelWidget(dropButton, sourceText_LabelWidget(item)); 1293 updateText_LabelWidget(dropButton, sourceText_LabelWidget(item));
1294 checkIcon_LabelWidget(dropButton);
1290 } 1295 }
1291 } 1296 }
1292 } 1297 }
@@ -2352,6 +2357,7 @@ iWidget *makePreferences_Widget(void) {
2352 { "radio device:1 id:prefs.pinsplit", 0, 0, (const void *) pinSplitItems }, 2357 { "radio device:1 id:prefs.pinsplit", 0, 0, (const void *) pinSplitItems },
2353 { "padding" }, 2358 { "padding" },
2354 { "dropdown id:prefs.uilang", 0, 0, (const void *) langItems }, 2359 { "dropdown id:prefs.uilang", 0, 0, (const void *) langItems },
2360 { "toggle id:prefs.time.24h" },
2355 { NULL } 2361 { NULL }
2356 }; 2362 };
2357 const iMenuItem uiPanelItems[] = { 2363 const iMenuItem uiPanelItems[] = {
@@ -2436,6 +2442,7 @@ iWidget *makePreferences_Widget(void) {
2436 const iMenuItem aboutPanelItems[] = { 2442 const iMenuItem aboutPanelItems[] = {
2437 { format_CStr("heading text:%s", cstr_String(aboutText)) }, 2443 { format_CStr("heading text:%s", cstr_String(aboutText)) },
2438 { "button text:" clock_Icon " ${menu.releasenotes}", 0, 0, "!open url:about:version" }, 2444 { "button text:" clock_Icon " ${menu.releasenotes}", 0, 0, "!open url:about:version" },
2445 { "padding" },
2439 { "button text:" globe_Icon " ${menu.website}", 0, 0, "!open url:https://gmi.skyjake.fi/lagrange" }, 2446 { "button text:" globe_Icon " ${menu.website}", 0, 0, "!open url:https://gmi.skyjake.fi/lagrange" },
2440 { "button text:" envelope_Icon " @jk@skyjake.fi", 0, 0, "!open url:https://skyjake.fi/@jk" }, 2447 { "button text:" envelope_Icon " @jk@skyjake.fi", 0, 0, "!open url:https://skyjake.fi/@jk" },
2441 { "padding" }, 2448 { "padding" },