mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix Search Icon Opacity
This commit is contained in:
parent
1b22d9cdfb
commit
2710de1fbc
2 changed files with 45 additions and 2 deletions
|
|
@ -566,11 +566,14 @@ namespace Flow.Launcher
|
|||
FillBehavior = FillBehavior.HoldEnd
|
||||
};
|
||||
|
||||
double TargetIconOpacity = SearchIcon.Opacity;
|
||||
double TargetIconOpacity = GetOpacityFromStyle(SearchIcon, SearchIcon.Style, 1.0); // 스타일에서 Opacity 가져오기
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("스타일에서 가져온 투명도: " + TargetIconOpacity);
|
||||
|
||||
var IconOpacity = new DoubleAnimation
|
||||
{
|
||||
From = 0,
|
||||
To = 1,
|
||||
To = TargetIconOpacity,
|
||||
EasingFunction = easing,
|
||||
Duration = TimeSpan.FromMilliseconds(animationLength),
|
||||
FillBehavior = FillBehavior.HoldEnd
|
||||
|
|
@ -626,6 +629,23 @@ namespace Flow.Launcher
|
|||
windowsb.Begin(FlowMainWindow);
|
||||
}
|
||||
|
||||
private double GetOpacityFromStyle(UIElement element, Style style, double defaultOpacity = 1.0)
|
||||
{
|
||||
if (style == null)
|
||||
return defaultOpacity;
|
||||
|
||||
foreach (Setter setter in style.Setters)
|
||||
{
|
||||
if (setter.Property == UIElement.OpacityProperty)
|
||||
{
|
||||
return setter.Value is double opacity ? opacity : defaultOpacity;
|
||||
}
|
||||
}
|
||||
|
||||
return defaultOpacity;
|
||||
}
|
||||
|
||||
|
||||
private bool _isClockPanelAnimating = false; // 애니메이션 실행 중인지 여부
|
||||
|
||||
private void UpdateClockPanelVisibility()
|
||||
|
|
|
|||
|
|
@ -165,6 +165,29 @@
|
|||
BasedOn="{StaticResource BaseClockPanel}"
|
||||
TargetType="{x:Type StackPanel}">
|
||||
<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>
|
||||
|
||||
<!-- Item Style -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue