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
882c580c
Commit
882c580c
authored
Jan 03, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/VLC_app: NSToolbar-ify our toolbar.
parent
7271b01d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1345 additions
and
1101 deletions
+1345
-1101
extras/MacOSX/VLC_app/English.lproj/MainWindow.xib
extras/MacOSX/VLC_app/English.lproj/MainWindow.xib
+1255
-1098
extras/MacOSX/VLC_app/Sources/VLCMainWindow.h
extras/MacOSX/VLC_app/Sources/VLCMainWindow.h
+6
-1
extras/MacOSX/VLC_app/Sources/VLCMainWindow.m
extras/MacOSX/VLC_app/Sources/VLCMainWindow.m
+84
-2
No files found.
extras/MacOSX/VLC_app/English.lproj/MainWindow.xib
View file @
882c580c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
extras/MacOSX/VLC_app/Sources/VLCMainWindow.h
View file @
882c580c
...
...
@@ -53,8 +53,13 @@
IBOutlet
NSButton
*
addPlaylistButton
;
IBOutlet
NSButton
*
removePlaylistButton
;
/* Toolbar */
IBOutlet
NSView
*
toolbarMediaAudioVolume
;
IBOutlet
NSView
*
toolbarMediaDescription
;
IBOutlet
NSView
*
toolbarMediaControl
;
VLCMediaPlayer
*
mediaPlayer
;
IBOutlet
VLCController
*
controller
;
/* This is a VLCController binded to the File's Owner of the nib */
/* Controllers */
...
...
extras/MacOSX/VLC_app/Sources/VLCMainWindow.m
View file @
882c580c
...
...
@@ -191,6 +191,10 @@
[
videoView
setTarget
:
self
];
[
videoView
setAction
:
@selector
(
videoViewItemClicked
:)];
/***********************************
* Toolbar setup
*/
[[
self
toolbar
]
setDelegate
:
self
];
/***********************************
* Other interface element setup
...
...
@@ -321,7 +325,7 @@
-
(
void
)
splitView
:(
NSSplitView
*
)
sender
resizeSubviewsWithOldSize
:(
NSSize
)
oldSize
{
[
sender
adjustSubviews
];
[
sender
adjustSubviews
];
/* Hack, because sliding cause some glitches */
[
navigatorView
setFrame
:[[
navigatorView
superview
]
bounds
]];
...
...
@@ -332,7 +336,7 @@
{
/* Hack, because sliding cause some glitches */
[
navigatorView
moveSubviewsToVisible
];
/* This could be changed from now on, so post a KVO notification */
[
self
willChangeValueForKey
:
@"navigatorViewVisible"
];
}
...
...
@@ -350,3 +354,81 @@
return
proposedFrameSize
;
}
@end
@implementation
VLCMainWindow
(
NSToolbarDelegating
)
/* Our item identifiers */
static
NSString
*
VLCToolbarMediaControl
=
@"VLCToolbarMediaControl"
;
static
NSString
*
VLCToolbarMediaAudioVolume
=
@"VLCToolbarMediaAudioVolume"
;
static
NSString
*
VLCToolbarMediaDescription
=
@"VLCToolbarMediaDescription"
;
-
(
NSArray
*
)
toolbarAllowedItemIdentifiers
:(
NSToolbar
*
)
toolbar
{
NSLog
(
@"hello"
);
return
[
NSArray
arrayWithObjects
:
NSToolbarCustomizeToolbarItemIdentifier
,
NSToolbarFlexibleSpaceItemIdentifier
,
NSToolbarSpaceItemIdentifier
,
NSToolbarSeparatorItemIdentifier
,
VLCToolbarMediaControl
,
VLCToolbarMediaAudioVolume
,
VLCToolbarMediaDescription
,
nil
];
}
-
(
NSArray
*
)
toolbarDefaultItemIdentifiers
:
(
NSToolbar
*
)
toolbar
{
return
[
NSArray
arrayWithObjects
:
VLCToolbarMediaControl
,
VLCToolbarMediaAudioVolume
,
VLCToolbarMediaDescription
,
nil
];
}
-
(
NSToolbarItem
*
)
toolbar
:(
NSToolbar
*
)
toolbar
itemForItemIdentifier
:(
NSString
*
)
itemIdentifier
willBeInsertedIntoToolbar
:(
BOOL
)
flag
{
NSToolbarItem
*
toolbarItem
=
[[[
NSToolbarItem
alloc
]
initWithItemIdentifier
:
itemIdentifier
]
autorelease
];
if
(
[
itemIdentifier
isEqual
:
VLCToolbarMediaControl
]
)
{
[
toolbarItem
setLabel
:
@"Media Controls"
];
[
toolbarItem
setPaletteLabel
:
@"Media Controls"
];
[
toolbarItem
setView
:
toolbarMediaControl
];
[
toolbarItem
setMinSize
:[[
toolbarItem
view
]
frame
].
size
];
[
toolbarItem
setMaxSize
:[[
toolbarItem
view
]
frame
].
size
];
/* TODO: setup a menu */
}
else
if
(
[
itemIdentifier
isEqual
:
VLCToolbarMediaAudioVolume
]
)
{
[
toolbarItem
setLabel
:
@"Audio Volume"
];
[
toolbarItem
setPaletteLabel
:
@"Audio Volume"
];
[
toolbarItem
setView
:
toolbarMediaAudioVolume
];
[
toolbarItem
setMinSize
:[[
toolbarItem
view
]
frame
].
size
];
[
toolbarItem
setMaxSize
:[[
toolbarItem
view
]
frame
].
size
];
/* TODO: setup a menu */
}
else
if
(
[
itemIdentifier
isEqual
:
VLCToolbarMediaDescription
]
)
{
[
toolbarItem
setLabel
:
@"Media Description"
];
[
toolbarItem
setPaletteLabel
:
@"Media Description"
];
[
toolbarItem
setView
:
toolbarMediaDescription
];
[
toolbarItem
setMinSize
:[[
toolbarItem
view
]
frame
].
size
];
[
toolbarItem
setMaxSize
:
NSMakeSize
(
10000
/* Can be really big */
,
NSHeight
([[
toolbarItem
view
]
frame
]))];
/* TODO: setup a menu */
}
else
{
/* itemIdentifier referred to a toolbar item that is not
* provided or supported by us or Cocoa
* Returning nil will inform the toolbar
* that this kind of item is not supported */
toolbarItem
=
nil
;
}
return
toolbarItem
;
}
@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