[vlc-commits] macosx: Force arrow cursor for extension UI labels

Marvin Scholz git at videolan.org
Fri Feb 16 20:13:52 CET 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Feb 16 20:13:29 2018 +0100| [4980447fd4e52291b6c8e5a5754ee8492f81ea2a] | committer: Marvin Scholz

macosx: Force arrow cursor for extension UI labels

Now that labels have to be selectable, force the cursor to the arrow
cursor instead of the text selection cursor.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4980447fd4e52291b6c8e5a5754ee8492f81ea2a
---

 modules/gui/macosx/VLCExtensionsDialogProvider.m | 2 +-
 modules/gui/macosx/VLCUIWidgets.h                | 3 +++
 modules/gui/macosx/VLCUIWidgets.m                | 5 +++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCExtensionsDialogProvider.m b/modules/gui/macosx/VLCExtensionsDialogProvider.m
index 234689cb6f..4ceb2e1a84 100644
--- a/modules/gui/macosx/VLCExtensionsDialogProvider.m
+++ b/modules/gui/macosx/VLCExtensionsDialogProvider.m
@@ -55,7 +55,7 @@ static NSView *createControlFromWidget(extension_widget_t *widget, id self)
             }
             case EXTENSION_WIDGET_LABEL:
             {
-                NSTextField *field = [[NSTextField alloc] init];
+                VLCDialogLabel *field = [[VLCDialogLabel alloc] init];
                 [field setEditable:NO];
                 [field setBordered:NO];
                 [field setDrawsBackground:NO];
diff --git a/modules/gui/macosx/VLCUIWidgets.h b/modules/gui/macosx/VLCUIWidgets.h
index 3bb11ade79..4948af2633 100644
--- a/modules/gui/macosx/VLCUIWidgets.h
+++ b/modules/gui/macosx/VLCUIWidgets.h
@@ -35,6 +35,9 @@
 @property (readwrite) extension_widget_t *widget;
 @end
 
+ at interface VLCDialogLabel : NSTextField
+ at end
+
 @interface VLCDialogTextField : NSTextField
 @property (readwrite) extension_widget_t *widget;
 @end
diff --git a/modules/gui/macosx/VLCUIWidgets.m b/modules/gui/macosx/VLCUIWidgets.m
index 2cddcb40eb..49818af70c 100644
--- a/modules/gui/macosx/VLCUIWidgets.m
+++ b/modules/gui/macosx/VLCUIWidgets.m
@@ -41,6 +41,11 @@
 
 @end
 
+ at implementation VLCDialogLabel
+- (void)resetCursorRects {
+    [self addCursorRect:[self bounds] cursor:[NSCursor arrowCursor]];
+}
+ at end
 
 @implementation VLCDialogWindow
 



More information about the vlc-commits mailing list