[vlc-commits] macOS: Do not draw custom VLCHUDTextFieldCell on 10.10+
Marvin Scholz
git at videolan.org
Sat Jun 17 03:24:18 CEST 2017
vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Jun 17 02:23:17 2017 +0200| [34fd65980a6af273748527f4b5030e2e70b316e4] | committer: Marvin Scholz
macOS: Do not draw custom VLCHUDTextFieldCell on 10.10+
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=34fd65980a6af273748527f4b5030e2e70b316e4
---
modules/gui/macosx/VLCHUDTextFieldCell.m | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules/gui/macosx/VLCHUDTextFieldCell.m b/modules/gui/macosx/VLCHUDTextFieldCell.m
index e5b8bd8287..364b54e62c 100644
--- a/modules/gui/macosx/VLCHUDTextFieldCell.m
+++ b/modules/gui/macosx/VLCHUDTextFieldCell.m
@@ -38,6 +38,13 @@
// provided by [tylerb](GitHub).
#import "VLCHUDTextFieldCell.h"
+#import "CompatibilityFixes.h"
+
+ at interface NSTextFieldCell (Private)
+
+- (void)_drawKeyboardFocusRingWithFrame:(NSRect)rect inView:(NSView*)view;
+
+ at end
@interface VLCHUDTextFieldCell () {
bool fillsBackground;
@@ -73,6 +80,10 @@
- (void)commonInit
{
+ if (OSX_YOSEMITE_AND_HIGHER) {
+ return;
+ }
+
// Init colors
_focusRing = [[NSShadow alloc] init];
[_focusRing setShadowColor:NSColor.whiteColor];
@@ -102,6 +113,10 @@
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj
{
+ if (OSX_YOSEMITE_AND_HIGHER) {
+ return [super setUpFieldEditorAttributes:textObj];
+ }
+
NSText *newText = [super setUpFieldEditorAttributes:textObj];
NSColor *textColor = _cellTextColor;
[(NSTextView *)newText setInsertionPointColor:textColor];
@@ -110,6 +125,10 @@
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
+ if (OSX_YOSEMITE_AND_HIGHER) {
+ return [super drawWithFrame:cellFrame inView:controlView];
+ }
+
// Adjust Rect
cellFrame = NSInsetRect(cellFrame, 0.5f, 0.5f);
@@ -273,6 +292,12 @@
- (void)_drawKeyboardFocusRingWithFrame:(NSRect)rect inView:(NSView*)view
{
+ if (OSX_YOSEMITE_AND_HIGHER) {
+ if ([super respondsToSelector:@selector(_drawKeyboardFocusRingWithFrame:inView:)]) {
+ [super _drawKeyboardFocusRingWithFrame:rect inView:view];
+ }
+ }
+
// Do nothing
}
More information about the vlc-commits
mailing list