Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
LibVLCSharp
Commits
37c43bac
Commit
37c43bac
authored
May 03, 2020
by
Stéphane Mitermite
Committed by
Martin Finkel
May 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent AspectRatio menu item from being unchecked
parent
c36a2e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
src/LibVLCSharp.Uno/PlaybackControlsBase.cs
src/LibVLCSharp.Uno/PlaybackControlsBase.cs
+15
-4
No files found.
src/LibVLCSharp.Uno/PlaybackControlsBase.cs
View file @
37c43bac
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
FontAwesome
;
...
...
@@ -696,18 +696,29 @@ namespace LibVLCSharp.Uno
private
void
AspectRatioMenuItemClick
(
AspectRatio
aspectRatio
)
{
Manager
.
Get
<
AspectRatioManager
>().
AspectRatio
=
aspectRatio
;
var
aspectRatioManager
=
Manager
.
Get
<
AspectRatioManager
>();
var
currentAspectRatio
=
aspectRatioManager
.
AspectRatio
;
aspectRatioManager
.
AspectRatio
=
aspectRatio
;
if
(
currentAspectRatio
==
aspectRatio
)
{
// To prevent the menu item from being unchecked
UpdateZoomMenu
(
aspectRatio
);
}
}
private
void
AspectRatioChanged
(
object
sender
,
EventArgs
e
)
private
void
UpdateZoomMenu
(
AspectRatio
aspectRatio
)
{
if
(
ZoomMenu
!=
null
)
{
var
aspectRatio
=
((
AspectRatioManager
)
sender
).
AspectRatio
;
CheckMenuItem
(
ZoomMenu
,
ZoomMenu
.
Items
.
OfType
<
ToggleMenuFlyoutItem
>().
First
(
i
=>
(
AspectRatio
)
i
.
CommandParameter
==
aspectRatio
));
}
}
private
void
AspectRatioChanged
(
object
sender
,
EventArgs
e
)
{
UpdateZoomMenu
(((
AspectRatioManager
)
sender
).
AspectRatio
);
}
private
void
Flyout_Opened
(
object
sender
,
object
e
)
{
Manager
.
Get
<
AutoHideNotifier
>().
Enabled
=
false
;
...
...
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