MainViewControls.axaml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
  7. xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
  8. xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  9. xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
  10. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  11. x:Class="Ryujinx.Ava.UI.Views.Main.MainViewControls"
  12. x:CompileBindings="True"
  13. x:DataType="viewModels:MainWindowViewModel">
  14. <Design.DataContext>
  15. <viewModels:MainWindowViewModel />
  16. </Design.DataContext>
  17. <DockPanel
  18. Margin="0,0,0,5"
  19. HorizontalAlignment="Stretch">
  20. <Button
  21. Width="40"
  22. MinWidth="40"
  23. Margin="5,2,0,2"
  24. VerticalAlignment="Stretch"
  25. Command="{ReflectionBinding SetListMode}"
  26. IsEnabled="{Binding IsGrid}">
  27. <ui:FontIcon
  28. Margin="0"
  29. HorizontalAlignment="Stretch"
  30. VerticalAlignment="Center"
  31. FontFamily="avares://FluentAvalonia/Fonts#Symbols"
  32. Glyph="{helpers:GlyphValueConverter List}" />
  33. </Button>
  34. <Button
  35. Width="40"
  36. MinWidth="40"
  37. Margin="5,2,5,2"
  38. VerticalAlignment="Stretch"
  39. Command="{ReflectionBinding SetGridMode}"
  40. IsEnabled="{Binding IsList}">
  41. <ui:FontIcon
  42. Margin="0"
  43. HorizontalAlignment="Stretch"
  44. VerticalAlignment="Center"
  45. FontFamily="avares://FluentAvalonia/Fonts#Symbols"
  46. Glyph="{helpers:GlyphValueConverter Grid}" />
  47. </Button>
  48. <TextBlock
  49. Margin="10,0"
  50. VerticalAlignment="Center"
  51. Text="{locale:Locale IconSize}"
  52. ToolTip.Tip="{locale:Locale IconSizeTooltip}" />
  53. <Slider
  54. Width="150"
  55. Height="35"
  56. Margin="5,-10,5,0"
  57. VerticalAlignment="Center"
  58. IsSnapToTickEnabled="True"
  59. Maximum="4"
  60. Minimum="1"
  61. TickFrequency="1"
  62. ToolTip.Tip="{locale:Locale IconSizeTooltip}"
  63. Value="{Binding GridSizeScale}" />
  64. <CheckBox
  65. Margin="0"
  66. VerticalAlignment="Center"
  67. IsChecked="{Binding ShowNames, Mode=TwoWay}"
  68. IsVisible="{Binding IsGrid}">
  69. <TextBlock Margin="5,3,0,0" Text="{locale:Locale CommonShowNames}" />
  70. </CheckBox>
  71. <TextBox
  72. Name="SearchBox"
  73. MinWidth="200"
  74. Margin="5,0,5,0"
  75. HorizontalAlignment="Right"
  76. VerticalAlignment="Center"
  77. VerticalContentAlignment="Center"
  78. DockPanel.Dock="Right"
  79. KeyUp="SearchBox_OnKeyUp"
  80. Text="{Binding SearchText}"
  81. Watermark="{locale:Locale MenuSearch}" />
  82. <ui:DropDownButton
  83. Width="150"
  84. HorizontalAlignment="Right"
  85. VerticalAlignment="Center"
  86. Content="{Binding SortName}"
  87. DockPanel.Dock="Right">
  88. <ui:DropDownButton.Flyout>
  89. <Flyout Placement="Bottom">
  90. <StackPanel
  91. Margin="0"
  92. HorizontalAlignment="Stretch"
  93. Orientation="Vertical">
  94. <StackPanel>
  95. <RadioButton
  96. Checked="Sort_Checked"
  97. Content="{locale:Locale CommonFavorite}"
  98. GroupName="Sort"
  99. IsChecked="{Binding IsSortedByFavorite, Mode=OneTime}"
  100. Tag="Favorite" />
  101. <RadioButton
  102. Checked="Sort_Checked"
  103. Content="{locale:Locale GameListHeaderApplication}"
  104. GroupName="Sort"
  105. IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
  106. Tag="Title" />
  107. <RadioButton
  108. Checked="Sort_Checked"
  109. Content="{locale:Locale GameListHeaderDeveloper}"
  110. GroupName="Sort"
  111. IsChecked="{Binding IsSortedByDeveloper, Mode=OneTime}"
  112. Tag="Developer" />
  113. <RadioButton
  114. Checked="Sort_Checked"
  115. Content="{locale:Locale GameListHeaderTimePlayed}"
  116. GroupName="Sort"
  117. IsChecked="{Binding IsSortedByTimePlayed, Mode=OneTime}"
  118. Tag="TotalTimePlayed" />
  119. <RadioButton
  120. Checked="Sort_Checked"
  121. Content="{locale:Locale GameListHeaderLastPlayed}"
  122. GroupName="Sort"
  123. IsChecked="{Binding IsSortedByLastPlayed, Mode=OneTime}"
  124. Tag="LastPlayed" />
  125. <RadioButton
  126. Checked="Sort_Checked"
  127. Content="{locale:Locale GameListHeaderFileExtension}"
  128. GroupName="Sort"
  129. IsChecked="{Binding IsSortedByType, Mode=OneTime}"
  130. Tag="FileType" />
  131. <RadioButton
  132. Checked="Sort_Checked"
  133. Content="{locale:Locale GameListHeaderFileSize}"
  134. GroupName="Sort"
  135. IsChecked="{Binding IsSortedBySize, Mode=OneTime}"
  136. Tag="FileSize" />
  137. <RadioButton
  138. Checked="Sort_Checked"
  139. Content="{locale:Locale GameListHeaderPath}"
  140. GroupName="Sort"
  141. IsChecked="{Binding IsSortedByPath, Mode=OneTime}"
  142. Tag="Path" />
  143. </StackPanel>
  144. <Border
  145. Width="60"
  146. Height="2"
  147. Margin="5"
  148. HorizontalAlignment="Stretch"
  149. BorderBrush="White"
  150. BorderThickness="0,1,0,0">
  151. <Separator Height="0" HorizontalAlignment="Stretch" />
  152. </Border>
  153. <RadioButton
  154. Checked="Order_Checked"
  155. Content="{locale:Locale OrderAscending}"
  156. GroupName="Order"
  157. IsChecked="{Binding IsAscending, Mode=OneTime}"
  158. Tag="Ascending" />
  159. <RadioButton
  160. Checked="Order_Checked"
  161. Content="{locale:Locale OrderDescending}"
  162. GroupName="Order"
  163. IsChecked="{Binding !IsAscending, Mode=OneTime}"
  164. Tag="Descending" />
  165. </StackPanel>
  166. </Flyout>
  167. </ui:DropDownButton.Flyout>
  168. </ui:DropDownButton>
  169. <TextBlock
  170. Margin="10,0"
  171. HorizontalAlignment="Right"
  172. VerticalAlignment="Center"
  173. DockPanel.Dock="Right"
  174. Text="{locale:Locale CommonSort}" />
  175. </DockPanel>
  176. </UserControl>