[vlc-commits] [Git][videolan/vlc][master] macosx: Fix brief menu offset shift

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Jun 23 09:25:32 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
106756a0 by Dave Nicolson at 2024-06-23T08:44:40+00:00
macosx: Fix brief menu offset shift

- - - - -


1 changed file:

- modules/gui/macosx/menus/VLCMainMenu.m


Changes:

=====================================
modules/gui/macosx/menus/VLCMainMenu.m
=====================================
@@ -1901,27 +1901,25 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
         const int menuItemOffset = 14;
         const int menuItemOffsetWithActiveState = 24;
 
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (menu == self->_controlsMenu) {
-                BOOL controlsMenuHasActiveState = NO;
-                for (NSMenuItem *viewMenuItem in menu.itemArray) {
-                    if (viewMenuItem.state == NSControlStateValueOn) {
-                        controlsMenuHasActiveState = YES;
-                    }
-                }
-
-                if (controlsMenuHasActiveState) {
-                    self->_rate_view_offset_constraint.constant = menuItemOffsetWithActiveState;
-                } else {
-                    self->_rate_view_offset_constraint.constant = menuItemOffset;
+        if (menu == _controlsMenu) {
+            BOOL controlsMenuHasActiveState = NO;
+            for (NSMenuItem * const viewMenuItem in menu.itemArray) {
+                if (viewMenuItem.state == NSControlStateValueOn) {
+                    controlsMenuHasActiveState = YES;
                 }
             }
 
-            if (menu == self->_subtitlesMenu) {
-                self->_subtitle_bgopacity_view_offset_constraint.constant = menuItemOffset;
-                self->_subtitleSizeViewOffsetConstraint.constant = menuItemOffset;
+            if (controlsMenuHasActiveState) {
+                _rate_view_offset_constraint.constant = menuItemOffsetWithActiveState;
+            } else {
+                _rate_view_offset_constraint.constant = menuItemOffset;
             }
-        });
+        }
+
+        if (menu == _subtitlesMenu) {
+            _subtitle_bgopacity_view_offset_constraint.constant = menuItemOffset;
+            _subtitleSizeViewOffsetConstraint.constant = menuItemOffset;
+        }
     }
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/106756a06c3f5b8ef2b58daeae9d8929bf352fef

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/106756a06c3f5b8ef2b58daeae9d8929bf352fef
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list