Skip to content

Commit 0befd2a

Browse files
committed
WinUI3: Settings page is done for now.
1 parent 7ce49a4 commit 0befd2a

File tree

4 files changed

+60
-37
lines changed

4 files changed

+60
-37
lines changed

MPDCtrl-WinUI3/MPDCtrl/Strings/en-us/Resources.resw

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,19 @@ SOFTWARE.</value>
475475
<data name="Settings_PrivacyPolicy.Description" xml:space="preserve">
476476
<value>Nothing Is Collected</value>
477477
</data>
478-
<data name="Settings_LocalStrage.Header" xml:space="preserve">
478+
<data name="Settings_LocalStorage.Header" xml:space="preserve">
479479
<value>Local storage</value>
480480
</data>
481-
<data name="Settings_LocalStrage.Description" xml:space="preserve">
481+
<data name="Settings_LocalStorage.Description" xml:space="preserve">
482482
<value>Cache folder for album cover/art images</value>
483483
</data>
484+
<data name="Settings_MPD_Connection_Status_IsConnected" xml:space="preserve">
485+
<value>Connected</value>
486+
</data>
487+
<data name="Settings_MPD_Connection_Status_IsNotConnected" xml:space="preserve">
488+
<value>Not Connected</value>
489+
</data>
490+
<data name="Settings_MPD_Connection_Status_IsConnecting" xml:space="preserve">
491+
<value>Connecting</value>
492+
</data>
484493
</root>

MPDCtrl-WinUI3/MPDCtrl/Strings/ja-jp/Resources.resw

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,19 @@ SOFTWARE.</value>
476476
<data name="Settings_PrivacyPolicy.Description" xml:space="preserve">
477477
<value>いかなる情報も収集しません</value>
478478
</data>
479-
<data name="Settings_LocalStrage.Header" xml:space="preserve">
479+
<data name="Settings_LocalStorage.Header" xml:space="preserve">
480480
<value>ローカルストレージ</value>
481481
</data>
482-
<data name="Settings_LocalStrage.Description" xml:space="preserve">
482+
<data name="Settings_LocalStorage.Description" xml:space="preserve">
483483
<value>アルバムカバー画像のローカル保存用フォルダ</value>
484484
</data>
485+
<data name="Settings_MPD_Connection_Status_IsConnected" xml:space="preserve">
486+
<value>接続済み</value>
487+
</data>
488+
<data name="Settings_MPD_Connection_Status_IsNotConnected" xml:space="preserve">
489+
<value>未接続</value>
490+
</data>
491+
<data name="Settings_MPD_Connection_Status_IsConnecting" xml:space="preserve">
492+
<value>接続中</value>
493+
</data>
485494
</root>

