Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
cd8f993a
Commit
cd8f993a
authored
Feb 24, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: adapt VLCTimeField and add additional option for remaining state of fs field
parent
021b9f25
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
18 deletions
+52
-18
modules/gui/macosx/ControlsBar.m
modules/gui/macosx/ControlsBar.m
+8
-0
modules/gui/macosx/fspanel.m
modules/gui/macosx/fspanel.m
+1
-0
modules/gui/macosx/misc.h
modules/gui/macosx/misc.h
+8
-1
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+35
-17
No files found.
modules/gui/macosx/ControlsBar.m
View file @
cd8f993a
...
...
@@ -108,8 +108,16 @@
[
o_play_btn
setImage
:
o_play_img
];
[
o_play_btn
setAlternateImage
:
o_play_pressed_img
];
NSColor
*
o_string_color
;
if
(
!
var_InheritBool
(
VLCIntf
,
"macosx-interfacestyle"
))
o_string_color
=
[
NSColor
colorWithCalibratedRed
:
0
.
229
green
:
0
.
229
blue
:
0
.
229
alpha
:
100
.
0
];
else
o_string_color
=
[
NSColor
colorWithCalibratedRed
:
0
.
64
green
:
0
.
64
blue
:
0
.
64
alpha
:
100
.
0
];
[
o_time_fld
setTextColor
:
o_string_color
];
[
o_time_fld
setFont
:[
NSFont
titleBarFontOfSize
:
10
.
0
]];
[
o_time_fld
setAlignment
:
NSCenterTextAlignment
];
[
o_time_fld
setNeedsDisplay
:
YES
];
[
o_time_fld
setRemainingIdentifier
:
@"DisplayTimeAsTimeRemaining"
];
// prepare time slider fance gradient view
if
(
!
b_dark_interface
)
{
...
...
modules/gui/macosx/fspanel.m
View file @
cd8f993a
...
...
@@ -472,6 +472,7 @@
s_rc
.
origin
.
y
=
64
;
s_rc
.
size
.
width
=
65
;
addTextfield
(
VLCTimeField
,
o_streamLength_txt
,
NSRightTextAlignment
,
systemFontOfSize
,
whiteColor
);
[
o_streamLength_txt
setRemainingIdentifier
:
@"DisplayFullscreenTimeAsTimeRemaining"
];
o_background_img
=
[[
NSImage
imageNamed
:
@"fs_background"
]
retain
];
o_vol_sld_img
=
[[
NSImage
imageNamed
:
@"fs_volume_slider_bar"
]
retain
];
...
...
modules/gui/macosx/misc.h
View file @
cd8f993a
...
...
@@ -150,10 +150,17 @@
@interface
VLCTimeField
:
NSTextField
{
NSShadow
*
o_string_shadow
;
NSDictionary
*
o_string_attributes_dict
;
NSTextAlignment
textAlignment
;
NSString
*
o_remaining_identifier
;
BOOL
b_time_remaining
;
}
@property
(
readonly
)
BOOL
timeRemaining
;
-
(
id
)
initWithFrame
:(
NSRect
)
frameRect
;
-
(
void
)
setRemainingIdentifier
:(
NSString
*
)
o_string
;
@end
/*****************************************************************************
...
...
modules/gui/macosx/misc.m
View file @
cd8f993a
...
...
@@ -603,21 +603,28 @@ void _drawFrameInRect(NSRect frameRect)
@implementation
VLCTimeField
+
(
void
)
initialize
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
NSDictionary
*
appDefaults
=
[
NSDictionary
dictionaryWithObject
:
@"NO"
forKey
:
@"DisplayTimeAsTimeRemaining"
];
NSDictionary
*
appDefaults
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:
@"NO"
,
@"DisplayTimeAsTimeRemaining"
,
@"YES"
,
@"DisplayFullscreenTimeAsTimeRemaining"
,
nil
];
[
defaults
registerDefaults
:
appDefaults
];
}
-
(
void
)
awakeFromNib
-
(
id
)
initWithFrame
:(
NSRect
)
frameRect
{
NSColor
*
o_string_color
;
if
(
!
config_GetInt
(
VLCIntf
,
"macosx-interfacestyle"
))
o_string_color
=
[
NSColor
colorWithCalibratedRed
:
0
.
229
green
:
0
.
229
blue
:
0
.
229
alpha
:
100
.
0
];
else
o_string_color
=
[
NSColor
colorWithCalibratedRed
:
0
.
64
green
:
0
.
64
blue
:
0
.
64
alpha
:
100
.
0
];
if
(
self
=
[
super
initWithFrame
:
frameRect
])
{
textAlignment
=
NSCenterTextAlignment
;
o_string_attributes_dict
=
[[
NSDictionary
dictionaryWithObjectsAndKeys
:
o_string_color
,
NSForegroundColorAttributeName
,
[
NSFont
titleBarFontOfSize
:
10
.
0
],
NSFontAttributeName
,
nil
]
retain
];
o_remaining_identifier
=
@""
;
}
return
self
;
}
-
(
void
)
setRemainingIdentifier
:(
NSString
*
)
o_string
{
o_remaining_identifier
=
o_string
;
b_time_remaining
=
[[
NSUserDefaults
standardUserDefaults
]
boolForKey
:
o_remaining_identifier
];
}
-
(
void
)
setAlignment
:(
NSTextAlignment
)
alignment
...
...
@@ -629,7 +636,6 @@ void _drawFrameInRect(NSRect frameRect)
-
(
void
)
dealloc
{
[
o_string_shadow
release
];
[
o_string_attributes_dict
release
];
[
super
dealloc
];
}
...
...
@@ -642,7 +648,7 @@ void _drawFrameInRect(NSRect frameRect)
[
o_string_shadow
setShadowBlurRadius
:
0
.
0
];
}
NSMutableAttributedString
*
o_attributed_string
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
string
attributes
:
o_string_attributes_dict
];
NSMutableAttributedString
*
o_attributed_string
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
string
attributes
:
nil
];
NSUInteger
i_stringLength
=
[
string
length
];
[
o_attributed_string
addAttribute
:
NSShadowAttributeName
value
:
o_string_shadow
range
:
NSMakeRange
(
0
,
i_stringLength
)];
...
...
@@ -657,17 +663,29 @@ void _drawFrameInRect(NSRect frameRect)
[[[
VLCMain
sharedInstance
]
controls
]
goToSpecificTime
:
nil
];
else
{
if
([[
NSUserDefaults
standardUserDefaults
]
boolForKey
:
@"DisplayTimeAsTimeRemaining"
])
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@"NO"
forKey
:
@"DisplayTimeAsTimeRemaining"
];
else
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@"YES"
forKey
:
@"DisplayTimeAsTimeRemaining"
];
if
(
!
[
o_remaining_identifier
isEqualToString
:
@""
])
{
if
([[
NSUserDefaults
standardUserDefaults
]
boolForKey
:
o_remaining_identifier
])
{
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@"NO"
forKey
:
o_remaining_identifier
];
b_time_remaining
=
NO
;
}
else
{
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@"YES"
forKey
:
o_remaining_identifier
];
b_time_remaining
=
YES
;
}
}
else
{
b_time_remaining
=
!
b_time_remaining
;
[[
NSUserDefaults
standardUserDefaults
]
setObject
:(
b_time_remaining
?
@"YES"
:
@"NO"
)
forKey
:
o_remaining_identifier
];
}
}
}
-
(
BOOL
)
timeRemaining
{
return
[[
NSUserDefaults
standardUserDefaults
]
boolForKey
:
@"DisplayTimeAsTimeRemaining"
];
if
(
!
[
o_remaining_identifier
isEqualToString
:
@""
])
return
[[
NSUserDefaults
standardUserDefaults
]
boolForKey
:
o_remaining_identifier
];
else
return
b_time_remaining
;
}
@end
/*****************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment