summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2019-08-29 21:58:42 +0100
committersr55 <[email protected]>2019-08-29 21:58:56 +0100
commit3293f1984f227a61dfe0f0d130bad8d09b19025d (patch)
treeabf953b910b2d65719ca971679934cc0125fb097
parentaa4c030d83dbc42722facefc00165f063648d1a9 (diff)
WinGui: Various small UI/UX fixes Fixes #2280 #2278
-rw-r--r--win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml12
-rw-r--r--win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs32
-rw-r--r--win/CS/HandBrakeWPF/Themes/Dark.xaml3
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml4
4 files changed, 28 insertions, 23 deletions
diff --git a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml
index 3fdc8d22f..4c35bf237 100644
--- a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml
+++ b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml
@@ -143,29 +143,31 @@
TextChanged="NumberBoxTextChanged"
VerticalContentAlignment="Center"/>
<Grid
- Name="incrementButtonsGrid"
+ Name="upButton"
Grid.Column="1"
Width="16">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
- <Button
+ <Button x:Name="incrementButtonsGrid"
Style="{StaticResource UpButton}"
Grid.Row="0"
FontSize="4"
PreviewMouseLeftButtonDown="UpButtonMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp">
+ PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp"
+ PreviewKeyDown="UpButton_OnKeyDown">
<Polygon
Style="{StaticResource Arrow}"
Points="4,0 0,4 8,4" />
</Button>
- <Button
+ <Button x:Name="deIncrementButtonsGrid"
Style="{StaticResource DownButton}"
Grid.Row="1"
FontSize="4"
PreviewMouseLeftButtonDown="DownButtonMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp">
+ PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp"
+ PreviewKeyDown="DownButton_OnKeyDown">
<Polygon
Style="{StaticResource Arrow}"
Points="0,0 8,0 4,4" />
diff --git a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs
index a8277ec3b..9f9c16de1 100644
--- a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs
+++ b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs
@@ -575,8 +575,6 @@ namespace HandBrakeWPF.Controls
this.UpdateNumberBindingFromBox();
}
-
- this.RefreshNumberBoxColor();
}
/// <summary>
@@ -601,8 +599,6 @@ namespace HandBrakeWPF.Controls
if (this.AllowEmpty && this.Number == 0)
{
this.numberBox.Text = this.hasFocus ? string.Empty : this.NoneCaption;
-
- // this.numberBox.Foreground = new SolidColorBrush(Colors.Gray);
}
else
{
@@ -614,19 +610,7 @@ namespace HandBrakeWPF.Controls
{
this.numberBox.Text = this.Number.ToString(CultureInfo.InvariantCulture);
}
-
- // this.numberBox.Foreground = new SolidColorBrush(Colors.Black);
}
-
- this.RefreshNumberBoxColor();
- }
-
- /// <summary>
- /// The refresh number box color.
- /// </summary>
- private void RefreshNumberBoxColor()
- {
- this.numberBox.Foreground = this.numberBox.Text == this.NoneCaption ? new SolidColorBrush(Colors.Gray) : new SolidColorBrush(Colors.Black);
}
/// <summary>
@@ -717,5 +701,21 @@ namespace HandBrakeWPF.Controls
}
#endregion
+
+ private void UpButton_OnKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Space)
+ {
+ this.IncrementNumber();
+ }
+ }
+
+ private void DownButton_OnKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Space)
+ {
+ this.DecrementNumber();
+ }
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Themes/Dark.xaml b/win/CS/HandBrakeWPF/Themes/Dark.xaml
index 9eff8ad14..84faf28bb 100644
--- a/win/CS/HandBrakeWPF/Themes/Dark.xaml
+++ b/win/CS/HandBrakeWPF/Themes/Dark.xaml
@@ -94,6 +94,9 @@
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
</Style>
+ <!-- Glyph -->
+ <SolidColorBrush x:Key="GlyphBrush" Color="WhiteSmoke"/>
+
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Controls/ComboBoxDark.xaml" />
<ResourceDictionary Source="Controls/ButtonDark.xaml" />
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
index d0e3e7fb2..d2f153870 100644
--- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
@@ -199,7 +199,7 @@
<StackPanel Orientation="Horizontal" Grid.Column="6" Margin="5,0,0,0">
<TextBlock Text="Name: " FontWeight="Bold" Margin="0,0,5,0" VerticalAlignment="Center" />
- <TextBox x:Name="TrackName" Text="{Binding Name}" Grid.Column="10" Width="120" />
+ <TextBox x:Name="TrackName" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Grid.Column="10" Width="120" />
</StackPanel>
</Grid>
@@ -268,7 +268,7 @@
<StackPanel Orientation="Horizontal" Grid.Column="10" Margin="5,0,0,0">
<TextBlock Text="Name: " FontWeight="Bold" Margin="0,0,5,0" />
- <TextBox x:Name="TrackNameSrt" Text="{Binding Name}" Grid.Column="10" Width="120" />
+ <TextBox x:Name="TrackNameSrt" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Grid.Column="10" Width="120" />
</StackPanel>
</Grid>