Skip to content

Commit 51dc613

Browse files
revert displaying current time in date/time format dropdown
1 parent 4940449 commit 51dc613

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
4545
<converters:TextConverter x:Key="TextConverter" />
4646
<converters:TranlationConverter x:Key="TranlationConverter" />
47-
<converters:DateTimeFormatToNowConverter x:Key="DateTimeFormatToNowConverter"></converters:DateTimeFormatToNowConverter>
4847
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}">
4948
<CollectionViewSource.SortDescriptions>
5049
<scm:SortDescription PropertyName="Source" />
@@ -2181,12 +2180,7 @@
21812180
VerticalAlignment="Center"
21822181
FontSize="14"
21832182
ItemsSource="{Binding TimeFormatList}"
2184-
SelectedIndex="{Binding TimeFormat}">
2185-
<ItemsControl.ItemTemplate>
2186-
<DataTemplate>
2187-
<TextBlock Text="{Binding Converter={StaticResource DateTimeFormatToNowConverter}}"/>
2188-
</DataTemplate>
2189-
</ItemsControl.ItemTemplate>
2183+
SelectedItem="{Binding TimeFormat}">
21902184
</ComboBox>
21912185
<ui:ToggleSwitch
21922186
IsOn="{Binding UseClock, Mode=TwoWay}"
@@ -2223,12 +2217,7 @@
22232217
VerticalAlignment="Center"
22242218
FontSize="14"
22252219
ItemsSource="{Binding DateFormatList}"
2226-
SelectedIndex="{Binding DateFormat}">
2227-
<ItemsControl.ItemTemplate>
2228-
<DataTemplate>
2229-
<TextBlock Text="{Binding Converter={StaticResource DateTimeFormatToNowConverter}}"/>
2230-
</DataTemplate>
2231-
</ItemsControl.ItemTemplate>
2220+
SelectedItem="{Binding DateFormat}">
22322221
</ComboBox>
22332222
<ui:ToggleSwitch
22342223
IsOn="{Binding UseDate, Mode=TwoWay}"

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ public SettingWindowViewModel(Updater updater, IPortable portable)
4747
case nameof(Settings.WindowSize):
4848
OnPropertyChanged(nameof(WindowWidthSize));
4949
break;
50+
case nameof(Settings.UseDate):
51+
case nameof(Settings.DateFormat):
52+
OnPropertyChanged(nameof(DateText));
53+
break;
54+
case nameof(Settings.UseClock):
55+
case nameof(Settings.TimeFormat):
56+
OnPropertyChanged(nameof(ClockText));
57+
break;
5058
}
5159
};
5260
}
@@ -483,26 +491,18 @@ public List<SearchWindowPosition> SearchWindowPositions
483491
public string TimeFormat
484492
{
485493
get { return Settings.TimeFormat; }
486-
set
487-
{
488-
Settings.TimeFormat = value;
489-
OnPropertyChanged();
490-
}
494+
set { Settings.TimeFormat = value; }
491495
}
492496

493497
public string DateFormat
494498
{
495499
get { return Settings.DateFormat; }
496-
set
497-
{
498-
Settings.DateFormat = value;
499-
OnPropertyChanged();
500-
}
500+
set { Settings.DateFormat = value; }
501501
}
502502

503-
public string ClockText { get; private set; }
503+
public string ClockText => DateTime.Now.ToString(TimeFormat);
504504

505-
public string DateText { get; private set; }
505+
public string DateText => DateTime.Now.ToString(DateFormat);
506506

507507

508508
public double WindowWidthSize

0 commit comments

Comments
 (0)