Skip to content

Commit a8bdb34

Browse files
committed
- Adjust Clock Color
- Adjust Layout - Add Clock/Date in Settings (data only)
1 parent 5c2a885 commit a8bdb34

File tree

4 files changed

+30
-14
lines changed

4 files changed

+30
-14
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
44
using System.Drawing;
@@ -41,6 +41,8 @@ public string Language
4141
public bool UseGlyphIcons { get; set; } = true;
4242
public bool UseAnimation { get; set; } = true;
4343
public bool UseSound { get; set; } = true;
44+
public bool UseClock { get; set; } = true;
45+
public bool UseDate { get; set; } = true;
4446
public bool FirstLaunch { get; set; } = true;
4547

4648
public int CustomExplorerIndex { get; set; } = 0;
@@ -220,4 +222,4 @@ public enum ColorSchemes
220222
Light,
221223
Dark
222224
}
223-
}
225+
}

Flow.Launcher/MainWindow.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@
193193
</TextBox.ContextMenu>
194194
</TextBox>
195195
<StackPanel x:Name="ClockPanel" Style="{DynamicResource ClockPanel}">
196-
<TextBlock x:Name="ClockBox" Style="{DynamicResource ClockBox}" />
197196
<TextBlock x:Name="DateBox" Style="{DynamicResource DateBox}" />
197+
<TextBlock x:Name="ClockBox" Style="{DynamicResource ClockBox}" />
198+
198199
</StackPanel>
199200
<Canvas Style="{DynamicResource SearchIconPosition}">
200201
<Image

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,23 @@ public MainWindow()
6363
}
6464
private void Timer_Tick(object sender, EventArgs e)
6565
{
66-
ClockBox.Text = System.DateTime.Now.ToString("tt hh:mm");
67-
DateBox.Text = System.DateTime.Now.ToString("MM/dd dddd");
66+
if (_settings.UseClock == true)
67+
{
68+
ClockBox.Text = System.DateTime.Now.ToString("tt hh:mm");
69+
}
70+
else if(_settings.UseClock == false)
71+
{
72+
ClockBox.Visibility = Visibility.Collapsed;
73+
}
74+
if (_settings.UseDate == false)
75+
{
76+
DateBox.Text = System.DateTime.Now.ToString("MM/dd ddd");
77+
}
78+
else if (_settings.UseDate == true)
79+
{
80+
DateBox.Visibility = Visibility.Collapsed;
81+
}
82+
6883

6984
}
7085
private void OnCopy(object sender, ExecutedRoutedEventArgs e)

Flow.Launcher/Themes/Base.xaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
</Style>
8181

8282
<Style x:Key="BaseClockPanel" TargetType="{x:Type StackPanel}">
83+
<Setter Property="Orientation" Value="Horizontal" />
8384
<Setter Property="HorizontalAlignment" Value="Right" />
8485
<Setter Property="VerticalAlignment" Value="Center" />
8586
<Setter Property="Height" Value="Auto" />
@@ -89,35 +90,33 @@
8990
<Style x:Key="BaseClockBox" TargetType="{x:Type TextBlock}">
9091
<Setter Property="FontSize" Value="20" />
9192
<Setter Property="Foreground" Value="#8f8f8f" />
92-
<Setter Property="VerticalAlignment" Value="Bottom" />
93-
<Setter Property="HorizontalAlignment" Value="Right" />
94-
<Setter Property="Margin" Value="0,0,0,-5" />
93+
<Setter Property="VerticalAlignment" Value="Center" />
94+
<Setter Property="Margin" Value="10,0,0,0" />
9595
</Style>
9696
<Style x:Key="BaseDateBox" TargetType="{x:Type TextBlock}">
9797
<Setter Property="FontSize" Value="14" />
9898
<Setter Property="Foreground" Value="#8f8f8f" />
99-
<Setter Property="VerticalAlignment" Value="Top" />
100-
<Setter Property="HorizontalAlignment" Value="Right" />
99+
<Setter Property="VerticalAlignment" Value="Center" />
101100
<Setter Property="Margin" Value="0,0,0,0" />
102101
</Style>
103102

104103
<Style
105104
x:Key="ClockBox"
106105
BasedOn="{StaticResource BaseClockBox}"
107106
TargetType="{x:Type TextBlock}">
108-
<Setter Property="Foreground" Value="#cc8ec8" />
107+
<Setter Property="Foreground" Value="#8f8f8f" />
109108
</Style>
110109
<Style
111110
x:Key="DateBox"
112111
BasedOn="{StaticResource BaseDateBox}"
113112
TargetType="{x:Type TextBlock}">
114-
<Setter Property="Foreground" Value="#cc8ec8" />
113+
<Setter Property="Foreground" Value="#8f8f8f" />
115114
</Style>
116115
<Style
117116
x:Key="ClockPanel"
118117
BasedOn="{StaticResource BaseClockPanel}"
119118
TargetType="{x:Type StackPanel}">
120-
<Setter Property="Margin" Value="0,0,62,0" />
119+
<Setter Property="Margin" Value="0,0,66,0" />
121120
<Setter Property="Visibility" Value="Visible" />
122121
<Style.Triggers>
123122
<MultiDataTrigger>
@@ -149,7 +148,6 @@
149148
</MultiDataTrigger.ExitActions>
150149

151150
</MultiDataTrigger>
152-
<DataTrigger Binding="{Binding ElementName=QueryTextBox, UpdateSourceTrigger=PropertyChanged, Path=Text.Length}" Value="0" />
153151

154152
</Style.Triggers>
155153

0 commit comments

Comments
 (0)