summaryrefslogtreecommitdiff
path: root/src/ui/labelwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-21 09:19:21 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-21 09:19:21 +0300
commite48a9a27bd11dbef9531bd12d3c0c60cc771b2c3 (patch)
tree0044e6de2a788c061f0fe0eb239ab96d22acadd4 /src/ui/labelwidget.c
parentba6d544b1237aea6901cf5b4f6562db9eb0f46c4 (diff)
macOS: Native context menus
Popup context menus now use NSMenu. There are still has a few glitches with the navbar identity button, but most menus are working. SDL required another little tweak to force it to update mouse button state after the synchronously handled context menu goes away. Otherwise SDL's internal mouse button state shows that the right mouse button is held down.
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r--src/ui/labelwidget.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c
index 30eb1d36..c8748efa 100644
--- a/src/ui/labelwidget.c
+++ b/src/ui/labelwidget.c
@@ -611,19 +611,8 @@ iBool checkIcon_LabelWidget(iLabelWidget *d) {
611 d->icon = 0; 611 d->icon = 0;
612 return iFalse; 612 return iFalse;
613 } 613 }
614 iStringConstIterator iter; 614 d->icon = removeIconPrefix_String(&d->label);
615 init_StringConstIterator(&iter, &d->label); 615 return d->icon != 0;
616 const iChar icon = iter.value;
617 next_StringConstIterator(&iter);
618 if (iter.value == ' ' && icon >= 0x100) {
619 d->icon = icon;
620 remove_Block(&d->label.chars, 0, iter.next - constBegin_String(&d->label));
621 return iTrue;
622 }
623 else {
624 d->icon = 0;
625 }
626 return iFalse;
627} 616}
628 617
629iChar icon_LabelWidget(const iLabelWidget *d) { 618iChar icon_LabelWidget(const iLabelWidget *d) {