Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requested Features - Personalisation #1217

Merged
merged 23 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e81d28b
Adds individual icons for lock keys
manstheram Aug 14, 2023
762efe8
Makes overtype and insert notification centred
manstheram Aug 14, 2023
ab6808d
Adds insert and overtype icons
manstheram Aug 15, 2023
777b19f
Add settings entries and properties
manstheram Aug 16, 2023
9fd0630
Fixed size of lock keys
manstheram Aug 16, 2023
79f7422
Fixed sizes of flyouts
manstheram Aug 17, 2023
bfb7233
Add vertical volume bar
manstheram Aug 18, 2023
ab8be3d
Finished vertical bar
manstheram Aug 18, 2023
948019d
Inactive media controls
manstheram Aug 18, 2023
4c1a9ba
Fix bug with autohide on vertical volume bar
manstheram Aug 18, 2023
6a325cc
Align volume number better
manstheram Aug 18, 2023
8987d84
Add in saving for flyout orientation
manstheram Aug 19, 2023
066fd3b
Change text
manstheram Aug 20, 2023
3f55bbd
Lock keys colour update while app is running
manstheram Aug 20, 2023
926c550
Fix Startup task
manstheram Aug 23, 2023
6f795c8
Merge branch 'main' of https://github.com/manstheram/ModernFlyouts
manstheram Aug 23, 2023
ce5924d
Add compatibility mode for wrong min/max brightness
manstheram Sep 18, 2023
da4bc8e
To reset the min/max values
manstheram Sep 18, 2023
b858898
Gap at bottom of session panel
manstheram Sep 18, 2023
2c238a8
Cleanup and bigger size when no media session on
manstheram Sep 18, 2023
a0e8392
Avoid AudioFlyoutHelper not existing when registering events for Volu…
manstheram Sep 18, 2023
530a814
Merge branch 'ModernFlyouts-Community:main' into main
manstheram Jun 20, 2024
e752891
Correct the Version Check for Volume OSD
manstheram Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ModernFlyouts/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources>
<ResourceDictionary x:Name="IconsDictionary"
Source="pack://application:,,,/ModernFlyouts;component/Assets/LockIcons.xaml" />
<ui:ThemeResources>
<ui:ThemeResources.ThemeDictionaries>
<ResourceDictionary x:Key="Light" ui:ThemeDictionary.Key="Light" local:ToolkitThemeDictionary.Key="Light">
<SolidColorBrush x:Key="FlyoutBackground" Color="#EFEFEF" />
Expand Down
42 changes: 42 additions & 0 deletions ModernFlyouts/Assets/LockIconPair.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System.Windows;
using System.Windows.Automation.Text;
using System.Windows.Media;
using System.Windows.Media.Imaging;



