MainViewControls.axaml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. DockPanel.Dock="Right"
  78. KeyUp="SearchBox_OnKeyUp"
  79. Text="{Binding SearchText}"
  80. Watermark="{locale:Locale MenuSearch}" />
  81. <ui:DropDownButton
  82. Width="150"
  83. HorizontalAlignment="Right"
  84. VerticalAlignment="Center"
  85. Content="{Binding SortName}"
  86. DockPanel.Dock="Right">
  87. <ui:DropDownButton.Flyout>
  88. <Flyout Placement="Bottom">
  89. <StackPanel
  90. Margin="0"
  91. HorizontalAlignment="Stretch"
  92. Orientation="Vertical">
  93. <StackPanel>
  94. <RadioButton
  95. Checked="Sort_Checked"
  96. Content="{locale:Locale CommonFavorite}"
  97. GroupName="Sort"
  98. IsChecked="{Binding IsSortedByFavorite, Mode=OneTime}"
  99. Tag="Favorite" />
  100. <RadioButton
  101. Checked="Sort_Checked"
  102. Content="{locale:Locale GameListHeaderApplication}"
  103. GroupName="Sort"
  104. IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
  105. Tag="Title" />
  106. <RadioButton
  107. Checked="Sort_Checked"
  108. Content="{locale:Locale GameListHeaderDeveloper}"
  109. GroupName="Sort"
  110. IsChecked="{Binding IsSortedByDeveloper, Mode=OneTime}"
  111. Tag="Developer" />
  112. <RadioButton
  113. Checked="Sort_Checked"
  114. Content="{locale:Locale GameListHeaderTimePlayed}"
  115. GroupName="Sort"
  116. IsChecked="{Binding IsSortedByTimePlayed, Mode=OneTime}"
  117. Tag="TotalTimePlayed" />
  118. <RadioButton
  119. Checked="Sort_Checked"
  120. Content="{locale:Locale GameListHeaderLastPlayed}"
  121. GroupName="Sort"
  122. IsChecked="{Binding IsSortedByLastPlayed, Mode=OneTime}"
  123. Tag="LastPlayed" />
  124. <RadioButton
  125. Checked="Sort_Checked"
  126. Content="{locale:Locale GameListHeaderFileExtension}"
  127. GroupName="Sort"
  128. IsChecked="{Binding IsSortedByType, Mode=OneTime}"
  129. Tag="FileType" />
  130. <RadioButton
  131. Checked="Sort_Checked"
  132. Content="{locale:Locale GameListHeaderFileSize}"
  133. GroupName="Sort"
  134. IsChecked="{Binding IsSortedBySize, Mode=OneTime}"
  135. Tag="FileSize" />
  136. <RadioButton
  137. Checked="Sort_Checked"
  138. Content="{locale:Locale GameListHeaderPath}"
  139. GroupName="Sort"
  140. IsChecked="{Binding IsSortedByPath, Mode=OneTime}"
  141. Tag="Path" />
  142. </StackPanel>
  143. <Border
  144. Width="60"
  145. Height="2"
  146. Margin="5"
  147. HorizontalAlignment="Stretch"
  148. BorderBrush="White"
  149. BorderThickness="0,1,0,0">
  150. <Separator Height="0" HorizontalAlignment="Stretch" />
  151. </Border>
  152. <RadioButton
  153. Checked="Order_Checked"
  154. Content="{locale:Locale OrderAscending}"
  155. GroupName="Order"
  156. IsChecked="{Binding IsAscending, Mode=OneTime}"
  157. Tag="Ascending" />
  158. <RadioButton
  159. Checked="Order_Checked"
  160. Content="{locale:Locale OrderDescending}"
  161. GroupName="Order"
  162. IsChecked="{Binding !IsAscending, Mode=OneTime}"
  163. Tag="Descending" />
  164. </StackPanel>
  165. </Flyout>
  166. </ui:DropDownButton.Flyout>
  167. </ui:DropDownButton>
  168. <TextBlock
  169. Margin="10,0"
  170. HorizontalAlignment="Right"
  171. VerticalAlignment="Center"
  172. DockPanel.Dock="Right"
  173. Text="{locale:Locale CommonSort}" />
  174. </DockPanel>
  175. </UserControl>