MainStatusBarView.axaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <UserControl
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
  7. xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  8. xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
  9. xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
  10. xmlns:config="clr-namespace:Ryujinx.Common.Configuration;assembly=Ryujinx.Common"
  11. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  12. x:Class="Ryujinx.Ava.UI.Views.Main.MainStatusBarView"
  13. x:DataType="viewModels:MainWindowViewModel">
  14. <Design.DataContext>
  15. <viewModels:MainWindowViewModel />
  16. </Design.DataContext>
  17. <Grid
  18. Name="StatusBar"
  19. Margin="0"
  20. MinHeight="22"
  21. HorizontalAlignment="Stretch"
  22. VerticalAlignment="Bottom"
  23. Background="{DynamicResource ThemeContentBackgroundColor}"
  24. DockPanel.Dock="Bottom"
  25. IsVisible="{Binding ShowMenuAndStatusBar}">
  26. <Grid.ColumnDefinitions>
  27. <ColumnDefinition Width="Auto" />
  28. <ColumnDefinition Width="Auto" />
  29. <ColumnDefinition Width="*" />
  30. <ColumnDefinition Width="Auto" />
  31. </Grid.ColumnDefinitions>
  32. <StackPanel
  33. Grid.Column="0"
  34. Margin="5"
  35. VerticalAlignment="Center"
  36. IsVisible="{Binding EnableNonGameRunningControls}">
  37. <Grid Margin="0">
  38. <Grid.ColumnDefinitions>
  39. <ColumnDefinition Width="Auto" />
  40. <ColumnDefinition Width="Auto" />
  41. <ColumnDefinition />
  42. </Grid.ColumnDefinitions>
  43. <Button
  44. Width="25"
  45. Height="25"
  46. MinWidth="0"
  47. Margin="0,0,5,0"
  48. VerticalAlignment="Center"
  49. Background="Transparent"
  50. Click="Refresh_OnClick">
  51. <ui:SymbolIcon
  52. Width="50"
  53. Height="100"
  54. Symbol="Refresh" />
  55. </Button>
  56. <TextBlock
  57. Name="LoadStatus"
  58. Grid.Column="1"
  59. Margin="0,0,5,0"
  60. VerticalAlignment="Center"
  61. IsVisible="{Binding EnableNonGameRunningControls}"
  62. Text="{locale:Locale StatusBarGamesLoaded}" />
  63. <ProgressBar
  64. Name="LoadProgressBar"
  65. Grid.Column="2"
  66. Height="6"
  67. VerticalAlignment="Center"
  68. Foreground="{DynamicResource SystemAccentColorLight2}"
  69. IsVisible="{Binding StatusBarVisible}"
  70. Maximum="{Binding StatusBarProgressMaximum}"
  71. Value="{Binding StatusBarProgressValue}" />
  72. </Grid>
  73. </StackPanel>
  74. <StackPanel
  75. Grid.Column="1"
  76. Margin="0,2"
  77. HorizontalAlignment="Left"
  78. VerticalAlignment="Center"
  79. IsVisible="{Binding IsGameRunning}"
  80. MaxHeight="18"
  81. Orientation="Horizontal">
  82. <TextBlock
  83. Name="VsyncStatus"
  84. Margin="5,0,5,0"
  85. HorizontalAlignment="Left"
  86. VerticalAlignment="Center"
  87. Foreground="{Binding VsyncColor}"
  88. IsVisible="{Binding !ShowLoadProgress}"
  89. PointerReleased="VsyncStatus_PointerReleased"
  90. Text="VSync"
  91. TextAlignment="Left" />
  92. <Border
  93. Width="2"
  94. Height="12"
  95. Margin="0"
  96. BorderBrush="Gray"
  97. Background="Gray"
  98. BorderThickness="1"
  99. IsVisible="{Binding !ShowLoadProgress}" />
  100. <TextBlock
  101. Name="DockedStatus"
  102. Margin="5,0,5,0"
  103. HorizontalAlignment="Left"
  104. VerticalAlignment="Center"
  105. IsVisible="{Binding !ShowLoadProgress}"
  106. PointerReleased="DockedStatus_PointerReleased"
  107. Text="{Binding DockedStatusText}"
  108. TextAlignment="Left" />
  109. <Border
  110. Width="2"
  111. Height="12"
  112. Margin="0"
  113. BorderBrush="Gray"
  114. Background="Gray"
  115. BorderThickness="1"
  116. IsVisible="{Binding !ShowLoadProgress}" />
  117. <SplitButton
  118. Name="AspectRatioStatus"
  119. Padding="5,0,5,0"
  120. HorizontalAlignment="Left"
  121. VerticalAlignment="Center"
  122. Background="Transparent"
  123. BorderThickness="0"
  124. CornerRadius="0"
  125. IsVisible="{Binding !ShowLoadProgress}"
  126. Content="{Binding AspectRatioStatusText}"
  127. Click="AspectRatioStatus_OnClick"
  128. ToolTip.Tip="{locale:Locale AspectRatioTooltip}">
  129. <SplitButton.Styles>
  130. <Style Selector="Border#SeparatorBorder">
  131. <Setter Property="Opacity" Value="0" />
  132. </Style>
  133. </SplitButton.Styles>
  134. <SplitButton.Flyout>
  135. <MenuFlyout Placement="Bottom" ShowMode="TransientWithDismissOnPointerMoveAway">
  136. <MenuItem
  137. Header="{locale:Locale SettingsTabGraphicsAspectRatio4x3}"
  138. Command="{Binding SetAspectRatio}"
  139. CommandParameter="{x:Static config:AspectRatio.Fixed4x3}"/>
  140. <MenuItem
  141. Header="{locale:Locale SettingsTabGraphicsAspectRatio16x9}"
  142. Command="{Binding SetAspectRatio}"
  143. CommandParameter="{x:Static config:AspectRatio.Fixed16x9}"/>
  144. <MenuItem
  145. Header="{locale:Locale SettingsTabGraphicsAspectRatio16x10}"
  146. Command="{Binding SetAspectRatio}"
  147. CommandParameter="{x:Static config:AspectRatio.Fixed16x10}"/>
  148. <MenuItem
  149. Header="{locale:Locale SettingsTabGraphicsAspectRatio21x9}"
  150. Command="{Binding SetAspectRatio}"
  151. CommandParameter="{x:Static config:AspectRatio.Fixed21x9}"/>
  152. <MenuItem
  153. Header="{locale:Locale SettingsTabGraphicsAspectRatio32x9}"
  154. Command="{Binding SetAspectRatio}"
  155. CommandParameter="{x:Static config:AspectRatio.Fixed32x9}"/>
  156. <MenuItem
  157. Header="{locale:Locale SettingsTabGraphicsAspectRatioStretch}"
  158. Command="{Binding SetAspectRatio}"
  159. CommandParameter="{x:Static config:AspectRatio.Stretched}"/>
  160. </MenuFlyout>
  161. </SplitButton.Flyout>
  162. </SplitButton>
  163. <Border
  164. Width="2"
  165. Height="12"
  166. Margin="0"
  167. BorderBrush="Gray"
  168. Background="Gray"
  169. BorderThickness="1"
  170. IsVisible="{Binding !ShowLoadProgress}" />
  171. <ToggleSplitButton
  172. Name="VolumeStatus"
  173. Padding="5,0,5,0"
  174. HorizontalAlignment="Left"
  175. VerticalAlignment="Center"
  176. VerticalContentAlignment="Center"
  177. Content="{Binding VolumeStatusText}"
  178. IsChecked="{Binding VolumeMuted}"
  179. IsVisible="{Binding !ShowLoadProgress}"
  180. PointerWheelChanged="VolumeStatus_OnPointerWheelChanged"
  181. Background="Transparent"
  182. BorderThickness="0"
  183. CornerRadius="0">
  184. <ToggleSplitButton.Styles>
  185. <Style Selector=":checked">
  186. <Style Selector="^:checked ContentPresenter">
  187. <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" />
  188. </Style>
  189. </Style>
  190. <Style Selector="Border#SeparatorBorder">
  191. <Setter Property="Opacity" Value="0" />
  192. </Style>
  193. </ToggleSplitButton.Styles>
  194. <ToggleSplitButton.Flyout>
  195. <Flyout Placement="Bottom" ShowMode="TransientWithDismissOnPointerMoveAway">
  196. <Grid Margin="0">
  197. <controls:SliderScroll
  198. MaxHeight="40"
  199. Width="150"
  200. Margin="0"
  201. Padding="0"
  202. IsSnapToTickEnabled="True"
  203. LargeChange="0.05"
  204. Maximum="1"
  205. Minimum="0"
  206. SmallChange="0.01"
  207. TickFrequency="0.05"
  208. ToolTip.Tip="{locale:Locale AudioVolumeTooltip}"
  209. Value="{Binding Volume}" />
  210. </Grid>
  211. </Flyout>
  212. </ToggleSplitButton.Flyout>
  213. </ToggleSplitButton>
  214. <Border
  215. Width="2"
  216. Height="12"
  217. Margin="0"
  218. BorderBrush="Gray"
  219. Background="Gray"
  220. BorderThickness="1"
  221. IsVisible="{Binding !ShowLoadProgress}" />
  222. <TextBlock
  223. Margin="5,0,5,0"
  224. HorizontalAlignment="Left"
  225. VerticalAlignment="Center"
  226. IsVisible="{Binding !ShowLoadProgress}"
  227. Text="{Binding GameStatusText}"
  228. TextAlignment="Left" />
  229. <Border
  230. Width="2"
  231. Height="12"
  232. Margin="0"
  233. BorderBrush="Gray"
  234. Background="Gray"
  235. BorderThickness="1"
  236. IsVisible="{Binding !ShowLoadProgress}" />
  237. <TextBlock
  238. Margin="5,0,5,0"
  239. HorizontalAlignment="Left"
  240. VerticalAlignment="Center"
  241. IsVisible="{Binding !ShowLoadProgress}"
  242. Text="{Binding FifoStatusText}"
  243. TextAlignment="Left" />
  244. <Border
  245. Width="2"
  246. Height="12"
  247. Margin="0"
  248. BorderBrush="Gray"
  249. Background="Gray"
  250. BorderThickness="1"
  251. IsVisible="{Binding !ShowLoadProgress}" />
  252. <TextBlock
  253. Margin="5,0,5,0"
  254. HorizontalAlignment="Left"
  255. VerticalAlignment="Center"
  256. IsVisible="{Binding !ShowLoadProgress}"
  257. Text="{Binding BackendText}"
  258. TextAlignment="Left" />
  259. <Border
  260. Width="2"
  261. Height="12"
  262. Margin="0"
  263. BorderBrush="Gray"
  264. Background="Gray"
  265. BorderThickness="1"
  266. IsVisible="{Binding !ShowLoadProgress}" />
  267. <TextBlock
  268. Margin="5,0,5,0"
  269. HorizontalAlignment="Left"
  270. VerticalAlignment="Center"
  271. IsVisible="{Binding !ShowLoadProgress}"
  272. Text="{Binding GpuNameText}"
  273. TextAlignment="Left" />
  274. </StackPanel>
  275. <StackPanel
  276. Grid.Column="3"
  277. Margin="0,0,5,0"
  278. VerticalAlignment="Center"
  279. IsVisible="{Binding ShowFirmwareStatus}"
  280. Orientation="Horizontal">
  281. <TextBlock
  282. Name="FirmwareStatus"
  283. Margin="0"
  284. HorizontalAlignment="Right"
  285. VerticalAlignment="Center"
  286. Text="{locale:Locale StatusBarSystemVersion}" />
  287. </StackPanel>
  288. </Grid>
  289. </UserControl>