namespace ModernFlyouts.Assets
{
public class IconPair
{
public DrawingImage OnImage { get; set; }
public DrawingImage OffImage { get; set; }
}

public class LockIcons
{
public IconPair caps = new IconPair
{
OnImage = (DrawingImage)Application.Current.Resources["caps_on"],
OffImage = (DrawingImage)Application.Current.Resources["caps_off"]
};

public IconPair scroll_lock = new IconPair
{
OnImage = (DrawingImage)Application.Current.Resources["scroll_lock_on"],
OffImage = (DrawingImage)Application.Current.Resources["scroll_lock_off"]
};

public IconPair num = new IconPair
{
OnImage = (DrawingImage)Application.Current.Resources["num_on"],
OffImage = (DrawingImage)Application.Current.Resources["num_off"]
};

public IconPair insert = new IconPair
{
OnImage = (DrawingImage)Application.Current.Resources["insert_on"],
OffImage = (DrawingImage)Application.Current.Resources["insert_off"]
};
}
}
74 changes: 74 additions & 0 deletions ModernFlyouts/Assets/LockIcons.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DrawingImage x:Key="caps_on">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V39 H39 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M36.0759,3.7871L3.7295,3.7871 3.7295,36.1335 36.0759,36.1335 36.0759,3.7871z M0.902679,0.960281L0.902679,38.9603 38.9027,38.9603 38.9027,0.960281 0.902679,0.960281z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F1 M39,39z M0,0z M28.7209,29.8745L25.2356,29.8745 23.513,25.0005 15.9816,25.0005 14.3258,29.8745 10.8539,29.8745 18.0247,10.7256 21.6035,10.7256 28.7209,29.8745z M22.6717,22.4099L20.0144,14.7717C19.9343,14.5224,19.8497,14.1218,19.7607,13.5699L19.7073,13.5699C19.6272,14.0773,19.5381,14.4779,19.4402,14.7717L16.8096,22.4099 22.6717,22.4099z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="caps_off">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V39 H39 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M36.0759,3.7871L3.7295,3.7871 3.7295,36.1335 36.0759,36.1335 36.0759,3.7871z M0.902679,0.960281L0.902679,38.9603 38.9027,38.9603 38.9027,0.960281 0.902679,0.960281z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F1 M39,39z M0,0z M26.1822,29.8745L23.1777,29.8745 23.1777,27.7379 23.1243,27.7379C22.1806,29.376 20.7963,30.195 18.9713,30.195 17.6271,30.195 16.5721,29.83 15.8065,29.1 15.0498,28.37 14.6715,27.4041 14.6715,26.2023 14.6715,23.6206 16.1582,22.1161 19.1316,21.6888L23.191,21.1146C23.191,19.165 22.2652,18.1902 20.4135,18.1902 18.7844,18.1902 17.3155,18.751 16.0068,19.8727L16.0068,17.162C17.449,16.3073 19.1138,15.88 21.001,15.88 24.4552,15.88 26.1822,17.5804 26.1822,20.9811L26.1822,29.8745z M23.191,23.1577L20.32,23.5583C19.4298,23.674 18.7577,23.8921 18.3036,24.2126 17.8585,24.5242 17.636,25.0761 17.636,25.8684 17.636,26.4471 17.8407,26.9234 18.2502,27.2973 18.6686,27.6623 19.225,27.8448 19.9194,27.8448 20.8631,27.8448 21.642,27.5154 22.2563,26.8566 22.8794,26.1889 23.191,25.3521 23.191,24.3461L23.191,23.1577z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="scroll_lock_on">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V39 H39 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M36.0759,3.78709L3.7295,3.78709 3.7295,36.1334 36.0759,36.1334 36.0759,3.78709z M0.902679,0.960274L0.902679,38.9603 38.9027,38.9603 38.9027,0.960274 0.902679,0.960274z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M21.4175,10L21.4175,24.6943 27.2017,18.9933 29.186,21.0066 20.0041,30.0564 10.822,21.0067 12.8063,18.9933 18.5906,24.6943 18.5906,10 21.4175,10z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="scroll_lock_off">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V50 H50 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M50,50z M0,0z M41.0758,8.78709L8.72949,8.78709 8.72949,41.1334 41.0758,41.1334 41.0758,8.78709z M5.90267,5.96027L5.90267,43.9603 43.9027,43.9603 43.9027,5.96027 5.90267,5.96027z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M50,50z M0,0z M34.7238,17.8053L49.9926,2.55582 47.5044,0 32.2179,15.2672 34.7238,17.8053z M17.7701,34.7374L15.2642,32.1993 0,47.4442 2.48818,50 17.7701,34.7374z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M50,50z M0,0z M26.4174,15L26.4174,29.6943 32.2016,23.9934 34.186,26.0066 25.004,35.0564 15.822,26.0067 17.8063,23.9933 23.5906,29.6943 23.5906,15 26.4174,15z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="num_on">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V39 H39 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M36.0759,3.78709L3.7295,3.78709 3.7295,36.1334 36.0759,36.1334 36.0759,3.78709z M0.902679,0.960274L0.902679,38.9603 38.9027,38.9603 38.9027,0.960274 0.902679,0.960274z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F1 M39,39z M0,0z M22.0249,10.4238L22.0249,30 18.9268,30 18.9268,14.2162C18.366,14.6168 17.7606,14.9595 17.1108,15.2444 16.4698,15.5203 15.7354,15.7652 14.9074,15.9788L14.9074,13.3348C15.4238,13.1657 15.9223,12.9876 16.403,12.8007 16.8838,12.6137 17.3556,12.4045 17.8185,12.1731 18.2903,11.9416 18.7622,11.6834 19.234,11.3986 19.7147,11.1137 20.2088,10.7888 20.7162,10.4238L22.0249,10.4238z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="num_off">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V50 H50 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M50,50z M0,0z M41.0758,8.78709L8.72949,8.78709 8.72949,41.1334 41.0758,41.1334 41.0758,8.78709z M5.90267,5.96027L5.90267,43.9603 43.9027,43.9603 43.9027,5.96027 5.90267,5.96027z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M50,50z M0,0z M34.7238,17.8053L49.9926,2.55582 47.5044,0 32.2179,15.2672 34.7238,17.8053z M17.7701,34.7374L15.2642,32.1993 0,47.4442 2.48818,50 17.7701,34.7374z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F1 M50,50z M0,0z M27.2108,15.4238L27.2108,35 24.1127,35 24.1127,19.2162C23.5519,19.6168 22.9465,19.9595 22.2967,20.2444 21.6557,20.5203 20.9213,20.7652 20.0933,20.9788L20.0933,18.3348C20.6097,18.1657 21.1082,17.9876 21.5889,17.8007 22.0697,17.6137 22.5415,17.4045 23.0044,17.1731 23.4762,16.9416 23.9481,16.6834 24.4199,16.3986 24.9006,16.1137 25.3947,15.7888 25.9021,15.4238L27.2108,15.4238z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="insert_on">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V39 H39 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M36.0759,3.78709L3.7295,3.78709 3.7295,36.1334 36.0759,36.1334 36.0759,3.78709z M0.902679,0.960274L0.902679,38.9603 38.9027,38.9603 38.9027,0.960274 0.902679,0.960274z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M10.8941,11.9271L19.98,21.013 19.98,15 22.8068,15 22.8068,25.8387 12,25.8387 12,23.0119 17.9811,23.0119 8.89525,13.926 10.8941,11.9271z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M30.4134,9L30.4134,31 27.5866,31 27.5866,9 30.4134,9z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="insert_off">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V39 H39 V0 H0 Z">
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M36.0759,3.78709L3.7295,3.78709 3.7295,36.1334 36.0759,36.1334 36.0759,3.78709z M0.902679,0.960274L0.902679,38.9603 38.9027,38.9603 38.9027,0.960274 0.902679,0.960274z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M30.4134,9L30.4134,31 27.5866,31 27.5866,9 30.4134,9z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M17.5999,24.2804C16.7196,24.5887 15.7704,24.6364 14.8635,24.4172 14.858,24.4159 14.8525,24.4145 14.8471,24.4132 13.9151,24.1845 13.0699,23.6836 12.4153,22.9729 12.407,22.9639 12.3988,22.9549 12.3906,22.9459 11.7351,22.2235 11.3044,21.3207 11.1524,20.3507 11.1518,20.347 11.1513,20.3433 11.1507,20.3397 11.0003,19.3655 11.1376,18.3679 11.5453,17.473L9.42281,16.4753C9.41896,16.4837 9.41512,16.4922 9.4113,16.5007 9.01374,17.382 8.79337,18.33 8.75775,19.2897 8.74036,19.7581 8.76698,20.2292 8.83847,20.6968 8.83904,20.7005 8.8396,20.7041 8.84017,20.7078 9.06044,22.134 9.68866,23.4626 10.6463,24.5286 10.6544,24.5377 10.6626,24.5468 10.6708,24.5558 11.6384,25.6222 12.8945,26.3744 14.2813,26.7182 14.2868,26.7196 14.2923,26.7209 14.2977,26.7223 14.7432,26.8316 15.1957,26.8973 15.6491,26.9196 16.5662,26.9647 17.4872,26.8326 18.3622,26.5262 18.4077,26.5103 18.4531,26.4938 18.4984,26.477L17.6921,24.247C17.6847,24.2498 17.6772,24.2526 17.6697,24.2554 17.6465,24.2639 17.6232,24.2722 17.5999,24.2804z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M20.1535,26.026L15.1246,29.6371 13.4706,27.3355 15.8893,25.5987 13.8514,23.4153 15.9163,21.4864 20.1535,26.026z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M14.4001,15.7196C15.2804,15.4113 16.2295,15.3636 17.1365,15.5828 17.142,15.5841 17.1474,15.5855 17.1529,15.5868 18.0848,15.8155 18.9301,16.3164 19.5847,17.0271 19.5929,17.0361 19.6012,17.0451 19.6094,17.0541 20.2648,17.7765 20.6955,18.6793 20.8475,19.6493 20.8481,19.653 20.8487,19.6567 20.8493,19.6603 20.9997,20.6345 20.8624,21.6321 20.4546,22.527L22.5772,23.5247C22.581,23.5163 22.5848,23.5078 22.5887,23.4993 22.9862,22.618 23.2066,21.67 23.2422,20.7103 23.2596,20.2419 23.233,19.7708 23.1615,19.3032 23.1609,19.2995 23.1604,19.2959 23.1598,19.2922 22.9395,17.866 22.3113,16.5374 21.3537,15.4714 21.3455,15.4623 21.3373,15.4532 21.3291,15.4442 20.3615,14.3778 19.1054,13.6256 17.7186,13.2818 17.7132,13.2804 17.7077,13.2791 17.7022,13.2777 17.2568,13.1684 16.8043,13.1027 16.3509,13.0804 15.4338,13.0353 14.5127,13.1674 13.6377,13.4738 13.5922,13.4897 13.5468,13.5062 13.5016,13.523L14.3078,15.753C14.3153,15.7502 14.3228,15.7474 14.3303,15.7446 14.3535,15.7361 14.3768,15.7278 14.4001,15.7196z" />
<GeometryDrawing Brush="{DynamicResource SystemControlPageTextBaseHighBrush}" Geometry="F0 M39,39z M0,0z M11.8465,13.974L16.8753,10.3629 18.5294,12.6645 16.1107,14.4013 18.1486,16.5847 16.0836,18.5136 11.8465,13.974z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</ResourceDictionary>
11 changes: 7 additions & 4 deletions ModernFlyouts/Controls/LockKeysControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
xmlns:root="clr-namespace:ModernFlyouts"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:utils="clr-namespace:ModernFlyouts.Utilities"
mc:Ignorable="d"
Height="64" d:DesignWidth="354" DataContext="{x:Static root:FlyoutHandler.Instance}">
Height="48" DataContext="{x:Static root:FlyoutHandler.Instance}">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<ui:FontIcon x:Name="LockGlyph" Glyph="{x:Static utils:CommonGlyphs.Lock}" FontSize="24" />
<TextBlock x:Name="txt" HorizontalAlignment="Left" VerticalAlignment="Center"
<GridSplitter Width="10" Background="Transparent" />
<Image x:Name="LockIcon" Height="30" Width="30" Grid.Column="0" HorizontalAlignment="Center"/>
<GridSplitter Width="10" Background="Transparent" />
<TextBlock x:Name="txt" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"
Style="{DynamicResource BaseTextBlockStyle}" FontSize="18"
Margin="20" Text="Lock key is on" />
Text="Lock key is on" />
<GridSplitter x:Name="Pad" Width="10" Background="Transparent" />
</StackPanel>

