Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
2d476ce7
Commit
2d476ce7
authored
Jul 26, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: implemented fancy gradient effect for the time slider (fixes #4945)
parent
fb51fe1d
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
21 deletions
+127
-21
extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
...acosx/Resources/English.lproj/MainMenu.nib/designable.nib
+60
-20
extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
...osx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
+0
-0
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.h
+11
-0
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+55
-1
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+1
-0
No files found.
extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
View file @
2d476ce7
This diff is collapsed.
Click to expand it.
extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
View file @
2d476ce7
No preview for this file type
modules/gui/macosx/MainWindow.h
View file @
2d476ce7
...
...
@@ -43,6 +43,7 @@
IBOutlet
id
o_volume_down_btn
;
IBOutlet
id
o_volume_up_btn
;
IBOutlet
id
o_time_sld
;
IBOutlet
id
o_time_sld_fancygradient_view
;
IBOutlet
id
o_time_fld
;
IBOutlet
id
o_progress_bar
;
IBOutlet
id
o_bottombar_view
;
...
...
@@ -111,4 +112,14 @@
-
(
void
)
setRepeatOff
;
-
(
void
)
setShuffle
;
-
(
void
)
drawFancyGradientEffectForTimeSlider
;
@end
@interface
VLCProgressBarGradientEffect
:
NSView
{
NSImage
*
o_time_sld_gradient_left_img
;
NSImage
*
o_time_sld_gradient_middle_img
;
NSImage
*
o_time_sld_gradient_right_img
;
}
-
(
void
)
loadImagesInDarkStyle
:(
BOOL
)
b_value
;
@end
\ No newline at end of file
modules/gui/macosx/MainWindow.m
View file @
2d476ce7
...
...
@@ -149,6 +149,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
o_effects_btn
setAlternateImage
:
[
NSImage
imageNamed
:
@"effects-double-buttons-pressed"
]];
[
o_fullscreen_btn
setImage
:
[
NSImage
imageNamed
:
@"fullscreen-double-buttons"
]];
[
o_fullscreen_btn
setAlternateImage
:
[
NSImage
imageNamed
:
@"fullscreen-double-buttons-pressed"
]];
[
o_time_sld_fancygradient_view
loadImagesInDarkStyle
:
NO
];
}
else
{
...
...
@@ -187,6 +188,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
o_effects_btn
setAlternateImage
:
[
NSImage
imageNamed
:
@"effects-double-buttons-pressed_dark"
]];
[
o_fullscreen_btn
setImage
:
[
NSImage
imageNamed
:
@"fullscreen-double-buttons_dark"
]];
[
o_fullscreen_btn
setAlternateImage
:
[
NSImage
imageNamed
:
@"fullscreen-double-buttons-pressed_dark"
]];
[
o_time_sld_fancygradient_view
loadImagesInDarkStyle
:
YES
];
}
[
o_repeat_btn
setImage
:
o_repeat_img
];
[
o_repeat_btn
setAlternateImage
:
o_repeat_pressed_img
];
...
...
@@ -205,6 +207,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
o_playlist_btn
setEnabled
:
NO
];
[
self
updateVolumeSlider
];
[
self
updateTimeSlider
];
}
#pragma mark -
...
...
@@ -423,6 +426,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[[[
VLCMain
sharedInstance
]
controls
]
fspanel
]
setStreamPos
:
f_updated
andTime
:
o_time
];
vlc_object_release
(
p_input
);
}
[
self
drawFancyGradientEffectForTimeSlider
];
}
-
(
IBAction
)
timeFieldWasClicked
:(
id
)
sender
...
...
@@ -483,6 +487,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
o_time_fld
setStringValue
:
o_time
];
// [[[[VLCMain sharedInstance] controls] fspanel] setStreamPos: f_updated andTime: o_time];
}
else
{
[
o_time_sld
setFloatValue
:
0
.
0
];
[
o_time_fld
setStringValue
:
@"00:00"
];
}
[
self
performSelectorOnMainThread
:
@selector
(
drawFancyGradientEffectForTimeSlider
)
withObject
:
nil
waitUntilDone
:
NO
];
}
-
(
void
)
updateVolumeSlider
...
...
@@ -630,6 +641,25 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
o_play_btn
setToolTip
:
_NS
(
"Play"
)];
}
-
(
void
)
drawFancyGradientEffectForTimeSlider
{
float
f_value
=
([
o_time_sld_middle_view
frame
].
size
.
width
-
5
)
*
([
o_time_sld
intValue
]
/
[
o_time_sld
maxValue
]);
if
(
f_value
>
5
.
0
)
{
if
(
f_value
!=
[
o_time_sld_fancygradient_view
frame
].
size
.
width
)
{
[
o_time_sld_fancygradient_view
setHidden
:
NO
];
[
o_time_sld_fancygradient_view
setFrame
:
NSMakeRect
(
[
o_time_sld_fancygradient_view
frame
].
origin
.
x
,
[
o_time_sld_fancygradient_view
frame
].
origin
.
y
,
f_value
,
[
o_time_sld_fancygradient_view
frame
].
size
.
height
)];
[
o_time_sld_fancygradient_view
setNeedsDisplay
:
YES
];
[
o_time_sld_fancygradient_view
displayIfNeeded
];
}
}
else
{
[
o_time_sld_fancygradient_view
setHidden
:
YES
];
}
}
#pragma mark -
#pragma mark Video Output handling
...
...
@@ -653,3 +683,27 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
@end
@implementation
VLCProgressBarGradientEffect
-
(
void
)
loadImagesInDarkStyle
:
(
BOOL
)
b_value
{
if
(
b_value
)
{
o_time_sld_gradient_left_img
=
[
NSImage
imageNamed
:
@"progressbar-fill-left_dark"
];
o_time_sld_gradient_middle_img
=
[
NSImage
imageNamed
:
@"progressbar-fill-middle_dark"
];
o_time_sld_gradient_right_img
=
[
NSImage
imageNamed
:
@"progressbar-fill-right_dark"
];
}
else
{
o_time_sld_gradient_left_img
=
[
NSImage
imageNamed
:
@"progression-fill-left"
];
o_time_sld_gradient_middle_img
=
[
NSImage
imageNamed
:
@"progression-fill-middle"
];
o_time_sld_gradient_right_img
=
[
NSImage
imageNamed
:
@"progression-fill-right"
];
}
}
-
(
void
)
drawRect
:(
NSRect
)
rect
{
NSRect
bnds
=
[
self
bounds
];
NSDrawThreePartImage
(
bnds
,
o_time_sld_gradient_left_img
,
o_time_sld_gradient_middle_img
,
o_time_sld_gradient_right_img
,
NO
,
NSCompositeSourceOver
,
1
,
NO
);
}
@end
modules/gui/macosx/intf.m
View file @
2d476ce7
...
...
@@ -278,6 +278,7 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
case
INPUT_EVENT_ITEM_NAME
:
[[
VLCMain
sharedInstance
]
updateName
];
[[
VLCMain
sharedInstance
]
playlistUpdated
];
break
;
case
INPUT_EVENT_AUDIO_DELAY
:
...
...
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