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
f325462b
Commit
f325462b
authored
Apr 06, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: re-implement 'keep aspect ratio' (close #6430)
parent
6cbf48f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+1
-1
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+22
-0
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+1
-1
No files found.
modules/gui/macosx/MainMenu.m
View file @
f325462b
...
@@ -988,7 +988,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -988,7 +988,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
{
{
NSMenuItem
*
o_lmi_tmp2
;
NSMenuItem
*
o_lmi_tmp2
;
o_lmi_tmp2
=
[
o_menu
addItemWithTitle
:
_NS
(
"Lock Aspect Ratio"
)
action
:
@selector
(
lockVideosAspectRatio
:
)
keyEquivalent
:
@""
];
o_lmi_tmp2
=
[
o_menu
addItemWithTitle
:
_NS
(
"Lock Aspect Ratio"
)
action
:
@selector
(
lockVideosAspectRatio
:
)
keyEquivalent
:
@""
];
[
o_lmi_tmp2
setTarget
:
self
];
[
o_lmi_tmp2
setTarget
:
[[
VLCMain
sharedInstance
]
controls
]
];
[
o_lmi_tmp2
setEnabled
:
YES
];
[
o_lmi_tmp2
setEnabled
:
YES
];
[
o_lmi_tmp2
setState
:
[[
VLCCoreInteraction
sharedInstance
]
aspectRatioIsLocked
]];
[
o_lmi_tmp2
setState
:
[[
VLCCoreInteraction
sharedInstance
]
aspectRatioIsLocked
]];
[
o_parent
setEnabled
:
YES
];
[
o_parent
setEnabled
:
YES
];
...
...
modules/gui/macosx/MainWindow.m
View file @
f325462b
...
@@ -131,6 +131,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -131,6 +131,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
#endif
#endif
i_lastShownVolume
=
-
1
;
i_lastShownVolume
=
-
1
;
t_hide_mouse_timer
=
nil
;
t_hide_mouse_timer
=
nil
;
[
o_detached_video_window
setDelegate
:
self
];
[
self
useOptimizedDrawing
:
YES
];
[
self
useOptimizedDrawing
:
YES
];
[
o_play_btn
setToolTip
:
_NS
(
"Play/Pause"
)];
[
o_play_btn
setToolTip
:
_NS
(
"Play/Pause"
)];
...
@@ -1046,6 +1047,27 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -1046,6 +1047,27 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
}
}
-
(
NSSize
)
windowWillResize
:(
NSWindow
*
)
window
toSize
:(
NSSize
)
proposedFrameSize
{
id
videoWindow
=
[
o_video_view
window
];
if
(
!
[[
VLCMain
sharedInstance
]
activeVideoPlayback
]
||
nativeVideoSize
.
width
==
0
.
||
nativeVideoSize
.
height
==
0
.
||
window
!=
videoWindow
)
return
proposedFrameSize
;
if
(
[[
VLCCoreInteraction
sharedInstance
]
aspectRatioIsLocked
]
)
{
NSRect
videoWindowFrame
=
[
videoWindow
frame
];
NSRect
viewRect
=
[
o_video_view
convertRect
:[
o_video_view
bounds
]
toView
:
nil
];
NSRect
contentRect
=
[
videoWindow
contentRectForFrameRect
:
videoWindowFrame
];
float
marginy
=
viewRect
.
origin
.
y
+
videoWindowFrame
.
size
.
height
-
contentRect
.
size
.
height
;
float
marginx
=
contentRect
.
size
.
width
-
viewRect
.
size
.
width
;
proposedFrameSize
.
height
=
(
proposedFrameSize
.
width
-
marginx
)
*
nativeVideoSize
.
height
/
nativeVideoSize
.
width
+
marginy
;
}
return
proposedFrameSize
;
}
#pragma mark -
#pragma mark -
#pragma mark Update interface and respond to foreign events
#pragma mark Update interface and respond to foreign events
-
(
void
)
showDropZone
-
(
void
)
showDropZone
...
...
modules/gui/macosx/controls.m
View file @
f325462b
...
@@ -207,7 +207,7 @@
...
@@ -207,7 +207,7 @@
-
(
IBAction
)
lockVideosAspectRatio
:(
id
)
sender
-
(
IBAction
)
lockVideosAspectRatio
:(
id
)
sender
{
{
[[
VLCCoreInteraction
sharedInstance
]
setAspectRatioLocked
:
[
sender
state
]];
[[
VLCCoreInteraction
sharedInstance
]
setAspectRatioLocked
:
!
[
sender
state
]];
[
sender
setState
:
[[
VLCCoreInteraction
sharedInstance
]
aspectRatioIsLocked
]];
[
sender
setState
:
[[
VLCCoreInteraction
sharedInstance
]
aspectRatioIsLocked
]];
}
}
...
...
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