</UserControl>
53 changes: 31 additions & 22 deletions ModernFlyouts/Controls/VolumeControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,39 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:utils="clr-namespace:ModernFlyouts.Utilities"
mc:Ignorable="d" d:DesignWidth="354">
mc:Ignorable="d">

<Grid Height="48">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
<ColumnDefinition Width="48" />
</Grid.ColumnDefinitions>
<Button x:Name="VolumeButton" Grid.Column="0" VerticalAlignment="Top" Margin="0,0,0,0"
ui:ControlHelper.CornerRadius="{DynamicResource FlyoutCornerRadius}"
Width="48" Padding="0" Height="48" Background="Transparent">
<Grid>
<ui:FontIcon x:Name="VolumeShadowGlyph" Glyph="{x:Static utils:CommonGlyphs.Volume3}" FontSize="16"
Foreground="{DynamicResource SystemControlForegroundChromeGrayBrush}" />
<ui:FontIcon x:Name="VolumeGlyph" Glyph="{x:Static utils:CommonGlyphs.Volume3}" FontSize="16" />
</Grid>
</Button>
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid x:Name="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

</Grid>
<Grid x:Name="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,4,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button x:Name="VolumeButton" HorizontalAlignment="Center" Margin="0,0,0,0" Grid.Row="0" Grid.Column="0"
ui:ControlHelper.CornerRadius="{DynamicResource FlyoutCornerRadius}"
Width="48" Padding="0" Height="48" Background="Transparent">
<Grid>
<ui:FontIcon x:Name="VolumeShadowGlyph" Glyph="{x:Static utils:CommonGlyphs.Volume3}" FontSize="16"
Foreground="{DynamicResource SystemControlForegroundChromeGrayBrush}" />
<ui:FontIcon x:Name="VolumeGlyph" Glyph="{x:Static utils:CommonGlyphs.Volume3}" FontSize="16" />
</Grid>
</Button>

<Slider x:Name="VolumeSlider" Maximum="100" Minimum="0" Grid.Column="1" VerticalAlignment="Center" Margin="8,0"
SmallChange="0.01" Value="100" IsMoveToPointEnabled="True" />
<Slider x:Name="VolumeSlider" Maximum="100" Minimum="0" VerticalAlignment="Stretch" Margin="8,0" Grid.Row="1" Grid.Column="1"
SmallChange="0.01" Value="100" IsMoveToPointEnabled="True" />

<TextBlock x:Name="textVal" Grid.Column="2" HorizontalAlignment="Center" Margin="6"
Style="{DynamicResource SubtitleTextBlockStyle}"
Text="100" VerticalAlignment="Center" />
<TextBlock x:Name="textVal" HorizontalAlignment="Center" Margin="6" Grid.Row="2" Grid.Column="2"
Style="{DynamicResource SubtitleTextBlockStyle}"
Text="100" VerticalAlignment="Center" />
</Grid>
</Grid>

</UserControl>
68 changes: 66 additions & 2 deletions ModernFlyouts/Controls/VolumeControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,76 @@
using System.Windows.Controls;
using ModernFlyouts.Core.UI;
using ModernFlyouts.UI;
using NAudio.Gui;
using System.Windows;
using System.Windows.Controls;

