Files
Wino-Mail/Wino.Mail/Views/Settings/EditAccountDetailsPage.xaml
Burak Kaan Köse 8ecf301eb8 Account colors + edit account details. (#592)
* Remove account rename dialog. Implement edit account details page.

* Remove unused folder definition.

* Adressing theming issues and adding reset button. Changing the UI a bit.

* Enable auto indent in initializer. Use service from the application.

* Adding color picker to acc setup dialog. Changing UI of edit acc details page.
2025-03-01 01:17:04 +01:00

78 lines
11 KiB
XML

<abstract:EditAccountDetailsPageAbstract
x:Class="Wino.Views.EditAccountDetailsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:abstract="using:Wino.Views.Abstract"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:converters="using:Wino.Core.UWP.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:data="using:Wino.Core.ViewModels.Data"
xmlns:domain="using:Wino.Core.Domain"
xmlns:helpers="using:Wino.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:picker="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel Spacing="3">
<controls:SettingsExpander Description="{x:Bind domain:Translator.AccountDetailsPage_Description}" Header="{x:Bind domain:Translator.AccountDetailsPage_Title}">
<controls:SettingsExpander.HeaderIcon>
<SymbolIcon Symbol="Contact" />
</controls:SettingsExpander.HeaderIcon>
<controls:SettingsExpander.Items>
<controls:SettingsCard Header="{x:Bind domain:Translator.AccountEditDialog_Message}">
<TextBox
Width="200"
PlaceholderText="{x:Bind domain:Translator.AccountSettingsDialog_AccountNamePlaceholder}"
Text="{x:Bind ViewModel.AccountName, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard HorizontalContentAlignment="Stretch" Header="{x:Bind domain:Translator.AccountSettingsDialog_AccountName}">
<TextBox
Width="200"
HorizontalAlignment="Stretch"
PlaceholderText="{x:Bind domain:Translator.AccountSettingsDialog_AccountNamePlaceholder}"
Text="{x:Bind ViewModel.SenderName, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard HorizontalContentAlignment="Stretch" Header="{x:Bind domain:Translator.Buttons_Save}">
<Button
Command="{x:Bind ViewModel.SaveChangesCommand}"
Content="{x:Bind domain:Translator.Buttons_Save}"
Style="{ThemeResource AccentButtonStyle}" />
</controls:SettingsCard>
</controls:SettingsExpander.Items>
</controls:SettingsExpander>
<controls:SettingsCard
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ContentAlignment="Vertical"
Description="{x:Bind domain:Translator.AccountDetailsPage_ColorPicker_Description}"
Header="{x:Bind domain:Translator.AccountDetailsPage_ColorPicker_Title}">
<controls:SettingsCard.HeaderIcon>
<PathIcon Data="F1 M 6.328125 11.835938 C 6.035156 11.835938 5.768229 11.894531 5.527344 12.011719 C 5.286458 12.128906 5.050456 12.259115 4.819336 12.402344 C 4.588216 12.545573 4.348958 12.675781 4.101562 12.792969 C 3.854167 12.910156 3.580729 12.96875 3.28125 12.96875 C 2.877604 12.96875 2.49349 12.871094 2.128906 12.675781 C 1.764323 12.480469 1.435547 12.255859 1.142578 12.001953 C 0.745443 11.656901 0.455729 11.261394 0.273438 10.81543 C 0.091146 10.369467 0 9.886068 0 9.365234 C 0 8.844401 0.071615 8.325195 0.214844 7.807617 C 0.358073 7.290039 0.533854 6.796875 0.742188 6.328125 C 0.970052 5.820312 1.233724 5.328776 1.533203 4.853516 C 1.832682 4.378256 2.158203 3.925781 2.509766 3.496094 C 2.828776 3.105469 3.167318 2.736004 3.525391 2.387695 C 3.883463 2.039389 4.277344 1.728516 4.707031 1.455078 C 5.442708 0.986328 6.225586 0.628256 7.055664 0.380859 C 7.885742 0.133465 8.736979 0.009766 9.609375 0.009766 C 10.436197 0.009766 11.25 0.117188 12.050781 0.332031 C 12.851562 0.546875 13.616536 0.849609 14.345703 1.240234 C 15.23763 1.728516 16.033527 2.298178 16.733398 2.949219 C 17.433268 3.600262 18.025715 4.322917 18.510742 5.117188 C 18.995768 5.911459 19.365234 6.769206 19.619141 7.69043 C 19.873047 8.611654 20 9.583334 20 10.605469 C 20 11.230469 19.952799 11.850586 19.858398 12.46582 C 19.763996 13.081055 19.62565 13.688151 19.443359 14.287109 C 19.300129 14.74935 19.119465 15.213217 18.901367 15.678711 C 18.683268 16.144205 18.427734 16.59017 18.134766 17.016602 C 17.841797 17.443033 17.516275 17.843424 17.158203 18.217773 C 16.800129 18.592123 16.411133 18.916016 15.991211 19.189453 C 15.571289 19.462891 15.12207 19.677734 14.643555 19.833984 C 14.165039 19.990234 13.662109 20.068359 13.134766 20.068359 C 12.841797 20.068359 12.553711 20.042318 12.270508 19.990234 C 11.987305 19.93815 11.708984 19.863281 11.435547 19.765625 C 10.86263 19.563803 10.371094 19.31315 9.960938 19.013672 C 9.550781 18.714193 9.210611 18.365885 8.94043 17.96875 C 8.670247 17.571615 8.465169 17.12565 8.325195 16.630859 C 8.185221 16.136068 8.095703 15.592448 8.056641 15 C 8.030599 14.641928 8.012695 14.283854 8.00293 13.925781 C 7.993164 13.567709 7.945963 13.212891 7.861328 12.861328 C 7.835286 12.763672 7.805989 12.659506 7.773438 12.548828 C 7.740885 12.438151 7.688802 12.347006 7.617188 12.275391 C 7.545573 12.197266 7.457682 12.128906 7.353516 12.070312 C 7.249349 12.011719 7.138672 11.966146 7.021484 11.933594 C 6.904297 11.901042 6.785481 11.876628 6.665039 11.860352 C 6.544596 11.844076 6.432292 11.835938 6.328125 11.835938 Z M 13.134766 18.818359 C 13.623047 18.818359 14.088541 18.725586 14.53125 18.540039 C 14.973958 18.354492 15.384114 18.108725 15.761719 17.802734 C 16.276041 17.386068 16.722004 16.894531 17.099609 16.328125 C 17.477213 15.761719 17.789713 15.157878 18.037109 14.516602 C 18.284504 13.875326 18.466797 13.214519 18.583984 12.53418 C 18.701172 11.853842 18.759766 11.191406 18.759766 10.546875 C 18.759766 9.641928 18.647461 8.785808 18.422852 7.978516 C 18.198242 7.171225 17.871094 6.420898 17.441406 5.727539 C 17.011719 5.03418 16.487629 4.404297 15.869141 3.837891 C 15.25065 3.271484 14.547525 2.773438 13.759766 2.34375 C 13.128255 1.998699 12.460938 1.728516 11.757812 1.533203 C 11.054688 1.337891 10.338541 1.240234 9.609375 1.240234 C 8.710938 1.240234 7.869466 1.383465 7.084961 1.669922 C 6.300456 1.956381 5.582682 2.351889 4.931641 2.856445 C 4.280599 3.361004 3.697917 3.953451 3.183594 4.633789 C 2.669271 5.314128 2.236328 6.048178 1.884766 6.835938 C 1.702474 7.233074 1.551107 7.64323 1.430664 8.066406 C 1.310221 8.489584 1.25 8.922526 1.25 9.365234 C 1.25 9.703776 1.302083 10.011394 1.40625 10.288086 C 1.510417 10.564779 1.689453 10.817058 1.943359 11.044922 C 2.014974 11.110026 2.104492 11.181641 2.211914 11.259766 C 2.319336 11.337891 2.431641 11.411133 2.548828 11.479492 C 2.666016 11.547852 2.783203 11.606445 2.900391 11.655273 C 3.017578 11.704102 3.125 11.728516 3.222656 11.728516 C 3.404948 11.728516 3.60026 11.668295 3.808594 11.547852 C 4.016927 11.427409 4.246419 11.297201 4.49707 11.157227 C 4.747721 11.017253 5.022786 10.887045 5.322266 10.766602 C 5.621745 10.646159 5.957031 10.585938 6.328125 10.585938 C 6.529948 10.585938 6.731771 10.603842 6.933594 10.639648 C 7.135416 10.675456 7.330729 10.722656 7.519531 10.78125 C 7.942708 10.917969 8.268229 11.113281 8.496094 11.367188 C 8.723958 11.621094 8.891602 11.912436 8.999023 12.241211 C 9.106445 12.569987 9.173177 12.928061 9.199219 13.31543 C 9.22526 13.7028 9.249674 14.098308 9.272461 14.501953 C 9.295247 14.9056 9.337564 15.309245 9.399414 15.712891 C 9.461263 16.116537 9.580078 16.499023 9.755859 16.860352 C 9.931641 17.22168 10.185547 17.552084 10.517578 17.851562 C 10.849609 18.151041 11.295572 18.398438 11.855469 18.59375 C 12.272135 18.74349 12.698566 18.818359 13.134766 18.818359 Z M 8.75 4.6875 C 8.75 4.427084 8.841146 4.20573 9.023438 4.023438 C 9.205729 3.841146 9.427083 3.75 9.6875 3.75 C 9.947916 3.75 10.169271 3.841146 10.351562 4.023438 C 10.533854 4.20573 10.625 4.427084 10.625 4.6875 C 10.625 4.947917 10.533854 5.169271 10.351562 5.351562 C 10.169271 5.533854 9.947916 5.625 9.6875 5.625 C 9.427083 5.625 9.205729 5.533854 9.023438 5.351562 C 8.841146 5.169271 8.75 4.947917 8.75 4.6875 Z M 12.5 5.9375 C 12.5 5.677084 12.591146 5.455729 12.773438 5.273438 C 12.955729 5.091146 13.177083 5.000001 13.4375 5 C 13.697916 5.000001 13.91927 5.091146 14.101562 5.273438 C 14.283854 5.455729 14.375 5.677084 14.375 5.9375 C 14.375 6.197917 14.283854 6.419271 14.101562 6.601562 C 13.91927 6.783855 13.697916 6.875001 13.4375 6.875 C 13.177083 6.875001 12.955729 6.783855 12.773438 6.601562 C 12.591146 6.419271 12.5 6.197917 12.5 5.9375 Z M 14.6875 8.75 C 14.6875 8.489584 14.778646 8.268229 14.960938 8.085938 C 15.143229 7.903646 15.364582 7.812501 15.625 7.8125 C 15.885416 7.812501 16.10677 7.903646 16.289062 8.085938 C 16.471354 8.268229 16.5625 8.489584 16.5625 8.75 C 16.5625 9.010417 16.471354 9.231771 16.289062 9.414062 C 16.10677 9.596354 15.885416 9.6875 15.625 9.6875 C 15.364582 9.6875 15.143229 9.596354 14.960938 9.414062 C 14.778646 9.231771 14.6875 9.010417 14.6875 8.75 Z M 14.6875 12.5 C 14.6875 12.239584 14.778646 12.018229 14.960938 11.835938 C 15.143229 11.653646 15.364582 11.5625 15.625 11.5625 C 15.885416 11.5625 16.10677 11.653646 16.289062 11.835938 C 16.471354 12.018229 16.5625 12.239584 16.5625 12.5 C 16.5625 12.760417 16.471354 12.981771 16.289062 13.164062 C 16.10677 13.346354 15.885416 13.4375 15.625 13.4375 C 15.364582 13.4375 15.143229 13.346354 14.960938 13.164062 C 14.778646 12.981771 14.6875 12.760417 14.6875 12.5 Z M 12.1875 15 C 12.187499 14.739584 12.278645 14.518229 12.460938 14.335938 C 12.643229 14.153646 12.864583 14.0625 13.125 14.0625 C 13.385416 14.0625 13.606771 14.153646 13.789062 14.335938 C 13.971354 14.518229 14.062499 14.739584 14.0625 15 C 14.062499 15.260417 13.971354 15.481771 13.789062 15.664062 C 13.606771 15.846354 13.385416 15.9375 13.125 15.9375 C 12.864583 15.9375 12.643229 15.846354 12.460938 15.664062 C 12.278645 15.481771 12.187499 15.260417 12.1875 15 Z " />
</controls:SettingsCard.HeaderIcon>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GridView
ItemTemplate="{StaticResource AccountColorTemplate}"
ItemsSource="{x:Bind ViewModel.AvailableColors}"
SelectedItem="{x:Bind ViewModel.SelectedColor, Mode=TwoWay}" />
<Button
Grid.Row="1"
HorizontalAlignment="Right"
Command="{x:Bind ViewModel.ResetColorCommand}"
Content="{x:Bind domain:Translator.Buttons_Reset}" />
</Grid>
</controls:SettingsCard>
</StackPanel>
</ScrollViewer>
</abstract:EditAccountDetailsPageAbstract>