Avalonia: Move LocaleExtension & IconExtension into one namespace to simplify the usage sites in the markup.

This commit is contained in:
Evan Husted 2024-11-01 13:00:56 -05:00
parent 6911e288bc
commit 4c83794254
36 changed files with 599 additions and 602 deletions

View file

@ -3,9 +3,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:viewModel="clr-namespace:Ryujinx.Ava.UI.ViewModels"
Width="550"
Height="260"
@ -85,7 +84,7 @@
HorizontalAlignment="Center"
FontSize="10"
LineHeight="12"
Text="{locale:Locale AboutDisclaimerMessage}"
Text="{ext:Locale AboutDisclaimerMessage}"
TextAlignment="Center"
TextWrapping="Wrap" />
<TextBlock
@ -95,7 +94,7 @@
FontSize="10"
LineHeight="12"
PointerPressed="AmiiboLabel_OnPointerPressed"
Text="{locale:Locale AboutAmiiboDisclaimerMessage}"
Text="{ext:Locale AboutAmiiboDisclaimerMessage}"
TextAlignment="Center"
TextWrapping="Wrap" />
<StackPanel
@ -111,7 +110,7 @@
Background="Transparent"
Click="Button_OnClick"
CornerRadius="15"
ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}">
ToolTip.Tip="{ext:Locale AboutGithubUrlTooltipMessage}">
<Image Source="{Binding GithubLogo}" />
</Button>
<Button
@ -124,7 +123,7 @@
Click="Button_OnClick"
CornerRadius="15"
Tag="https://discord.gg/dHPrkBkkyA"
ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}">
ToolTip.Tip="{ext:Locale AboutDiscordUrlTooltipMessage}">
<Image Source="{Binding DiscordLogo}" />
</Button>
</StackPanel>
@ -148,10 +147,10 @@
<TextBlock
FontSize="15"
FontWeight="Bold"
Text="{locale:Locale AboutRyujinxAboutTitle}" />
Text="{ext:Locale AboutRyujinxAboutTitle}" />
<TextBlock
FontSize="10"
Text="{locale:Locale AboutRyujinxAboutContent}"
Text="{ext:Locale AboutRyujinxAboutContent}"
TextWrapping="Wrap" />
</StackPanel>
<StackPanel
@ -161,7 +160,7 @@
<TextBlock
FontSize="15"
FontWeight="Bold"
Text="{locale:Locale AboutRyujinxMaintainersTitle}" />
Text="{ext:Locale AboutRyujinxMaintainersTitle}" />
<TextBlock
FontSize="10"
Text="{Binding Developers}"
@ -174,9 +173,9 @@
Tag="https://github.com/GreemDev/Ryujinx/graphs/contributors?type=a">
<TextBlock
FontSize="10"
Text="{locale:Locale AboutRyujinxContributorsButtonHeader}"
Text="{ext:Locale AboutRyujinxContributorsButtonHeader}"
TextAlignment="End"
ToolTip.Tip="{locale:Locale AboutRyujinxMaintainersContentTooltipMessage}" />
ToolTip.Tip="{ext:Locale AboutRyujinxMaintainersContentTooltipMessage}" />
</Button>
</StackPanel>
</Grid>

View file

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
mc:Ignorable="d"
d:DesignWidth="400"
d:DesignHeight="350"
@ -25,11 +25,11 @@
<Grid RowDefinitions="Auto,Auto,*,Auto" Margin="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Grid ColumnDefinitions="*,*" Grid.Row="1" HorizontalAlignment="Stretch" >
<StackPanel Spacing="10" Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock VerticalAlignment="Center" Text="{locale:Locale AmiiboSeriesLabel}" />
<TextBlock VerticalAlignment="Center" Text="{ext:Locale AmiiboSeriesLabel}" />
<ComboBox SelectedIndex="{Binding SeriesSelectedIndex}" ItemsSource="{Binding AmiiboSeries}" MinWidth="100" />
</StackPanel>
<StackPanel Spacing="10" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock VerticalAlignment="Center" Text="{locale:Locale AmiiboCharacterLabel}" />
<TextBlock VerticalAlignment="Center" Text="{ext:Locale AmiiboCharacterLabel}" />
<ComboBox SelectedIndex="{Binding AmiiboSelectedIndex}" MinWidth="100" ItemsSource="{Binding AmiiboList}" />
</StackPanel>
</Grid>
@ -44,24 +44,24 @@
<Grid Grid.Row="3" ColumnDefinitions="Auto,Auto,*,Auto,Auto">
<CheckBox Margin="10" Grid.Column="0" VerticalContentAlignment="Center"
IsChecked="{Binding ShowAllAmiibo}"
Content="{locale:Locale AmiiboOptionsShowAllLabel}" />
Content="{ext:Locale AmiiboOptionsShowAllLabel}" />
<CheckBox HotKey="H"
Margin="10" VerticalContentAlignment="Center" Grid.Column="1"
IsChecked="{Binding UseRandomUuid}"
Content="{locale:Locale AmiiboOptionsUsRandomTagLabel}" />
Content="{ext:Locale AmiiboOptionsUsRandomTagLabel}" />
<Button Grid.Column="3"
IsEnabled="{Binding EnableScanning}"
Width="80"
Name="ScanButton"
HotKey="Return"
Content="{locale:Locale AmiiboScanButtonLabel}"
Content="{ext:Locale AmiiboScanButtonLabel}"
Click="ScanButton_Click" />
<Button Grid.Column="4"
Margin="10,0"
Width="80"
Name="CancelButton"
HotKey="Escape"
Content="{locale:Locale InputDialogCancel}"
Content="{ext:Locale InputDialogCancel}"
Click="CancelButton_Click" />
</Grid>
</Grid>

