[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: macosx: Set size of slider in prefs_widgets.m to NSControlSizeSmall, avoiding clipping

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon May 15 09:05:17 UTC 2023



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
0947c83f by Claudio Cambra at 2023-05-15T08:49:40+00:00
macosx: Set size of slider in prefs_widgets.m to NSControlSizeSmall, avoiding clipping

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
1ffa1ecf by Claudio Cambra at 2023-05-15T08:49:40+00:00
macosx: Fix stepper sizing issues in preferences

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


1 changed file:

- modules/gui/macosx/prefs_widgets.m


Changes:

=====================================
modules/gui/macosx/prefs_widgets.m
=====================================
@@ -340,7 +340,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
     NSRect s_rc = superFrame;                                               \
     s_rc.origin.x = x_offset;                                               \
     s_rc.origin.y = my_y_offset;                                            \
-    s_rc.size.height = 23;                                                  \
+    s_rc.size.height = 24;                                                  \
     s_rc.size.width = 23;                                                   \
     o_stepper = [[NSStepper alloc] initWithFrame: s_rc];                    \
     [o_stepper setFont:[NSFont systemFontOfSize:0]];                        \
@@ -351,6 +351,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
     [o_stepper setAction: @selector(stepperChanged:)];                      \
     [o_stepper sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask |       \
         NSLeftMouseDraggedMask];                                            \
+    [o_stepper sizeToFit];                                                  \
 }
 
 #define ADD_SLIDER(o_slider, superFrame, x_offset, my_y_offset, my_width,   \
@@ -366,6 +367,9 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
     [o_slider setToolTip: tooltip];                                         \
     [o_slider setMaxValue: higher];                                         \
     [o_slider setMinValue: lower];                                          \
+    if (@available(macOS 10.10, *)) {                                       \
+        [o_slider setControlSize: NSControlSizeSmall];                      \
+    }                                                                       \
 }
 
 #define ADD_CHECKBOX(o_checkbox, superFrame, x_offset, my_y_offset, label,  \
@@ -1323,7 +1327,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 {
     NSRect mainFrame = [parentView frame];
     NSString *labelString, *toolTip;
-    mainFrame.size.height = 23;
+    mainFrame.size.height = 24;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
@@ -1614,7 +1618,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 {
     NSRect mainFrame = [parentView frame];
     NSString *labelString, *toolTip;
-    mainFrame.size.height = 23;
+    mainFrame.size.height = 24;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/34cd4a615437c3fbef48458cd9328b9de9cb61d3...1ffa1ecfe086a86d8361dcab162862afaeb759e4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/34cd4a615437c3fbef48458cd9328b9de9cb61d3...1ffa1ecfe086a86d8361dcab162862afaeb759e4
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