MPDCtrl-WinUI3/MPDCtrl/ViewModels/MainViewModel.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,49 +2020,55 @@ public string ShortStatusWithMpdVersion
20202020
{
20212021
if (IsConnected)
20222022
{
2023+
var connected = _resourceLoader.GetString("Settings_MPD_Connection_Status_IsConnected");
2024+
20232025
if (!string.IsNullOrEmpty(_mpdVersion))
20242026
{
20252027
if (CurrentProfile is not null)
20262028
{
2027-
return $"Connected to {CurrentProfile.Name} with MPD Protocol v{_mpdVersion}";
2029+
return $"{connected} ({CurrentProfile.Name} with MPD Protocol v{_mpdVersion})";
20282030
}
20292031
else
20302032
{
2031-
return $"Connected with MPD Protocol v{_mpdVersion}";
2033+
return $"{connected} (MPD Protocol v{_mpdVersion})";
20322034
}
20332035
}
20342036
else
20352037
{
20362038
if (CurrentProfile is not null)
20372039
{
2038-
return $"Connected to {CurrentProfile.Name}";
2040+
return $"{connected} ({CurrentProfile.Name})";
20392041
}
20402042
else
20412043
{
2042-
return "Connected";
2044+
return $"{connected}";
20432045
}
20442046
}
20452047
}
20462048
else if (IsConnecting)
20472049
{
2050+
var connecting = _resourceLoader.GetString("Settings_MPD_Connection_Status_IsConnecting");
2051+
20482052
if (CurrentProfile is not null)
20492053
{
2050-
return $"Connecting to {CurrentProfile.Name}...";
2054+
return $"{connecting} ({CurrentProfile.Name})...";
20512055
}
20522056
else
20532057
{
2054-
return "Connecting...";
2058+
return $"{connecting}...";
20552059
}
20562060
}
20572061
else
20582062
{
2063+
var notConnected = _resourceLoader.GetString("Settings_MPD_Connection_Status_IsNotConnected");
2064+
20592065
if (IsNotConnectingNorConnected)
20602066
{
2061-
return "Not connected";
2067+
return $"{notConnected}";
20622068
}
20632069

20642070

2065-
return "Not connected";
2071+
return $"{notConnected}";
20662072
}
20672073

20682074

MPDCtrl-WinUI3/MPDCtrl/Views/SettingsPage.xaml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<controls:SettingsExpander.Items>
5858

5959
<controls:SettingsCard x:Uid="Settings_Theme" HorizontalContentAlignment="Left" ContentAlignment="Vertical" Description="">
60-
<StackPanel Orientation="Horizontal" Spacing="24">
60+
<StackPanel Orientation="Horizontal" Spacing="24" Margin="0,6,0,12">
6161

6262
<RadioButton x:Uid="Settings_Theme_Light" IsEnabled="{x:Bind ViewModel.IsBackdropEnabled, Mode=OneWay}" Command="{x:Bind ViewModel.SwitchThemeCommand}" IsChecked="{x:Bind ViewModel.Theme, Converter={StaticResource ElementThemeEnumToBooleanConverter}, ConverterParameter=Light, Mode=OneWay}" FontSize="15" GroupName="AppTheme">
6363
<RadioButton.CommandParameter>
@@ -79,7 +79,7 @@
7979

8080
<controls:SettingsCard x:Uid="Settings_SystemBackdrop" HorizontalContentAlignment="Left" ContentAlignment="Vertical" Description="">
8181

82-
<StackPanel Orientation="Horizontal" Spacing="24">
82+
<StackPanel Orientation="Horizontal" Spacing="24" Margin="0,6,0,12">
8383

8484
<RadioButton x:Uid="Settings_SystemBackdrop_Acrylic" IsEnabled="{x:Bind ViewModel.IsAcrylicSupported,Mode=OneWay}" Command="{x:Bind ViewModel.SwitchSystemBackdropCommand}" CommandParameter="Acrylic" IsChecked="{x:Bind ViewModel.Material, Converter={StaticResource SystemBackdropEnumToBooleanConverter}, ConverterParameter=Acrylic, Mode=OneWay}" FontSize="15" GroupName="AppMaterial"/>
8585
<RadioButton x:Uid="Settings_SystemBackdrop_Mica" IsEnabled="{x:Bind ViewModel.IsMicaSupported,Mode=OneWay}" Command="{x:Bind ViewModel.SwitchSystemBackdropCommand}" CommandParameter="Mica" IsChecked="{x:Bind ViewModel.Material, Converter={StaticResource SystemBackdropEnumToBooleanConverter}, ConverterParameter=Mica, Mode=OneWay}" FontSize="15" GroupName="AppMaterial"/>
@@ -102,15 +102,15 @@
102102
<TextBlock Text="{x:Bind ViewModel.ShortStatusWithMpdVersion, Mode=OneWay}"></TextBlock>
103103

104104
<controls:SettingsExpander.Items>
105-
<controls:SettingsCard HorizontalContentAlignment="Stretch" ContentAlignment="Vertical" Header="@Connection Profile">
105+
<controls:SettingsCard Header="" Description="" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical">
106106

107107
<Grid>
108108
<Grid.ColumnDefinitions>
109109
<ColumnDefinition Width="Auto"></ColumnDefinition>
110110
<ColumnDefinition Width="*"></ColumnDefinition>
111111
</Grid.ColumnDefinitions>
112112

113-
<StackPanel Grid.Column="0" Spacing="12" Orientation="Horizontal" HorizontalAlignment="Left">
113+
<StackPanel Grid.Column="0" Spacing="12" Margin="0,12,0,12" Orientation="Horizontal" HorizontalAlignment="Left">
114114

115115
<ComboBox PlaceholderText="" MinWidth="300" Margin="0,0,0,0" SelectedIndex="-1" VerticalAlignment="Center"
116116
ItemsSource="{x:Bind ViewModel.Profiles, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.SelectedProfile, Mode=TwoWay}">
@@ -126,19 +126,19 @@
126126
</ComboBox.ItemTemplate>
127127
</ComboBox>
128128

129-
<Button Command="{x:Bind ViewModel.ShowProfileAddDialogCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="39" Height="36">
129+
<Button Command="{x:Bind ViewModel.ShowProfileAddDialogCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="39" Height="36" Margin="0,12,0,12">
130130
<Viewbox Width="14" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,2,0,0">
131131
<PathIcon Width="NaN" Height="NaN" Data="M11.883 3.007 12 3a1 1 0 0 1 .993.883L13 4v7h7a1 1 0 0 1 .993.883L21 12a1 1 0 0 1-.883.993L20 13h-7v7a1 1 0 0 1-.883.993L12 21a1 1 0 0 1-.993-.883L11 20v-7H4a1 1 0 0 1-.993-.883L3 12a1 1 0 0 1 .883-.993L4 11h7V4a1 1 0 0 1 .883-.993L12 3l-.117.007Z"></PathIcon>
132132
</Viewbox>
133133
</Button>
134-
135-
<Button Command="{x:Bind ViewModel.ShowProfileEditDialogCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="39" Height="36">
134+
135+
<Button Command="{x:Bind ViewModel.ShowProfileEditDialogCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="39" Height="36" Margin="0,12,0,12">
136136
<Viewbox Width="14" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,2,0,0">
137137
<PathIcon Width="NaN" Height="NaN" Data="m13.94 5 5.061 5.06-.962.962a6.5 6.5 0 0 0-7.016 7.016l-1.96 1.96a2.25 2.25 0 0 1-1 .58l-5.115 1.395a.75.75 0 0 1-.92-.92l1.394-5.116a2.25 2.25 0 0 1 .58-1L13.94 5Zm7.091-2.03a3.579 3.579 0 0 1 0 5.06l-.97.97L15 3.94l.97-.97a3.578 3.578 0 0 1 5.061 0ZM14.28 13.974a2 2 0 0 1-1.441 2.497l-.584.144a5.729 5.729 0 0 0 .006 1.807l.54.13a2 2 0 0 1 1.45 2.51l-.187.632c.44.386.94.699 1.484.921l.494-.518a2 2 0 0 1 2.899 0l.498.525a5.28 5.28 0 0 0 1.483-.913l-.198-.686a2 2 0 0 1 1.442-2.496l.583-.144a5.729 5.729 0 0 0-.006-1.808l-.54-.13a2 2 0 0 1-1.45-2.51l.187-.63a5.28 5.28 0 0 0-1.484-.923l-.493.519a2 2 0 0 1-2.9 0l-.498-.525c-.544.22-1.044.53-1.483.912l.198.686ZM17.501 19c-.8 0-1.45-.672-1.45-1.5 0-.829.65-1.5 1.45-1.5.8 0 1.45.671 1.45 1.5 0 .828-.65 1.5-1.45 1.5Z"></PathIcon>
138138
</Viewbox>
139139
</Button>
140140

141-
<Button Command="{x:Bind ViewModel.ShowProfileRemoveNoneDialogCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="39" Height="36">
141+
<Button Command="{x:Bind ViewModel.ShowProfileRemoveNoneDialogCommand}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="39" Height="36" Margin="0,12,0,12">
142142
<Viewbox Width="14" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,2,0,0">
143143
<PathIcon Width="NaN" Height="NaN" Data="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm-4.25 9.25a.75.75 0 0 0-.102 1.493l.102.007h8.5a.75.75 0 0 0 .102-1.493l-.102-.007h-8.5Z"></PathIcon>
144144
</Viewbox>
@@ -154,12 +154,12 @@
154154

155155
</controls:SettingsCard>
156156

157-
<controls:SettingsCard Header="afd" HorizontalContentAlignment="Left" ContentAlignment="Vertical" Description="fddfasa">
158-
<CheckBox x:Uid="Settings_MPD_Opts_UpdateDatabaseOnStartup" IsChecked="{x:Bind ViewModel.IsUpdateOnStartup, Mode=TwoWay}"/>
157+
<controls:SettingsCard Header="" Description="" HorizontalContentAlignment="Left" ContentAlignment="Vertical">
158+
<CheckBox x:Uid="Settings_MPD_Opts_UpdateDatabaseOnStartup" IsChecked="{x:Bind ViewModel.IsUpdateOnStartup, Mode=TwoWay}" Margin="0,12,0,12"/>
159159
</controls:SettingsCard>
160160

161-
<controls:SettingsCard Header="asdfsadf" HorizontalContentAlignment="Left" ContentAlignment="Vertical" Description="fdasa">
162-
<CheckBox x:Uid="Settings_MPD_Opts_UseReadPicture" IsChecked="{x:Bind ViewModel.IsDownloadAlbumArtEmbeddedUsingReadPicture, Mode=TwoWay}"/>
161+
<controls:SettingsCard Header="" Description="" HorizontalContentAlignment="Left" ContentAlignment="Vertical">
162+
<CheckBox x:Uid="Settings_MPD_Opts_UseReadPicture" IsChecked="{x:Bind ViewModel.IsDownloadAlbumArtEmbeddedUsingReadPicture, Mode=TwoWay}" Margin="0,12,0,12"/>
163163
</controls:SettingsCard>
164164

165165
</controls:SettingsExpander.Items>
@@ -173,24 +173,23 @@
173173
IsEnabled="True"
174174
IsExpanded="False">
175175
<controls:SettingsExpander.Items>
176-
177-
<controls:SettingsCard Header="afd" HorizontalContentAlignment="Left" ContentAlignment="Vertical" Description="fddfasa">
178-
<CheckBox x:Uid="Settings_Opts_AutoScrollToNowPlaying" IsChecked="{x:Bind ViewModel.IsAutoScrollToNowPlaying, Mode=TwoWay}"/>
179-
</controls:SettingsCard>
176+
<controls:SettingsCard Header="" Description="" HorizontalContentAlignment="Left" ContentAlignment="Vertical">
177+
<CheckBox x:Uid="Settings_Opts_AutoScrollToNowPlaying" IsChecked="{x:Bind ViewModel.IsAutoScrollToNowPlaying, Mode=TwoWay}" Margin="0,12,0,12"/>
178+
</controls:SettingsCard>
180179

181180
</controls:SettingsExpander.Items>
182181
</controls:SettingsExpander>
183182

184-
<!-- Local strage usage -->
185-
<controls:SettingsExpander x:Name="SettingsCardLocalStrage"
183+
<!-- Local storage usage -->
184+
<controls:SettingsExpander x:Name="SettingsCardLocalStorage"
186185
VerticalAlignment="Top"
187-
x:Uid="Settings_LocalStrage"
186+
x:Uid="Settings_LocalStorage"
188187
IsEnabled="True"
189188
IsExpanded="False">
190189
<controls:SettingsExpander.Items>
191190

192-
<controls:SettingsCard Header="afd" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical" Description="fddfasa">
193-
<Grid>
191+
<controls:SettingsCard Header="" Description="" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical">
192+
<Grid Margin="0,12,0,12">
194193
<Grid.ColumnDefinitions>
195194
<ColumnDefinition Width="Auto"></ColumnDefinition>
196195
<ColumnDefinition Width="*"></ColumnDefinition>
@@ -212,7 +211,7 @@
212211
<controls:SettingsExpander x:Uid="Settings_ProjectPage">
213212
<controls:SettingsExpander.Items>
214213
<controls:SettingsCard Header="Project Page" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical" Description="@Github">
215-
<HyperlinkButton NavigateUri="https://github.com/torum/MPDCtrl">https://github.com/torum/MPDCtrl</HyperlinkButton>
214+
<HyperlinkButton NavigateUri="https://github.com/torum/MPDCtrl/">https://github.com/torum/MPDCtrl/</HyperlinkButton>
216215
</controls:SettingsCard>
217216
<controls:SettingsCard Header="App Page" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical" Description="@Github">
218217
<HyperlinkButton NavigateUri="https://torum.github.io/MPDCtrl/">https://torum.github.io/MPDCtrl/</HyperlinkButton>
@@ -228,7 +227,7 @@
228227

229228
<controls:SettingsExpander.Items>
230229
<controls:SettingsCard Header="The MIT License" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical" Description="Copyright (c) 2018~ torum">
231-
<TextBlock x:Uid="Settings_LicenseText" TextWrapping="Wrap"></TextBlock>
230+
<TextBlock x:Uid="Settings_LicenseText" TextWrapping="Wrap" Margin="0,12,0,12"></TextBlock>
232231
</controls:SettingsCard>
233232
</controls:SettingsExpander.Items>
234233

@@ -239,7 +238,7 @@
239238

240239
<controls:SettingsExpander.Items>
241240
<controls:SettingsCard Header="" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical" Description="">
242-
<TextBlock x:Uid="Settings_PrivacyPolicyText" TextWrapping="Wrap"></TextBlock>
241+
<TextBlock x:Uid="Settings_PrivacyPolicyText" TextWrapping="Wrap" Margin="0,12,0,12"></TextBlock>
243242
</controls:SettingsCard>
244243
</controls:SettingsExpander.Items>
245244

@@ -250,7 +249,7 @@
250249

251250
<controls:SettingsExpander.Items>
252251
<controls:SettingsCard Header="Microsoft" HorizontalContentAlignment="Stretch" ContentAlignment="Vertical" Description="The MIT License">
253-
<StackPanel Spacing="12">
252+
<StackPanel Spacing="12" Margin="0,12,0,12">
254253
<HyperlinkButton NavigateUri="https://github.com/CommunityToolkit/Windows">CommunityToolkit.Mvvm/WinUI</HyperlinkButton>
255254
<HyperlinkButton NavigateUri="https://www.nuget.org/packages/microsoft.extensions.dependencyinjection/">Microsoft.Extensions.DependencyInjection</HyperlinkButton>
256255
<HyperlinkButton NavigateUri="https://www.nuget.org/packages/Microsoft.Extensions.Hosting">Microsoft.Extensions.Hosting</HyperlinkButton>

0 commit comments

Comments
 (0)