]> granicus.if.org Git - handbrake/commitdiff
WinGui: Add basic source information to the main window. #833
authorsr55 <sr55.hb@outlook.com>
Wed, 23 Aug 2017 19:04:58 +0000 (20:04 +0100)
committersr55 <sr55.hb@outlook.com>
Wed, 23 Aug 2017 19:04:58 +0000 (20:04 +0100)
win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml

index cba715c3f72ac69ae19fcfdb9a619b24192af2ad..4a7d521357ec975fd185cd35668e47a46a547376 100644 (file)
@@ -681,6 +681,15 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Audio Tracks.\r
+        /// </summary>\r
+        public static string MainView_AudioTrackCount {\r
+            get {\r
+                return ResourceManager.GetString("MainView_AudioTrackCount", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Browse.\r
         /// </summary>\r
@@ -951,6 +960,15 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Subtitle Tracks.\r
+        /// </summary>\r
+        public static string MainView_SubtitleTracksCount {\r
+            get {\r
+                return ResourceManager.GetString("MainView_SubtitleTracksCount", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Summary.\r
         /// </summary>\r
index c387d0653acbba343d24dbcfcd4a023a63c0c36f..5e24741dd7899dbab7eed4a7b57d106045402259 100644 (file)
@@ -956,4 +956,10 @@ This will not affect your current settings in the Subtitle tab.</value>
   <data name="SummaryView_storage" xml:space="preserve">\r
     <value>storage</value>\r
   </data>\r
+  <data name="MainView_AudioTrackCount" xml:space="preserve">\r
+    <value>Audio Tracks</value>\r
+  </data>\r
+  <data name="MainView_SubtitleTracksCount" xml:space="preserve">\r
+    <value>Subtitle Tracks</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index 0242fcbfbb543912502fa2183fe6151915cd5195..32241d53ad7f307256018bf0dd6cdaf4d20881cf 100644 (file)
@@ -729,6 +729,7 @@ namespace HandBrakeWPF.ViewModels
                     this.NotifyOfPropertyChange(() => this.StartEndRangeItems);\r
                     this.NotifyOfPropertyChange(() => this.SelectedTitle);\r
                     this.NotifyOfPropertyChange(() => this.Angles);\r
+                    this.NotifyOfPropertyChange(() => this.SourceInfo);\r
 \r
                     // Default the Start and End Point dropdowns\r
                     this.SelectedStartPoint = 1;\r
@@ -1151,6 +1152,32 @@ namespace HandBrakeWPF.ViewModels
 \r
         public bool IsUWP { get; } = UwpDetect.IsUWP();\r
 \r
+        public string SourceInfo\r
+        {\r
+            get\r
+            {\r
+                if (this.SelectedTitle != null)\r
+                {\r
+                    int parW = this.SelectedTitle.ParVal.Width;\r
+                    int parH = this.SelectedTitle.ParVal.Height;\r
+                    int displayW = this.SelectedTitle.Resolution.Width * parW / parH;\r
+\r
+                    return string.Format("{0}x{1} ({2}x{3}), {4} FPS, {5} {6}, {7} {8}", \r
+                        this.SelectedTitle.Resolution.Width, \r
+                        this.SelectedTitle.Resolution.Height,\r
+                        displayW,\r
+                        this.SelectedTitle.Resolution.Height, \r
+                        this.SelectedTitle.Fps, \r
+                        this.SelectedTitle.AudioTracks.Count, \r
+                        ResourcesUI.MainView_AudioTrackCount,\r
+                        this.SelectedTitle.Subtitles.Count,\r
+                        ResourcesUI.MainView_SubtitleTracksCount);\r
+                }\r
+\r
+                return string.Empty;\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         #region Commands \r
index de9068ea9901748419250f8eba6d74acf151b546..cadd5a5ee0d740c5230ea6fe7a5c21076d272b24 100644 (file)
                             HorizontalAlignment="Stretch"\r
                             VerticalAlignment="Stretch"\r
                             >\r
-                    <StackPanel Orientation="Horizontal">\r
-                        <Label Content="{x:Static Properties:ResourcesUI.MainView_Source}" FontWeight="Bold" />\r
-                        <Label Content="{Binding Path=SourceLabel}" />\r
-                    </StackPanel>\r
+                    <Grid HorizontalAlignment="Stretch" Margin="0,0,10,0">\r
+                        <Grid.ColumnDefinitions>\r
+                            <ColumnDefinition Width="Auto" />\r
+                            <ColumnDefinition Width="Auto" />\r
+                            <ColumnDefinition Width="*" />\r
+                        </Grid.ColumnDefinitions>\r
+                      \r
+                        <Label Content="{x:Static Properties:ResourcesUI.MainView_Source}" FontWeight="Bold" Grid.Column="0" />\r
+                        <TextBlock Text="{Binding Path=SourceLabel}" TextTrimming="CharacterEllipsis" Grid.Column="1" MaxWidth="400" />\r
+                        <TextBlock Text="{Binding SourceInfo}" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="Gray" FontFamily="Segoe UI Light" Grid.Column="2" MaxWidth="400" />\r
+                    </Grid>\r
+                    \r
                     <StackPanel Orientation="Horizontal">\r
                         <Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_Title}" />\r
                         <ComboBox Name="Titles"\r