diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-21 09:19:21 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-21 09:19:21 +0300 |
commit | e48a9a27bd11dbef9531bd12d3c0c60cc771b2c3 (patch) | |
tree | 0044e6de2a788c061f0fe0eb239ab96d22acadd4 /src/ui/labelwidget.c | |
parent | ba6d544b1237aea6901cf5b4f6562db9eb0f46c4 (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.c | 15 |
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 | ||
629 | iChar icon_LabelWidget(const iLabelWidget *d) { | 618 | iChar icon_LabelWidget(const iLabelWidget *d) { |