Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

Commit

Permalink
UX improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
iXab3r committed Feb 8, 2020
1 parent 5839874 commit 22ad498
Showing 1 changed file with 108 additions and 113 deletions.
221 changes: 108 additions & 113 deletions Sources/MicSwitch/MainWindow/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
<mah:MetroWindow x:Class="MicSwitch.MainWindow.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:hotkeys="clr-namespace:PoeShared.UI.Hotkeys;assembly=PoeShared.Wpf"
xmlns:blue="http://www.nuget.org/Blue.MVVM"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:eye="http://coderush.net/poeeye/"
xmlns:viewModels="clr-namespace:MicSwitch.MainWindow.ViewModels"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModels:MainWindowViewModel}"
WindowState="{Binding WindowState}"
WindowStartupLocation="CenterScreen"
ResizeMode="CanMinimize"
WindowStyle="SingleBorderWindow"
ShowInTaskbar="{Binding ShowInTaskbar, Mode=TwoWay}"
Loaded="OnLoaded"
Unloaded="OnUnloaded"
Title="{Binding Title}" Width="400" SizeToContent="Height">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:hotkeys="clr-namespace:PoeShared.UI.Hotkeys;assembly=PoeShared.Wpf"
xmlns:blue="http://www.nuget.org/Blue.MVVM"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:eye="http://coderush.net/poeeye/"
xmlns:viewModels="clr-namespace:MicSwitch.MainWindow.ViewModels"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModels:MainWindowViewModel}"
WindowState="{Binding WindowState}"
WindowStartupLocation="CenterScreen"
ResizeMode="CanMinimize"
WindowStyle="SingleBorderWindow"
ShowInTaskbar="{Binding ShowInTaskbar, Mode=TwoWay}"
Loaded="OnLoaded"
Unloaded="OnUnloaded"
Title="{Binding Title}" Width="400" SizeToContent="Height">

<Window.Resources>
<Style TargetType="{x:Type DockPanel}" x:Key="SettingsRowDockPanelStyle">
<Setter Property="DockPanel.Dock" Value="Top" />
<Setter Property="MinHeight" Value="24" />
</Style>
</Window.Resources>

<Grid>
<DockPanel>
Expand All @@ -38,125 +45,113 @@
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>

<DockPanel DockPanel.Dock="Top" LastChildFill="True">
<ComboBox DockPanel.Dock="Top" MinHeight="30" Margin="5,5,5,0"
materialDesign:HintAssist.Hint="Microphone line"
Style="{StaticResource MaterialDesignFloatingHintComboBox}"

<DockPanel Margin="0,5,0,0" Style="{StaticResource SettingsRowDockPanelStyle}">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Microphone:" />
<ComboBox DockPanel.Dock="Top" Margin="5,0,5,0"
ItemsSource="{Binding Microphones}"
SelectedItem="{Binding MicrophoneLine}"
DisplayMemberPath="Name" />

<DockPanel DockPanel.Dock="Top" Margin="0,5,0,0" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Volume: " />
</DockPanel>

<TextBlock DockPanel.Dock="Right"
MinWidth="50"
TextAlignment="Left"
Margin="5,0">
<TextBlock.Text>
<Binding Path="MicrophoneVolume" StringFormat="{}{0:F1}%">
<Binding.Converter>
<blue:MultiplyDoubleConverter MinValue="0"
Factor="100"
MaxValue="100" />
</Binding.Converter>
</Binding>
</TextBlock.Text>
</TextBlock>
<DockPanel Margin="0,5,0,0" Style="{StaticResource SettingsRowDockPanelStyle}">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Volume:" />

<Slider DockPanel.Dock="Left"
Value="{Binding MicrophoneVolume}"
Minimum="0" Maximum="1"
Margin="5,0"
TickFrequency="0.1" />
</DockPanel>
<TextBlock DockPanel.Dock="Right"
MinWidth="50"
TextAlignment="Left"
Margin="5,0">
<TextBlock.Text>
<Binding Path="MicrophoneVolume" StringFormat="{}{0:F1}%">
<Binding.Converter>
<blue:MultiplyDoubleConverter MinValue="0"
Factor="100"
MaxValue="100" />
</Binding.Converter>
</Binding>
</TextBlock.Text>
</TextBlock>

<DockPanel DockPanel.Dock="Top" Margin="0,5,0,0" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Mute: " />
<ToggleButton
DockPanel.Dock="Left" HorizontalAlignment="Left"
IsChecked="{Binding MicrophoneMuted}" />
</DockPanel>
<Slider DockPanel.Dock="Left"
Value="{Binding MicrophoneVolume}"
Minimum="0" Maximum="1"
Margin="5,4,5,0"
TickFrequency="0.1" />
</DockPanel>

<DockPanel DockPanel.Dock="Top" Margin="0,5,0,0" LastChildFill="False">
<TextBlock DockPanel.Dock="Left" MinWidth="100" TextAlignment="Right" Text="Notification: " />
<TextBlock DockPanel.Dock="Left" Margin="5,0,0,0" Text="when muted" />
<ContentPresenter DockPanel.Dock="Left" Margin="5,0,0,0" Width="22" Height="22" Content="{Binding AudioSelectorWhenMuted}" />
<TextBlock DockPanel.Dock="Left" Margin="5,0,0,0" Text="when un-muted " />
<ContentPresenter Margin="5,0,0,0" DockPanel.Dock="Left" Width="22" Height="22" Content="{Binding AudioSelectorWhenUnmuted}" />
</DockPanel>
<DockPanel Margin="0,5,0,0" Style="{StaticResource SettingsRowDockPanelStyle}">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Mute:" />
<ToggleButton
DockPanel.Dock="Left" HorizontalAlignment="Left"
IsChecked="{Binding MicrophoneMuted}" />
</DockPanel>

<GroupBox DockPanel.Dock="Top"
Margin="3,5,3,5"
Header="Hotkey settings"
Style="{DynamicResource MaterialDesignGroupBox}"
Padding="6"
materialDesign:ColorZoneAssist.Mode="Accent"
materialDesign:ShadowAssist.ShadowDepth="Depth1"
BorderThickness="1">
<DockPanel Margin="-12,0,-12,0">
<DockPanel DockPanel.Dock="Top" Margin="0,5,0,0" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Push-to-talk:" />
<ToggleButton
DockPanel.Dock="Left" Margin="5,0,0,0" HorizontalAlignment="Left"
IsChecked="{Binding IsPushToTalkMode}" />
</DockPanel>
<DockPanel Margin="0,5,0,0" Style="{StaticResource SettingsRowDockPanelStyle}" LastChildFill="False">
<TextBlock DockPanel.Dock="Left" MinWidth="100" TextAlignment="Right" Text="Notification:" />
<TextBlock DockPanel.Dock="Left" Margin="5,0,0,0" Text="when muted" />
<ContentPresenter DockPanel.Dock="Left" Margin="5,0,0,0" Width="22" Height="22" Content="{Binding AudioSelectorWhenMuted}" />
<TextBlock DockPanel.Dock="Left" Margin="5,0,0,0" Text="when un-muted " />
<ContentPresenter Margin="5,0,0,0" DockPanel.Dock="Left" Width="22" Height="22" Content="{Binding AudioSelectorWhenUnmuted}" />
</DockPanel>

<DockPanel DockPanel.Dock="Top" Margin="0,5,0,0" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Hotkey:" />
<Grid Margin="5,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<hotkeys:HotKeyBox Grid.Column="0" HotKey="{Binding Hotkey}" AcceptsMouseKeys="True" />
<TextBlock Grid.Column="1" Margin="10,0" DockPanel.Dock="Left" Text="or" FontWeight="Bold" />
<hotkeys:HotKeyBox Grid.Column="2" HotKey="{Binding HotkeyAlt}" AcceptsMouseKeys="True" />
</Grid>
</DockPanel>
</DockPanel>
</GroupBox>

<DockPanel DockPanel.Dock="Top" Margin="0,5,0,0" LastChildFill="True">
<DockPanel Margin="0,5,0,0" Style="{StaticResource SettingsRowDockPanelStyle}" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Run at login: " />
Text="Push-to-talk:" />
<ToggleButton
DockPanel.Dock="Left" Margin="5,0,0,0" HorizontalAlignment="Left"
IsChecked="{Binding IsPushToTalkMode}" />
</DockPanel>

<DockPanel Margin="0,5,0,0" Style="{StaticResource SettingsRowDockPanelStyle}" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Hotkey:" />
<Grid Margin="5,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<hotkeys:HotKeyBox Grid.Column="0" HotKey="{Binding Hotkey}" AcceptsMouseKeys="True" />
<TextBlock Grid.Column="1" Margin="10,0" DockPanel.Dock="Left" Text="or" FontWeight="Bold" />
<hotkeys:HotKeyBox Grid.Column="2" HotKey="{Binding HotkeyAlt}" AcceptsMouseKeys="True" />
</Grid>
</DockPanel>

<DockPanel Margin="0,5,0,0" Style="{StaticResource SettingsRowDockPanelStyle}" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" MinWidth="100"
TextAlignment="Right"
Text="Run at start:" />
<ToggleButton
DockPanel.Dock="Left" Margin="5,0,0,0" HorizontalAlignment="Left"
IsChecked="{Binding RunAtLogin, Mode=OneWay}"
Command="{Binding RunAtLoginToggleCommand}"
CommandParameter="{Binding IsChecked, RelativeSource={RelativeSource Self}}"/>
CommandParameter="{Binding IsChecked, RelativeSource={RelativeSource Self}}" />
</DockPanel>

<DockPanel Dock="Top" Margin="3,5,3,5">
<ContentControl Content="{Binding ResetOverlayPositionCommand}"
eye:CommandWrapperHelper.Icon="&#xf0e2;"
eye:CommandWrapperHelper.Text="Reset"/>
<DockPanel Margin="5,5" Style="{StaticResource SettingsRowDockPanelStyle}">
<ContentControl Content="{Binding ResetOverlayPositionCommand}"
MinWidth="100"
eye:CommandWrapperHelper.Icon="&#xf0e2;"
eye:CommandWrapperHelper.Text="Reset" />
<Grid DockPanel.Dock="Right" Margin="5,0,0,0">
<ContentControl Content="{Binding ToggleOverlayLockCommand}"
eye:CommandWrapperHelper.Icon="&#xf09c;"
Visibility="{Binding Overlay.IsLocked, Converter={StaticResource TrueToVisibleFalseToCollapsedConverter}}"
eye:CommandWrapperHelper.Text="Unlock overlay"/>
eye:CommandWrapperHelper.Text="Unlock overlay" />
<ContentControl Content="{Binding ToggleOverlayLockCommand}"
eye:CommandWrapperHelper.Icon="&#xf023;"
Visibility="{Binding Overlay.IsLocked, Converter={StaticResource TrueToCollapsedFalseToVisibleConverter}}"
eye:CommandWrapperHelper.Text="Lock overlay"/>
eye:CommandWrapperHelper.Text="Lock overlay" />
</Grid>
</DockPanel>


<Label Padding="0" />
</DockPanel>

<materialDesign:DrawerHost IsBottomDrawerOpen="{Binding ApplicationUpdater.IsOpen}" BottomDrawerBackground="{StaticResource MaterialDesignBody}">
Expand Down

0 comments on commit 22ad498

Please sign in to comment.