View file

@ -3,9 +3,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="clr-namespace:Ryujinx.Ava.UI.Models"
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
Width="500"
Height="500"
@ -41,7 +40,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
LineHeight="30"
Text="{locale:Locale BuildId}"
Text="{ext:Locale BuildId}"
TextAlignment="Center"
TextWrapping="Wrap" />
<TextBox
@ -101,7 +100,7 @@
HotKey="Ctrl+S"
Command="{Binding Save}"
IsVisible="{Binding !NoCheatsFound}">
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
<TextBlock Text="{ext:Locale SettingsButtonSave}" />
</Button>
<Button
Name="CancelButton"
@ -109,7 +108,7 @@
Margin="5"
HotKey="Escape"
Command="{Binding Close}">
<TextBlock Text="{locale:Locale InputDialogCancel}" />
<TextBlock Text="{ext:Locale InputDialogCancel}" />
</Button>
</DockPanel>
</DockPanel>

View file

@ -3,7 +3,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:models="clr-namespace:Ryujinx.UI.Common.Models;assembly=Ryujinx.UI.Common"
@ -33,7 +33,7 @@
<TextBlock
FontStyle="Italic"
VerticalAlignment="Bottom"
Text="{locale:Locale DlcWindowBundledContentNotice}" />
Text="{ext:Locale DlcWindowBundledContentNotice}" />
</StackPanel>
<Panel
Margin="0 0 0 10"
@ -51,14 +51,14 @@
MinWidth="90"
Margin="5"
Command="{Binding EnableAll}">
<TextBlock Text="{locale:Locale DlcManagerEnableAllButton}" />
<TextBlock Text="{ext:Locale DlcManagerEnableAllButton}" />
</Button>
<Button
Name="DisableAllButton"
MinWidth="90"
Margin="5"
Command="{Binding DisableAll}">
<TextBlock Text="{locale:Locale DlcManagerDisableAllButton}" />
<TextBlock Text="{ext:Locale DlcManagerDisableAllButton}" />
</Button>
</StackPanel>
<TextBox
@ -66,7 +66,7 @@
MinHeight="29"
MaxHeight="29"
HorizontalAlignment="Stretch"
Watermark="{locale:Locale Search}"
Watermark="{ext:Locale Search}"
Text="{Binding Search}" />
</Grid>
</Panel>
@ -167,14 +167,14 @@
MinWidth="90"
Margin="5"
Command="{Binding Add}">
<TextBlock Text="{locale:Locale SettingsTabGeneralAdd}" />
<TextBlock Text="{ext:Locale SettingsTabGeneralAdd}" />
</Button>
<Button
Name="RemoveAllButton"
MinWidth="90"
Margin="5"
Command="{Binding RemoveAll}">
<TextBlock Text="{locale:Locale DlcManagerRemoveAllButton}" />
<TextBlock Text="{ext:Locale DlcManagerRemoveAllButton}" />
</Button>
</StackPanel>
<StackPanel
@ -186,14 +186,14 @@
MinWidth="90"
Margin="5"
Click="SaveAndClose">
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
<TextBlock Text="{ext:Locale SettingsButtonSave}" />
</Button>
<Button
Name="CancelButton"
MinWidth="90"
Margin="5"
Click="Close">
<TextBlock Text="{locale:Locale InputDialogCancel}" />
<TextBlock Text="{ext:Locale InputDialogCancel}" />
</Button>
</StackPanel>
</Panel>

View file

@ -2,7 +2,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
@ -31,14 +31,14 @@
MinWidth="90"
Margin="5"
Command="{Binding EnableAll}">
<TextBlock Text="{locale:Locale DlcManagerEnableAllButton}" />
<TextBlock Text="{ext:Locale DlcManagerEnableAllButton}" />
</Button>
<Button
Name="DisableAllButton"
MinWidth="90"
Margin="5"
Command="{Binding DisableAll}">
<TextBlock Text="{locale:Locale DlcManagerDisableAllButton}" />
<TextBlock Text="{ext:Locale DlcManagerDisableAllButton}" />
</Button>
</StackPanel>
<TextBox
@ -46,7 +46,7 @@
MinHeight="27"
MaxHeight="27"
HorizontalAlignment="Stretch"
Watermark="{locale:Locale Search}"
Watermark="{ext:Locale Search}"
Text="{Binding Search}" />
</Grid>
</Panel>
@ -135,14 +135,14 @@
MinWidth="90"
Margin="5"
Command="{Binding Add}">
<TextBlock Text="{locale:Locale SettingsTabGeneralAdd}" />
<TextBlock Text="{ext:Locale SettingsTabGeneralAdd}" />
</Button>
<Button
Name="RemoveAllButton"
MinWidth="90"
Margin="5"
Click="DeleteAll">
<TextBlock Text="{locale:Locale ModManagerDeleteAllButton}" />
<TextBlock Text="{ext:Locale ModManagerDeleteAllButton}" />
</Button>
</StackPanel>
<StackPanel
@ -154,14 +154,14 @@
MinWidth="90"
Margin="5"
Click="SaveAndClose">
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
<TextBlock Text="{ext:Locale SettingsButtonSave}" />
</Button>
<Button
Name="CancelButton"
MinWidth="90"
Margin="5"
Click="Close">
<TextBlock Text="{locale:Locale InputDialogCancel}" />
<TextBlock Text="{ext:Locale InputDialogCancel}" />
</Button>
</StackPanel>
</Panel>

View file

@ -3,7 +3,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
@ -51,23 +51,23 @@
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem
IsSelected="True"
Content="{locale:Locale SettingsTabGeneral}"
Content="{ext:Locale SettingsTabGeneral}"
Tag="UiPage"
IconSource="New" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabInput}"
Content="{ext:Locale SettingsTabInput}"
Tag="InputPage"
IconSource="Games" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabHotkeys}"
Content="{ext:Locale SettingsTabHotkeys}"
Tag="HotkeysPage"
IconSource="Keyboard" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabSystem}"
Content="{ext:Locale SettingsTabSystem}"
Tag="SystemPage"
IconSource="Settings" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabCpu}"
Content="{ext:Locale SettingsTabCpu}"
Tag="CpuPage">
<ui:NavigationViewItem.IconSource>
<ui:FontIconSource
@ -76,19 +76,19 @@
</ui:NavigationViewItem.IconSource>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabGraphics}"
Content="{ext:Locale SettingsTabGraphics}"
Tag="GraphicsPage"
IconSource="Image" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabAudio}"
Content="{ext:Locale SettingsTabAudio}"
IconSource="Audio"
Tag="AudioPage" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabNetwork}"
Content="{ext:Locale SettingsTabNetwork}"
Tag="NetworkPage"
IconSource="Globe" />
<ui:NavigationViewItem
Content="{locale:Locale SettingsTabLogging}"
Content="{ext:Locale SettingsTabLogging}"
Tag="LoggingPage"
IconSource="Document" />
</ui:NavigationView.MenuItems>
@ -111,14 +111,14 @@
<Button
HotKey="Enter"
Classes="accent"
Content="{locale:Locale SettingsButtonOk}"
Content="{ext:Locale SettingsButtonOk}"
Command="{Binding OkButton}" />
<Button
HotKey="Escape"
Content="{locale:Locale SettingsButtonCancel}"
Content="{ext:Locale SettingsButtonCancel}"
Command="{Binding CancelButton}" />
<Button
Content="{locale:Locale SettingsButtonApply}"
Content="{ext:Locale SettingsButtonApply}"
Command="{Binding ApplyButton}" />
</ReversibleStackPanel>
</Grid>

View file

@ -3,7 +3,7 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:models="clr-namespace:Ryujinx.UI.Common.Models;assembly=Ryujinx.UI.Common"
@ -33,7 +33,7 @@
<TextBlock
FontStyle="Italic"
VerticalAlignment="Bottom"
Text="{locale:Locale UpdateWindowBundledContentNotice}" />
Text="{ext:Locale UpdateWindowBundledContentNotice}" />
</StackPanel>
<Border
Grid.Row="1"
@ -103,7 +103,7 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
TextWrapping="Wrap"
Text="{locale:Locale NoUpdate}" />
Text="{ext:Locale NoUpdate}" />
</Panel>
</DataTemplate>
</ListBox.DataTemplates>
@ -125,13 +125,13 @@
Name="AddButton"
MinWidth="90"
Command="{Binding Add}">
<TextBlock Text="{locale:Locale SettingsTabGeneralAdd}" />
<TextBlock Text="{ext:Locale SettingsTabGeneralAdd}" />
</Button>
<Button
Name="RemoveAllButton"
MinWidth="90"
Click="RemoveAll">
<TextBlock Text="{locale:Locale DlcManagerRemoveAllButton}" />
<TextBlock Text="{ext:Locale DlcManagerRemoveAllButton}" />
</Button>
</StackPanel>
<StackPanel
@ -142,13 +142,13 @@
Name="SaveButton"
MinWidth="90"
Click="Save">
<TextBlock Text="{locale:Locale SettingsButtonSave}" />
<TextBlock Text="{ext:Locale SettingsButtonSave}" />
</Button>
<Button
Name="CancelButton"
MinWidth="90"
Click="Close">
<TextBlock Text="{locale:Locale InputDialogCancel}" />
<TextBlock Text="{ext:Locale InputDialogCancel}" />
</Button>
</StackPanel>
</Panel>