Revert "- Add clock in query bar (sublime theme only)"

This reverts commit c74a2dbc70.
This commit is contained in:
Dobin Park 2021-10-07 00:38:00 +09:00
parent c74a2dbc70
commit 763cab824b
5 changed files with 3 additions and 95 deletions

View file

@ -96,10 +96,6 @@
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
<StackPanel x:Name="ClockPanel" Style="{DynamicResource ClockPanel}">
<TextBlock x:Name="ClockBox" Style="{DynamicResource ClockBox}"></TextBlock>
<TextBlock x:Name="DateBox" Style="{DynamicResource DateBox}"></TextBlock>
</StackPanel>
<Canvas Style="{DynamicResource SearchIconPosition}">
<Path Data="{DynamicResource SearchIconImg}" Style="{DynamicResource SearchIconStyle}" Margin="0" Stretch="Fill"/>
</Canvas>

View file

@ -11,8 +11,6 @@ using Flow.Launcher.Core.Resource;
using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.ViewModel;
using System.Windows.Threading;
using System.Globalization;
using Application = System.Windows.Application;
using Screen = System.Windows.Forms.Screen;
using ContextMenuStrip = System.Windows.Forms.ContextMenuStrip;
@ -33,6 +31,7 @@ namespace Flow.Launcher
private Settings _settings;
private NotifyIcon _notifyIcon;
private MainViewModel _viewModel;
#endregion
public MainWindow(Settings settings, MainViewModel mainVM)
@ -40,30 +39,14 @@ namespace Flow.Launcher
DataContext = mainVM;
_viewModel = mainVM;
_settings = settings;
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 1);
timer.Tick += Timer_Tick;
timer.Start();
InitializeComponent();
}
public MainWindow()
{
InitializeComponent();
}
private void Timer_Tick(object sender, EventArgs e)
{
ClockBox.Text = System.DateTime.Now.ToString("tt hh:mm");
DateBox.Text = System.DateTime.Now.ToString("ddd MM/dd", CultureInfo.InvariantCulture);
}
private async void OnClosing(object sender, CancelEventArgs e)
{
_notifyIcon.Visible = false;

View file

@ -586,10 +586,7 @@
<Canvas Style="{DynamicResource SearchIconPosition}">
<Path Data="{DynamicResource SearchIconImg}" Style="{DynamicResource SearchIconStyle}" Margin="0" Stretch="Fill"/>
</Canvas>
<StackPanel x:Name="ClockPanel" Style="{DynamicResource ClockPanel}">
<TextBlock x:Name="ClockBox" Style="{DynamicResource ClockBox}"></TextBlock>
<TextBlock x:Name="DateBox" Style="{DynamicResource DateBox}"></TextBlock>
</StackPanel>
<Border Margin="0 0 0 0" Grid.Row="1">
<Rectangle Width="Auto" HorizontalAlignment="Stretch" Style="{DynamicResource SeparatorStyle}" Visibility="visible"/>
</Border>

View file

@ -270,28 +270,6 @@
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style x:Key="BaseClockPanel" TargetType="{x:Type StackPanel}">
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Height" Value="Auto" />
<Setter Property="Margin" Value="0 0 14 0" />
<Setter Property="Visibility" Value="Collapsed" />
</Style>
<Style x:Key="BaseClockBox" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="#8f8f8f" />
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Margin" Value="0 0 0 -5" />
</Style>
<Style x:Key="BaseDateBox" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="#8f8f8f" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Margin" Value="0 0 0 0" />
</Style>
<!--for classic themes-->
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}">
<Setter Property="Fill" Value="#555555" />
@ -315,12 +293,5 @@
<Setter Property="Foreground" Value="#8f8f8f" />
<Setter Property="Opacity" Value="0.5" />
</Style>
<Style x:Key="ClockBox" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseClockBox}">
</Style>
<Style x:Key="DateBox" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseDateBox}">
</Style>
<Style x:Key="ClockPanel" TargetType="{x:Type StackPanel}" BasedOn="{StaticResource BaseClockPanel}">
</Style>
</ResourceDictionary>

View file

@ -59,7 +59,7 @@
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#cc8ec8" />
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#3C454E</SolidColorBrush>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#3c454e</SolidColorBrush>
<Style x:Key="ItemImageSelectedStyle" BasedOn="{StaticResource BaseItemImageSelectedStyle}" TargetType="{x:Type Image}" >
<Setter Property="Cursor" Value="Arrow" />
</Style>
@ -100,44 +100,5 @@
<Setter Property="Fill" Value="#3c454e" />
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Visibility" Value="Collapsed" />
</Style>
<Style x:Key="ClockBox" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseClockBox}">
<Setter Property="Foreground" Value="#cc8ec8" />
</Style>
<Style x:Key="DateBox" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseDateBox}">
<Setter Property="Foreground" Value="#cc8ec8" />
</Style>
<Style x:Key="ClockPanel" TargetType="{x:Type StackPanel}" BasedOn="{StaticResource BaseClockPanel}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=QueryTextBox, UpdateSourceTrigger=PropertyChanged, Path=Text.Length}" Value="0">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetProperty="Opacity"
From="0.0" To="1.0" Duration="0:0:0.2"
/>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetProperty="Opacity"
From="1.0" To="0.0" Duration="0:0:0.2"
/>
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>