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
ca80c3e8
Commit
ca80c3e8
authored
Dec 26, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: added menu item and advanced option to hide the main window's sidebar
parent
16e6cbda
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
13 deletions
+114
-13
extras/package/macosx/Resources/English.lproj/MainMenu.xib
extras/package/macosx/Resources/English.lproj/MainMenu.xib
+59
-6
modules/gui/macosx/MainMenu.h
modules/gui/macosx/MainMenu.h
+3
-0
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+15
-0
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.h
+5
-3
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+28
-4
modules/gui/macosx/macosx.m
modules/gui/macosx/macosx.m
+4
-0
No files found.
extras/package/macosx/Resources/English.lproj/MainMenu.xib
View file @
ca80c3e8
This diff is collapsed.
Click to expand it.
modules/gui/macosx/MainMenu.h
View file @
ca80c3e8
...
...
@@ -80,6 +80,7 @@
IBOutlet
NSMenu
*
o_mu_view
;
IBOutlet
NSMenuItem
*
o_mi_toggleJumpButtons
;
IBOutlet
NSMenuItem
*
o_mi_togglePlaymodeButtons
;
IBOutlet
NSMenuItem
*
o_mi_toggleSidebar
;
IBOutlet
NSMenu
*
o_mu_playlistTableColumns
;
NSMenu
*
o_mu_playlistTableColumnsContextMenu
;
...
...
@@ -215,6 +216,7 @@
-
(
void
)
setSubmenusEnabled
:(
BOOL
)
b_enabled
;
-
(
void
)
setRateControlsEnabled
:(
BOOL
)
b_enabled
;
-
(
void
)
setupExtensionsMenu
;
-
(
void
)
updateSidebarMenuItem
;
-
(
IBAction
)
intfOpenFile
:(
id
)
sender
;
-
(
IBAction
)
intfOpenFileGeneric
:(
id
)
sender
;
...
...
@@ -224,6 +226,7 @@
-
(
IBAction
)
toggleJumpButtons
:(
id
)
sender
;
-
(
IBAction
)
togglePlaymodeButtons
:(
id
)
sender
;
-
(
IBAction
)
toggleSidebar
:(
id
)
sender
;
-
(
IBAction
)
togglePlaylistColumnTable
:(
id
)
sender
;
-
(
void
)
setPlaylistColumnTableState
:(
NSInteger
)
i_state
forColumn
:(
NSString
*
)
o_column
;
-
(
NSMenu
*
)
setupPlaylistTableColumnsMenu
;
...
...
modules/gui/macosx/MainMenu.m
View file @
ca80c3e8
...
...
@@ -302,6 +302,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
[
o_mi_toggleJumpButtons
setState
:
config_GetInt
(
VLCIntf
,
"macosx-show-playback-buttons"
)];
[
o_mi_togglePlaymodeButtons
setTitle
:
_NS
(
"Show Shuffle & Repeat Buttons"
)];
[
o_mi_togglePlaymodeButtons
setState
:
config_GetInt
(
VLCIntf
,
"macosx-show-playmode-buttons"
)];
[
o_mi_toggleSidebar
setTitle
:
_NS
(
"Show Sidebar"
)];
[
o_mi_toggleSidebar
setState
:
config_GetInt
(
VLCIntf
,
"macosx-show-sidebar"
)];
[
o_mu_playlistTableColumns
setTitle
:
_NS
(
"Playlist Table Columns"
)];
[
o_mu_controls
setTitle
:
_NS
(
"Playback"
)];
...
...
@@ -647,6 +649,19 @@ static VLCMainMenu *_o_sharedInstance = nil;
[
o_mi_togglePlaymodeButtons
setState
:
b_value
];
}
-
(
IBAction
)
toggleSidebar
:(
id
)
sender
{
BOOL
b_value
=
!
config_GetInt
(
VLCIntf
,
"macosx-show-sidebar"
);
config_PutInt
(
VLCIntf
,
"macosx-show-sidebar"
,
b_value
);
[[[
VLCMain
sharedInstance
]
mainWindow
]
toggleLeftSubSplitView
];
[
o_mi_toggleSidebar
setState
:
b_value
];
}
-
(
void
)
updateSidebarMenuItem
{
[
o_mi_toggleSidebar
setState
:
config_GetInt
(
VLCIntf
,
"macosx-show-sidebar"
)];
}
-
(
IBAction
)
togglePlaylistColumnTable
:(
id
)
sender
{
NSInteger
i_new_state
=
!
[
sender
state
];
...
...
modules/gui/macosx/MainWindow.h
View file @
ca80c3e8
...
...
@@ -44,7 +44,7 @@
@interface
VLCMainWindow
:
VLCVideoWindowCommon
<
PXSourceListDataSource
,
PXSourceListDelegate
,
NSWindowDelegate
,
NSAnimationDelegate
,
NSSplitViewDelegate
>
{
IBOutlet
id
o_search_fld
;
IBOutlet
id
o_playlist_table
;
IBOutlet
id
o_split_view
;
IBOutlet
id
o_left_split_view
;
...
...
@@ -82,7 +82,8 @@
BOOL
b_splitview_removed
;
BOOL
b_minimized_view
;
int
i_lastSplitViewHeight
;
NSUInteger
i_lastSplitViewHeight
;
NSUInteger
i_lastLeftSplitViewWidth
;
NSMutableArray
*
o_sidebaritems
;
...
...
@@ -120,6 +121,7 @@
-
(
void
)
windowResizedOrMoved
:(
NSNotification
*
)
notification
;
-
(
void
)
toggleLeftSubSplitView
;
-
(
void
)
showDropZone
;
-
(
void
)
hideDropZone
;
-
(
void
)
showSplitView
;
...
...
@@ -150,4 +152,4 @@
VLCColorView
*
o_color_backdrop
;
}
@end
\ No newline at end of file
@end
modules/gui/macosx/MainWindow.m
View file @
ca80c3e8
...
...
@@ -370,8 +370,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
someWindowWillClose
:
)
name
:
NSWindowWillCloseNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
someWindowWillMiniaturize
:
)
name
:
NSWindowWillMiniaturizeNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
applicationWillTerminate
:
)
name
:
NSApplicationWillTerminateNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
mainSplitViewWillResizeSubviews
:
)
name
:
NSSplitViewWillResizeSubviewsNotification
object
:
o_split_view
];
[
o_split_view
setAutosaveName
:
@"10thanniversary-splitview"
];
if
(
b_splitviewShouldBeHidden
)
{
[
self
hideSplitView
];
i_lastSplitViewHeight
=
300
;
...
...
@@ -385,13 +385,19 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
self
resizeWindow
];
}
/
/ update fs button to reflect state for next startup
if
(
var_InheritBool
(
pl_Get
(
VLCIntf
),
"fullscreen"
))
{
/
* update fs button to reflect state for next startup */
if
(
var_InheritBool
(
pl_Get
(
VLCIntf
),
"fullscreen"
))
[
o_controls_bar
setFullscreenState
:
YES
];
}
/* restore split view */
i_lastLeftSplitViewWidth
=
200
;
/* trick NSSplitView implementation, which pretends to know better than us */
if
(
!
config_GetInt
(
VLCIntf
,
"macosx-show-sidebar"
))
[
self
performSelector
:
@selector
(
toggleLeftSubSplitView
)
withObject
:
nil
afterDelay
:
0
.
05
];
}
#pragma mark -
#pragma mark appearance management
-
(
VLCMainWindowControlsBar
*
)
controlsBar
;
{
...
...
@@ -518,6 +524,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
notification
{
config_PutInt
(
VLCIntf
,
"macosx-show-sidebar"
,
!
[
o_split_view
isSubviewCollapsed
:
o_left_split_view
]);
[
self
saveFrameUsingName
:
[
self
frameAutosaveName
]];
}
...
...
@@ -959,6 +967,22 @@ static VLCMainWindow *_o_sharedInstance = nil;
return
YES
;
}
-
(
void
)
mainSplitViewWillResizeSubviews
:(
id
)
object
{
i_lastLeftSplitViewWidth
=
[
o_left_split_view
frame
].
size
.
width
;
config_PutInt
(
VLCIntf
,
"macosx-show-sidebar"
,
!
[
o_split_view
isSubviewCollapsed
:
o_left_split_view
]);
[[[
VLCMain
sharedInstance
]
mainMenu
]
updateSidebarMenuItem
];
}
-
(
void
)
toggleLeftSubSplitView
{
[
o_split_view
adjustSubviews
];
if
([
o_split_view
isSubviewCollapsed
:
o_left_split_view
])
[
o_split_view
setPosition
:
i_lastLeftSplitViewWidth
ofDividerAtIndex
:
0
];
else
[
o_split_view
setPosition
:[
o_split_view
minPossiblePositionOfDividerAtIndex
:
0
]
ofDividerAtIndex
:
0
];
}
#pragma mark -
#pragma mark Side Bar Data handling
/* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
...
...
modules/gui/macosx/macosx.m
View file @
ca80c3e8
...
...
@@ -116,6 +116,9 @@ void WindowClose (vout_window_t *);
#define PLAYMODEBUTTONS_TEXT N_("Show play mode control buttons")
#define PLAYMODEBUTTONS_LONGTEXT N_("Shows the shuffle and repeat buttons in the main window")
#define SIDEBAR_TEXT N_("Show sidebar")
#define SIDEBAR_LONGTEXT N_("Shows a sidebar in the main window listing media sources")
vlc_module_begin ()
set_description(N_("Mac OS X interface"))
set_capability("interface", 200)
...
...
@@ -141,6 +144,7 @@ vlc_module_begin ()
add_bool("macosx-icon-change", true, ICONCHANGE_TEXT, ICONCHANGE_LONGTEXT, true)
add_bool("macosx-show-playback-buttons", false, JUMPBUTTONS_TEXT, JUMPBUTTONS_LONGTEXT, false)
add_bool("macosx-show-playmode-buttons", true, PLAYMODEBUTTONS_TEXT, PLAYMODEBUTTONS_LONGTEXT, false)
add_bool("macosx-show-sidebar", true, SIDEBAR_TEXT, SIDEBAR_LONGTEXT, false)
add_submodule ()
set_description("Mac OS X Video Output Provider")
...
...
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