namespace ModernFlyouts.Controls
{
public partial class VolumeControl : UserControl
{
public VolumeControl()

public VolumeControl(Orientation orientation)
{
InitializeComponent();

if (orientation == Orientation.Vertical)
{
SetToHorizontal();
} else {
SetToVertical();
}
}

public void SetToHorizontal()
{
Horizontal.MinWidth = UIManager.FlyoutWidth;
Vertical.MinHeight = 0;

VolumeSlider.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
VolumeSlider.VerticalAlignment = System.Windows.VerticalAlignment.Center;
VolumeSlider.Orientation = Orientation.Horizontal;

Horizontal.Children.Clear();

Thickness pad = new Thickness();
pad.Right = 4;
textVal.Padding = pad;

Vertical.Children.Remove(VolumeButton);
Vertical.Children.Remove(VolumeSlider);
Vertical.Children.Remove(textVal);

Horizontal.Children.Add(VolumeButton);
Horizontal.Children.Add(VolumeSlider);
Horizontal.Children.Add(textVal);



}

public void SetToVertical()
{
Horizontal.MinWidth = 0;
Vertical.MinHeight = UIManager.DefaultSessionControlHeight;

VolumeSlider.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
VolumeSlider.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
VolumeSlider.Orientation = Orientation.Vertical;

Vertical.Children.Clear();

Thickness pad = new Thickness();
pad.Bottom = 4;
textVal.Padding = pad;

Horizontal.Children.Remove(VolumeButton);
Horizontal.Children.Remove(VolumeSlider);
Horizontal.Children.Remove(textVal);

Vertical.Children.Add(VolumeButton);
Vertical.Children.Add(VolumeSlider);
Vertical.Children.Add(textVal);

}
}
}
Loading