]> granicus.if.org Git - handbrake/commitdiff
WinGui: Various small UI/UX fixes Fixes #2280 #2278
authorsr55 <sr55.hb@outlook.com>
Thu, 29 Aug 2019 20:58:42 +0000 (21:58 +0100)
committersr55 <sr55.hb@outlook.com>
Thu, 29 Aug 2019 20:58:56 +0000 (21:58 +0100)
win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml
win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs
win/CS/HandBrakeWPF/Themes/Dark.xaml
win/CS/HandBrakeWPF/Views/SubtitlesView.xaml

index 3fdc8d22f9f9a3abc362319d96843c58651ead61..4c35bf2374d2f3b7a8ae2b33f6741a6ee2e46b83 100644 (file)
                        TextChanged="NumberBoxTextChanged"\r
                        VerticalContentAlignment="Center"/>\r
         <Grid\r
-                       Name="incrementButtonsGrid"\r
+                       Name="upButton"\r
                        Grid.Column="1"\r
                        Width="16">\r
             <Grid.RowDefinitions>\r
                 <RowDefinition Height="*" />\r
                 <RowDefinition Height="*" />\r
             </Grid.RowDefinitions>\r
-            <Button\r
+            <Button x:Name="incrementButtonsGrid"\r
                                Style="{StaticResource UpButton}"\r
                                Grid.Row="0"\r
                                FontSize="4"\r
                                PreviewMouseLeftButtonDown="UpButtonMouseLeftButtonDown"\r
-                               PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp">\r
+                               PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp"\r
+                PreviewKeyDown="UpButton_OnKeyDown">\r
                 <Polygon\r
                                        Style="{StaticResource Arrow}"\r
                                        Points="4,0 0,4 8,4" />\r
             </Button>\r
-            <Button\r
+            <Button x:Name="deIncrementButtonsGrid"\r
                                Style="{StaticResource DownButton}"\r
                                Grid.Row="1"\r
                                FontSize="4"\r
                                PreviewMouseLeftButtonDown="DownButtonMouseLeftButtonDown"\r
-                               PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp">\r
+                               PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp"\r
+                PreviewKeyDown="DownButton_OnKeyDown">\r
                 <Polygon\r
                                        Style="{StaticResource Arrow}"\r
                                        Points="0,0 8,0 4,4" />\r
index a8277ec3b9f4310aa7d4c8bfce7b88b1adc94dd1..9f9c16de197d7fbb488e92eedee19760670368fb 100644 (file)
@@ -575,8 +575,6 @@ namespace HandBrakeWPF.Controls
 \r
                 this.UpdateNumberBindingFromBox();\r
             }\r
-\r
-            this.RefreshNumberBoxColor();\r
         }\r
 \r
         /// <summary>\r
@@ -601,8 +599,6 @@ namespace HandBrakeWPF.Controls
             if (this.AllowEmpty && this.Number == 0)\r
             {\r
                 this.numberBox.Text = this.hasFocus ? string.Empty : this.NoneCaption;\r
-\r
-                // this.numberBox.Foreground = new SolidColorBrush(Colors.Gray);\r
             }\r
             else\r
             {\r
@@ -614,19 +610,7 @@ namespace HandBrakeWPF.Controls
                 {\r
                     this.numberBox.Text = this.Number.ToString(CultureInfo.InvariantCulture);\r
                 }\r
-\r
-                // this.numberBox.Foreground = new SolidColorBrush(Colors.Black);\r
             }\r
-\r
-            this.RefreshNumberBoxColor();\r
-        }\r
-\r
-        /// <summary>\r
-        /// The refresh number box color.\r
-        /// </summary>\r
-        private void RefreshNumberBoxColor()\r
-        {\r
-            this.numberBox.Foreground = this.numberBox.Text == this.NoneCaption ? new SolidColorBrush(Colors.Gray) : new SolidColorBrush(Colors.Black);\r
         }\r
 \r
         /// <summary>\r
@@ -717,5 +701,21 @@ namespace HandBrakeWPF.Controls
         }\r
 \r
         #endregion\r
+\r
+        private void UpButton_OnKeyDown(object sender, KeyEventArgs e)\r
+        {\r
+            if (e.Key == Key.Space)\r
+            {\r
+                this.IncrementNumber();\r
+            }\r
+        }\r
+\r
+        private void DownButton_OnKeyDown(object sender, KeyEventArgs e)\r
+        {\r
+            if (e.Key == Key.Space)\r
+            {\r
+                this.DecrementNumber();\r
+            }\r
+        }\r
     }\r
 }
\ No newline at end of file
index 9eff8ad14c6a7d063f6fd2ff090b5eb0ce54c86d..84faf28bb60cc18b4a7795e1738b1ab3a4a674b0 100644 (file)
@@ -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" />
index d0e3e7fb2246afa705d8c65fe1c5db8a7729ee74..d2f153870746341aaec9c0d021e58cef1796276f 100644 (file)
 \r
                             <StackPanel Orientation="Horizontal" Grid.Column="6" Margin="5,0,0,0">\r
                                 <TextBlock Text="Name: " FontWeight="Bold" Margin="0,0,5,0" VerticalAlignment="Center" />\r
-                                <TextBox x:Name="TrackName" Text="{Binding Name}" Grid.Column="10" Width="120" />\r
+                                <TextBox x:Name="TrackName" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Grid.Column="10" Width="120" />\r
                             </StackPanel>\r
                         </Grid>\r
 \r
 \r
                             <StackPanel Orientation="Horizontal" Grid.Column="10" Margin="5,0,0,0">\r
                                 <TextBlock Text="Name: " FontWeight="Bold" Margin="0,0,5,0" />\r
-                                <TextBox x:Name="TrackNameSrt" Text="{Binding Name}" Grid.Column="10" Width="120" />\r
+                                <TextBox x:Name="TrackNameSrt" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Grid.Column="10" Width="120" />\r
                             </StackPanel>\r
 \r
                         </Grid>\r