mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Fix Clock Right margin
- Style Cleanup
This commit is contained in:
parent
d90b82a3ef
commit
7c8d45d2f0
2 changed files with 27 additions and 35 deletions
|
|
@ -505,7 +505,7 @@ namespace Flow.Launcher
|
||||||
windowsb?.Stop(FlowMainWindow);
|
windowsb?.Stop(FlowMainWindow);
|
||||||
|
|
||||||
// UI 요소 상태 초기화
|
// UI 요소 상태 초기화
|
||||||
ClockPanel.Margin = new Thickness(0, 0, ClockPanel.Margin.Right, 0);
|
//ClockPanel.Margin = new Thickness(0, 0, ClockPanel.Margin.Right, 0);
|
||||||
ClockPanel.Opacity = 0;
|
ClockPanel.Opacity = 0;
|
||||||
SearchIcon.Opacity = 0;
|
SearchIcon.Opacity = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -540,11 +540,10 @@ namespace Flow.Launcher
|
||||||
FillBehavior = FillBehavior.Stop
|
FillBehavior = FillBehavior.Stop
|
||||||
};
|
};
|
||||||
|
|
||||||
// 📌 항상 같은 위치에서 시작하도록 `_originalTop`을 사용
|
|
||||||
var WindowMotion = new DoubleAnimation
|
var WindowMotion = new DoubleAnimation
|
||||||
{
|
{
|
||||||
From = Top, // 원래 위치에서 10px 내려온 후
|
From = Top,
|
||||||
To = Top, // 다시 원래 위치로 이동
|
To = Top,
|
||||||
Duration = TimeSpan.FromMilliseconds(animationLength * 2 / 3),
|
Duration = TimeSpan.FromMilliseconds(animationLength * 2 / 3),
|
||||||
FillBehavior = FillBehavior.Stop
|
FillBehavior = FillBehavior.Stop
|
||||||
};
|
};
|
||||||
|
|
@ -567,9 +566,8 @@ namespace Flow.Launcher
|
||||||
FillBehavior = FillBehavior.HoldEnd
|
FillBehavior = FillBehavior.HoldEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
double TargetIconOpacity = GetOpacityFromStyle(SearchIcon, SearchIcon.Style, 1.0); // 스타일에서 Opacity 가져오기
|
double TargetIconOpacity = GetOpacityFromStyle(SearchIcon, SearchIcon.Style, 1.0);
|
||||||
|
|
||||||
System.Diagnostics.Debug.WriteLine("스타일에서 가져온 투명도: " + TargetIconOpacity);
|
|
||||||
|
|
||||||
var IconOpacity = new DoubleAnimation
|
var IconOpacity = new DoubleAnimation
|
||||||
{
|
{
|
||||||
|
|
@ -580,17 +578,18 @@ namespace Flow.Launcher
|
||||||
FillBehavior = FillBehavior.HoldEnd
|
FillBehavior = FillBehavior.HoldEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
double right = ClockPanel.Margin.Right;
|
const double DefaultRightMargin = 66; //* this value from base.xaml
|
||||||
|
double rightMargin = GetThicknessFromStyle(ClockPanel, ClockPanel.Style, new Thickness(0, 0, DefaultRightMargin, 0)).Right;
|
||||||
|
|
||||||
var thicknessAnimation = new ThicknessAnimation
|
var thicknessAnimation = new ThicknessAnimation
|
||||||
{
|
{
|
||||||
From = new Thickness(0, 12, right, 0),
|
From = new Thickness(0, 12, rightMargin, 0),
|
||||||
To = new Thickness(0, 0, right, 0),
|
To = new Thickness(0, 0, rightMargin, 0),
|
||||||
EasingFunction = easing,
|
EasingFunction = easing,
|
||||||
Duration = TimeSpan.FromMilliseconds(animationLength),
|
Duration = TimeSpan.FromMilliseconds(animationLength),
|
||||||
FillBehavior = FillBehavior.HoldEnd
|
FillBehavior = FillBehavior.HoldEnd
|
||||||
};
|
};
|
||||||
|
|
||||||
// 애니메이션 타겟 설정
|
|
||||||
Storyboard.SetTargetProperty(ClockOpacity, new PropertyPath(OpacityProperty));
|
Storyboard.SetTargetProperty(ClockOpacity, new PropertyPath(OpacityProperty));
|
||||||
Storyboard.SetTarget(ClockOpacity, ClockPanel);
|
Storyboard.SetTarget(ClockOpacity, ClockPanel);
|
||||||
|
|
||||||
|
|
@ -609,7 +608,6 @@ namespace Flow.Launcher
|
||||||
Storyboard.SetTarget(IconOpacity, SearchIcon);
|
Storyboard.SetTarget(IconOpacity, SearchIcon);
|
||||||
Storyboard.SetTargetProperty(IconOpacity, new PropertyPath(OpacityProperty));
|
Storyboard.SetTargetProperty(IconOpacity, new PropertyPath(OpacityProperty));
|
||||||
|
|
||||||
// 스토리보드에 애니메이션 추가
|
|
||||||
clocksb.Children.Add(thicknessAnimation);
|
clocksb.Children.Add(thicknessAnimation);
|
||||||
clocksb.Children.Add(ClockOpacity);
|
clocksb.Children.Add(ClockOpacity);
|
||||||
windowsb.Children.Add(WindowOpacity);
|
windowsb.Children.Add(WindowOpacity);
|
||||||
|
|
@ -646,6 +644,23 @@ namespace Flow.Launcher
|
||||||
return defaultOpacity;
|
return defaultOpacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Thickness GetThicknessFromStyle(UIElement element, Style style, Thickness defaultThickness)
|
||||||
|
{
|
||||||
|
if (style == null)
|
||||||
|
return defaultThickness;
|
||||||
|
|
||||||
|
foreach (Setter setter in style.Setters)
|
||||||
|
{
|
||||||
|
if (setter.Property == FrameworkElement.MarginProperty)
|
||||||
|
{
|
||||||
|
return setter.Value is Thickness thickness ? thickness : defaultThickness;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultThickness;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private bool _isClockPanelAnimating = false; // 애니메이션 실행 중인지 여부
|
private bool _isClockPanelAnimating = false; // 애니메이션 실행 중인지 여부
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,29 +165,6 @@
|
||||||
BasedOn="{StaticResource BaseClockPanel}"
|
BasedOn="{StaticResource BaseClockPanel}"
|
||||||
TargetType="{x:Type StackPanel}">
|
TargetType="{x:Type StackPanel}">
|
||||||
<Setter Property="Orientation" Value="Vertical" />
|
<Setter Property="Orientation" Value="Vertical" />
|
||||||
<!--<Setter Property="Visibility" Value="Collapsed" />
|
|
||||||
<Style.Triggers>
|
|
||||||
<MultiDataTrigger>
|
|
||||||
<MultiDataTrigger.Conditions>
|
|
||||||
<Condition Binding="{Binding ElementName=QueryTextBox, UpdateSourceTrigger=PropertyChanged, Path=Text.Length}" Value="0" />
|
|
||||||
<Condition Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Collapsed" />
|
|
||||||
<Condition Binding="{Binding ElementName=History, Path=Visibility}" Value="Collapsed" />
|
|
||||||
</MultiDataTrigger.Conditions>
|
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
|
||||||
<MultiDataTrigger.EnterActions>
|
|
||||||
<BeginStoryboard>
|
|
||||||
<Storyboard>
|
|
||||||
<DoubleAnimation
|
|
||||||
Storyboard.TargetProperty="Opacity"
|
|
||||||
From="0.0"
|
|
||||||
To="1"
|
|
||||||
Duration="0:0:0.25" />
|
|
||||||
</Storyboard>
|
|
||||||
</BeginStoryboard>
|
|
||||||
</MultiDataTrigger.EnterActions>
|
|
||||||
</MultiDataTrigger>
|
|
||||||
</Style.Triggers>-->
|
|
||||||
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Item Style -->
|
<!-- Item Style -->
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue