Skip to content

Commit d852be9

Browse files
committed
Remove clock
1 parent 541374e commit d852be9

File tree

12 files changed

+2
-222
lines changed

12 files changed

+2
-222
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ public string Theme
131131
public bool ShowBadges { get; set; } = false;
132132
public bool ShowBadgesGlobalOnly { get; set; } = false;
133133

134-
public bool UseClock { get; set; } = true;
135-
public string TimeFormat { get; set; } = "hh:mm tt";
136134
public bool FirstLaunch { get; set; } = true;
137135

138136
public double SettingWindowWidth { get; set; } = 1000;

Flow.Launcher/Languages/en.xaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@
188188
<system:String x:Key="ColorSchemeSystem">System Default</system:String>
189189
<system:String x:Key="ColorSchemeLight">Light</system:String>
190190
<system:String x:Key="ColorSchemeDark">Dark</system:String>
191-
<system:String x:Key="Clock">Clock</system:String>
192-
<system:String x:Key="Date">Date</system:String>
193191
<system:String x:Key="TypeIsDarkToolTip">This theme supports two (light/dark) modes.</system:String>
194192
<system:String x:Key="KeepMaxResults">Fixed Window Size</system:String>
195193
<system:String x:Key="KeepMaxResultsToolTip">The window size is not adjustable by dragging.</system:String>

Flow.Launcher/MainWindow.xaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,18 +271,6 @@
271271
</Grid>
272272
</Border>
273273

274-
<StackPanel
275-
x:Name="ClockPanel"
276-
IsHitTestVisible="False"
277-
Opacity="{Binding ClockPanelOpacity}"
278-
Style="{DynamicResource ClockPanel}"
279-
Visibility="{Binding ClockPanelVisibility}">
280-
<TextBlock
281-
x:Name="ClockBox"
282-
Style="{DynamicResource ClockBox}"
283-
Text="{Binding ClockText}"
284-
Visibility="{Binding Settings.UseClock, Converter={StaticResource BoolToVisibilityConverter}}" />
285-
</StackPanel>
286274
<Border>
287275
<Grid WindowChrome.IsHitTestVisibleInChrome="True">
288276
<Image

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,6 @@ private void OnLoaded(object sender, RoutedEventArgs _)
258258
}
259259
};
260260

261-
// QueryTextBox.Text change detection (modified to only work when character count is 1 or higher)
262-
QueryTextBox.TextChanged += (s, e) => UpdateClockPanelVisibility();
263-
264-
// Detecting ResultContextMenu.Visibility changes
265-
DependencyPropertyDescriptor
266-
.FromProperty(VisibilityProperty, typeof(ResultListBox))
267-
.AddValueChanged(ResultContextMenu, (s, e) => UpdateClockPanelVisibility());
268-
269261
// Initialize query state
270262
if (_settings.ShowHomePage && string.IsNullOrEmpty(_viewModel.QueryText))
271263
{
@@ -317,7 +309,6 @@ private void OnDeactivated(object sender, EventArgs e)
317309
_settings.WindowLeft = Left;
318310
_settings.WindowTop = Top;
319311

320-
_viewModel.ClockPanelOpacity = 0.0;
321312
_viewModel.SearchIconOpacity = 0.0;
322313

323314
// This condition stops extra hide call when animator is on,
@@ -903,46 +894,6 @@ private void InitProgressbarAnimation()
903894

904895
_viewModel.ProgressBarVisibility = Visibility.Hidden;
905896
}
906-
907-
private void UpdateClockPanelVisibility()
908-
{
909-
if (QueryTextBox == null || ResultContextMenu == null || ClockPanel == null)
910-
{
911-
return;
912-
}
913-
914-
// ✅ Conditions for showing ClockPanel (No query input / ResultContextMenu is closed)
915-
var shouldShowClock = QueryTextBox.Text.Length == 0 &&
916-
ResultContextMenu.Visibility != Visibility.Visible;
917-
918-
// ✅ 1. When ResultContextMenu opens, immediately set Visibility.Hidden (force hide without animation)
919-
if (ResultContextMenu.Visibility == Visibility.Visible)
920-
{
921-
_viewModel.ClockPanelVisibility = Visibility.Hidden;
922-
_viewModel.ClockPanelOpacity = 0.0; // Set to 0 in case Opacity animation affects it
923-
return;
924-
}
925-
926-
// ✅ 2. When ResultContextMenu is closed, keep it Hidden if there's text in the query (remember previous state)
927-
else if (QueryTextBox.Text.Length > 0)
928-
{
929-
_viewModel.ClockPanelVisibility = Visibility.Hidden;
930-
_viewModel.ClockPanelOpacity = 0.0;
931-
return;
932-
}
933-
934-
// ✅ 3. Hide ClockPanel
935-
if ((!shouldShowClock) && _viewModel.ClockPanelVisibility == Visibility.Visible)
936-
{
937-
_viewModel.ClockPanelVisibility = Visibility.Hidden;
938-
}
939-
940-
// ✅ 4. Show ClockPanel
941-
else if (shouldShowClock && _viewModel.ClockPanelVisibility != Visibility.Visible)
942-
{
943-
_viewModel.ClockPanelVisibility = Visibility.Visible;
944-
}
945-
}
946897
#endregion
947898

948899
#region QueryTextBox Event

Flow.Launcher/Resources/Dark.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<SolidColorBrush x:Key="InlineHighlight" Color="#0078d7" />
1818
<SolidColorBrush x:Key="HotkeyForeground" Color="#33FFFFFF" />
1919
<SolidColorBrush x:Key="HotkeySelectedForeground" Color="#33FFFFFF" />
20-
<SolidColorBrush x:Key="ClockDateForeground" Color="#26FFFFFF" />
2120
<Color x:Key="ItemSelectedBackgroundColorBrush">#198F8F8F</Color>
2221

2322
<SolidColorBrush x:Key="BasicSystemAccentColor" Color="{m:DynamicColor SystemAccentColorLight1}" />

Flow.Launcher/Resources/Light.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<SolidColorBrush x:Key="InlineHighlight" Color="#0078d7" />
1818
<SolidColorBrush x:Key="HotkeyForeground" Color="#51000000" />
1919
<SolidColorBrush x:Key="HotkeySelectedForeground" Color="#51000000" />
20-
<SolidColorBrush x:Key="ClockDateForeground" Color="#44000000" />
2120
<Color x:Key="ItemSelectedBackgroundColorBrush">#7EFFFFFF</Color>
2221

2322
<SolidColorBrush x:Key="BasicSystemAccentColor" Color="{m:DynamicColor SystemAccentColor}" />

Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,6 @@ public string ColorScheme
117117
}
118118
}
119119

120-
public List<string> TimeFormatList { get; } = new()
121-
{
122-
"h:mm",
123-
"hh:mm",
124-
"H:mm",
125-
"HH:mm",
126-
"tt h:mm",
127-
"tt hh:mm",
128-
"h:mm tt",
129-
"hh:mm tt",
130-
"hh:mm:ss tt",
131-
"HH:mm:ss"
132-
};
133-
134-
public string TimeFormat
135-
{
136-
get => Settings.TimeFormat;
137-
set => Settings.TimeFormat = value;
138-
}
139-
140120
public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16);
141121

142122
public bool KeepMaxResults
@@ -145,22 +125,12 @@ public bool KeepMaxResults
145125
set => Settings.KeepMaxResults = value;
146126
}
147127

148-
public string ClockText => DateTime.Now.ToString(TimeFormat, CultureInfo.CurrentUICulture);
149-
150128
public bool UseGlyphIcons
151129
{
152130
get => Settings.UseGlyphIcons;
153131
set => Settings.UseGlyphIcons = value;
154132
}
155133

156-
public bool UseClock
157-
{
158-
get => Settings.UseClock;
159-
set => Settings.UseClock = value;
160-
}
161-
162-
public FontFamily ClockPanelFont { get; }
163-
164134
public ResultsViewModel PreviewResults { get; }
165135

166136
public FontFamily SelectedQueryBoxFont
@@ -303,7 +273,6 @@ public SettingsPaneThemeViewModel(Settings settings, Theme theme)
303273
{
304274
Settings = settings;
305275
_theme = theme;
306-
ClockPanelFont = new FontFamily(DefaultFont);
307276
var results = new List<Result>
308277
{
309278
new()

Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -334,19 +334,6 @@
334334
Style="{DynamicResource QueryBoxStyle}"
335335
Text="{DynamicResource hiThere}" />
336336
</Border>
337-
<StackPanel
338-
x:Name="ClockPanel"
339-
IsHitTestVisible="False"
340-
Style="{DynamicResource ClockPanel}"
341-
Visibility="Visible">
342-
<!-- Because this textblock follows SettingWindowFont, we need to revert its font family explictly -->
343-
<TextBlock
344-
x:Name="ClockBox"
345-
FontFamily="{Binding ClockPanelFont, Mode=OneTime}"
346-
Style="{DynamicResource ClockBox}"
347-
Text="{Binding ClockText}"
348-
Visibility="{Binding UseClock, Converter={StaticResource BoolToVisibilityConverter}}" />
349-
</StackPanel>
350337
<Canvas Style="{DynamicResource SearchIconPosition}">
351338
<Path
352339
Margin="0"
@@ -495,33 +482,6 @@
495482
</cc:Card>
496483
</cc:ExCard>
497484

498-
<!-- Time and date -->
499-
<cc:CardGroup Margin="0 14 0 0">
500-
<cc:Card
501-
Title="{DynamicResource Clock}"
502-
Icon="&#xec92;"
503-
Type="First">
504-
<StackPanel Orientation="Horizontal">
505-
<TextBlock
506-
VerticalAlignment="Center"
507-
FontSize="14"
508-
Foreground="{DynamicResource Color04B}"
509-
Text="{Binding ClockText}" />
510-
<ComboBox
511-
MinWidth="180"
512-
Margin="10 0 18 0"
513-
VerticalAlignment="Center"
514-
FontSize="14"
515-
ItemsSource="{Binding TimeFormatList}"
516-
SelectedItem="{Binding TimeFormat}" />
517-
<ui:ToggleSwitch
518-
IsOn="{Binding UseClock}"
519-
OffContent="{DynamicResource disable}"
520-
OnContent="{DynamicResource enable}" />
521-
</StackPanel>
522-
</cc:Card>
523-
</cc:CardGroup>
524-
525485
<!-- Fonts and icons -->
526486
<cc:Card
527487
Title="{DynamicResource useGlyphUI}"

Flow.Launcher/Themes/Base.xaml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -113,38 +113,6 @@
113113
BasedOn="{StaticResource BasePendingLineStyle}"
114114
TargetType="{x:Type Line}" />
115115

116-
<Style x:Key="BaseClockPanelPosition" TargetType="{x:Type Canvas}" />
117-
118-
<Style x:Key="BaseClockPanel" TargetType="{x:Type StackPanel}">
119-
<Setter Property="Orientation" Value="Horizontal" />
120-
<Setter Property="HorizontalAlignment" Value="Right" />
121-
<Setter Property="VerticalAlignment" Value="Center" />
122-
<Setter Property="Height" Value="Auto" />
123-
<Setter Property="Margin" Value="0 0 66 0" />
124-
<Setter Property="Visibility" Value="Collapsed" />
125-
</Style>
126-
<Style x:Key="BaseClockBox" TargetType="{x:Type TextBlock}">
127-
<Setter Property="FontSize" Value="20" />
128-
<Setter Property="Padding" Value="0" />
129-
<Setter Property="Foreground" Value="#8f8f8f" />
130-
<Setter Property="HorizontalAlignment" Value="Right" />
131-
<Setter Property="VerticalAlignment" Value="Center" />
132-
<Setter Property="Margin" Value="0 0 0 3" />
133-
</Style>
134-
135-
<Style
136-
x:Key="ClockBox"
137-
BasedOn="{StaticResource BaseClockBox}"
138-
TargetType="{x:Type TextBlock}">
139-
<Setter Property="Foreground" Value="#C6C6C6" />
140-
</Style>
141-
<Style
142-
x:Key="ClockPanel"
143-
BasedOn="{StaticResource BaseClockPanel}"
144-
TargetType="{x:Type StackPanel}">
145-
<Setter Property="Orientation" Value="Vertical" />
146-
</Style>
147-
148116
<!-- Item Style -->
149117
<Style x:Key="ProgressBarResult" TargetType="{x:Type ProgressBar}">
150118
<Setter Property="Height" Value="18" />
@@ -491,12 +459,6 @@
491459
<Setter Property="Background" Value="Transparent" />
492460
<Setter Property="HorizontalAlignment" Value="Right" />
493461
</Style>
494-
<Style
495-
x:Key="ClockPanelPosition"
496-
BasedOn="{StaticResource BaseClockPanelPosition}"
497-
TargetType="{x:Type Canvas}">
498-
<Setter Property="Margin" Value="0 0 66 0" />
499-
</Style>
500462
<Style
501463
x:Key="ItemHotkeyStyle"
502464
BasedOn="{StaticResource BaseItemHotkeyStyle}"

Flow.Launcher/Themes/Win10System.xaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,6 @@
178178
<Setter Property="Margin" Value="0 0 16 0" />
179179
<Setter Property="HorizontalAlignment" Value="Right" />
180180
</Style>
181-
<Style
182-
x:Key="ClockBox"
183-
BasedOn="{StaticResource BaseClockBox}"
184-
TargetType="{x:Type TextBlock}">
185-
<Setter Property="Foreground" Value="{DynamicResource SystemControlBackgroundBaseLowBrush}" />
186-
</Style>
187181
<Style
188182
x:Key="PreviewBorderStyle"
189183
BasedOn="{StaticResource BasePreviewBorderStyle}"

0 commit comments

Comments
 (0)