mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Add Clock/Date in SettingWindow
This commit is contained in:
parent
9dc86fdfb4
commit
d2332abd95
5 changed files with 114 additions and 11 deletions
|
|
@ -42,7 +42,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
||||||
public bool UseAnimation { get; set; } = true;
|
public bool UseAnimation { get; set; } = true;
|
||||||
public bool UseSound { get; set; } = true;
|
public bool UseSound { get; set; } = true;
|
||||||
public bool UseClock { get; set; } = true;
|
public bool UseClock { get; set; } = true;
|
||||||
public bool UseDate { get; set; } = true;
|
public bool UseDate { get; set; } = false;
|
||||||
public bool FirstLaunch { get; set; } = true;
|
public bool FirstLaunch { get; set; } = true;
|
||||||
|
|
||||||
public int CustomExplorerIndex { get; set; } = 0;
|
public int CustomExplorerIndex { get; set; } = 0;
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,8 @@
|
||||||
<system:String x:Key="SoundEffectTip">Play a small sound when the search window opens</system:String>
|
<system:String x:Key="SoundEffectTip">Play a small sound when the search window opens</system:String>
|
||||||
<system:String x:Key="Animation">Animation</system:String>
|
<system:String x:Key="Animation">Animation</system:String>
|
||||||
<system:String x:Key="AnimationTip">Use Animation in UI</system:String>
|
<system:String x:Key="AnimationTip">Use Animation in UI</system:String>
|
||||||
|
<system:String x:Key="Clock">Clock</system:String>
|
||||||
|
<system:String x:Key="Date">Date</system:String>
|
||||||
|
|
||||||
<!-- Setting Hotkey -->
|
<!-- Setting Hotkey -->
|
||||||
<system:String x:Key="hotkey">Hotkey</system:String>
|
<system:String x:Key="hotkey">Hotkey</system:String>
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,29 @@ namespace Flow.Launcher
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClockDisplay()
|
||||||
|
{
|
||||||
|
if (_settings.UseClock == true)
|
||||||
|
{
|
||||||
|
ClockBox.Visibility = Visibility.Visible;
|
||||||
|
ClockBox.Text = System.DateTime.Now.ToString("tt hh:mm");
|
||||||
|
}
|
||||||
|
else if (_settings.UseClock == false)
|
||||||
|
{
|
||||||
|
ClockBox.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
if (_settings.UseDate == true)
|
||||||
|
{
|
||||||
|
DateBox.Visibility = Visibility.Visible;
|
||||||
|
DateBox.Text = System.DateTime.Now.ToString("MM/dd ddd");
|
||||||
|
}
|
||||||
|
else if (_settings.UseDate == false)
|
||||||
|
{
|
||||||
|
DateBox.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private void OnCopy(object sender, ExecutedRoutedEventArgs e)
|
private void OnCopy(object sender, ExecutedRoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
@ -206,6 +229,12 @@ namespace Flow.Launcher
|
||||||
case nameof(Settings.Hotkey):
|
case nameof(Settings.Hotkey):
|
||||||
UpdateNotifyIconText();
|
UpdateNotifyIconText();
|
||||||
break;
|
break;
|
||||||
|
case nameof(Settings.UseClock):
|
||||||
|
ClockDisplay();
|
||||||
|
break;
|
||||||
|
case nameof(Settings.UseDate):
|
||||||
|
ClockDisplay();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -378,7 +407,6 @@ namespace Flow.Launcher
|
||||||
_settings.WindowLeft = Left;
|
_settings.WindowLeft = Left;
|
||||||
_settings.WindowTop = Top;
|
_settings.WindowTop = Top;
|
||||||
iconsb.Begin(SearchIcon);
|
iconsb.Begin(SearchIcon);
|
||||||
iconsb.Begin(ClockPanel);
|
|
||||||
sb.Begin(FlowMainWindow);
|
sb.Begin(FlowMainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -597,9 +597,7 @@
|
||||||
<StackPanel Style="{StaticResource TextPanel}">
|
<StackPanel Style="{StaticResource TextPanel}">
|
||||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
|
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<CheckBox
|
<CheckBox IsChecked="{Binding StartFlowLauncherOnSystemStartup}" Style="{DynamicResource SideControlCheckBox}" />
|
||||||
IsChecked="{Binding StartFlowLauncherOnSystemStartup}"
|
|
||||||
Style="{DynamicResource SideControlCheckBox}" />
|
|
||||||
<TextBlock Style="{StaticResource Glyph}">
|
<TextBlock Style="{StaticResource Glyph}">
|
||||||

|

|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
@ -1555,8 +1553,17 @@
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Style="{DynamicResource QueryBoxStyle}"
|
Style="{DynamicResource QueryBoxStyle}"
|
||||||
Text="{DynamicResource hiThere}" />
|
Text="{DynamicResource hiThere}" />
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
|
<StackPanel x:Name="ClockPanel" Style="{DynamicResource ClockPanel}">
|
||||||
|
<TextBlock
|
||||||
|
x:Name="DateBox"
|
||||||
|
Style="{DynamicResource DateBox}"
|
||||||
|
Text="09-01 Thu" />
|
||||||
|
<TextBlock
|
||||||
|
x:Name="ClockBox"
|
||||||
|
Style="{DynamicResource ClockBox}"
|
||||||
|
Text="PM 12:04" />
|
||||||
|
</StackPanel>
|
||||||
<Canvas Style="{DynamicResource SearchIconPosition}">
|
<Canvas Style="{DynamicResource SearchIconPosition}">
|
||||||
<Path
|
<Path
|
||||||
Margin="0"
|
Margin="0"
|
||||||
|
|
@ -1792,9 +1799,9 @@
|
||||||
Margin="20,0,0,0"
|
Margin="20,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
IsSynchronizedWithCurrentItem="False"
|
||||||
ItemsSource="{Binding Source={StaticResource SortedFonts}}"
|
ItemsSource="{Binding Source={StaticResource SortedFonts}}"
|
||||||
SelectedItem="{Binding SelectedQueryBoxFont}"
|
SelectedItem="{Binding SelectedQueryBoxFont}" />
|
||||||
IsSynchronizedWithCurrentItem="False" />
|
|
||||||
<ComboBox
|
<ComboBox
|
||||||
Width="130"
|
Width="130"
|
||||||
Margin="10,0,0,0"
|
Margin="10,0,0,0"
|
||||||
|
|
@ -1843,9 +1850,9 @@
|
||||||
Margin="20,-2,0,0"
|
Margin="20,-2,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
IsSynchronizedWithCurrentItem="False"
|
||||||
ItemsSource="{Binding Source={StaticResource SortedFonts}}"
|
ItemsSource="{Binding Source={StaticResource SortedFonts}}"
|
||||||
SelectedItem="{Binding SelectedResultFont}"
|
SelectedItem="{Binding SelectedResultFont}" />
|
||||||
IsSynchronizedWithCurrentItem="False" />
|
|
||||||
<ComboBox
|
<ComboBox
|
||||||
Width="130"
|
Width="130"
|
||||||
Margin="10,-2,0,0"
|
Margin="10,-2,0,0"
|
||||||
|
|
@ -1877,7 +1884,60 @@
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
Margin="0,30,0,0"
|
Margin="0,24,0,12"
|
||||||
|
Padding="0"
|
||||||
|
CornerRadius="5"
|
||||||
|
Style="{DynamicResource SettingGroupBox}">
|
||||||
|
<StackPanel Orientation="Vertical">
|
||||||
|
<Border
|
||||||
|
Margin="0"
|
||||||
|
BorderThickness="0"
|
||||||
|
Style="{DynamicResource SettingGroupBox}">
|
||||||
|
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||||
|
<StackPanel Style="{StaticResource TextPanel}">
|
||||||
|
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource Clock}" />
|
||||||
|
</StackPanel>
|
||||||
|
<ui:ToggleSwitch
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="2"
|
||||||
|
IsOn="{Binding UseClock, Mode=TwoWay}"
|
||||||
|
OffContent="{DynamicResource disable}"
|
||||||
|
OnContent="{DynamicResource enable}"
|
||||||
|
Style="{DynamicResource SideToggleSwitch}" />
|
||||||
|
<TextBlock Style="{StaticResource Glyph}">
|
||||||
|

|
||||||
|
</TextBlock>
|
||||||
|
</ItemsControl>
|
||||||
|
</Border>
|
||||||
|
<Separator
|
||||||
|
Width="Auto"
|
||||||
|
BorderThickness="1"
|
||||||
|
Style="{StaticResource SettingSeparatorStyle}" />
|
||||||
|
<Border
|
||||||
|
Margin="0"
|
||||||
|
BorderThickness="0"
|
||||||
|
Style="{DynamicResource SettingGroupBox}">
|
||||||
|
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||||
|
<StackPanel Style="{StaticResource TextPanel}">
|
||||||
|
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource Date}" />
|
||||||
|
</StackPanel>
|
||||||
|
<ui:ToggleSwitch
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="2"
|
||||||
|
IsOn="{Binding UseDate, Mode=TwoWay}"
|
||||||
|
OffContent="{DynamicResource disable}"
|
||||||
|
OnContent="{DynamicResource enable}"
|
||||||
|
Style="{DynamicResource SideToggleSwitch}" />
|
||||||
|
<TextBlock Style="{StaticResource Glyph}">
|
||||||
|

|
||||||
|
</TextBlock>
|
||||||
|
</ItemsControl>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Margin="0,12,0,12"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
CornerRadius="5"
|
CornerRadius="5"
|
||||||
Style="{DynamicResource SettingGroupBox}">
|
Style="{DynamicResource SettingGroupBox}">
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,19 @@ namespace Flow.Launcher.ViewModel
|
||||||
set => Settings.UseSound = value;
|
set => Settings.UseSound = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool UseClock
|
||||||
|
{
|
||||||
|
get => Settings.UseClock;
|
||||||
|
set => Settings.UseClock = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool UseDate
|
||||||
|
{
|
||||||
|
get => Settings.UseDate;
|
||||||
|
set => Settings.UseDate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Brush PreviewBackground
|
public Brush PreviewBackground
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue