Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Flow.Launcher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding ElementName=ResultListBox, Path=Items.Count}" Value="0" />
<Condition Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Collapsed" />
<Condition Binding="{Binding ElementName=ResultContextMenu, Path=Visibility}" Value="Collapsed" />
<Condition Binding="{Binding ElementName=History, Path=Visibility}" Value="Collapsed" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
Expand All @@ -373,7 +373,7 @@
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Visible">
<DataTrigger Binding="{Binding ElementName=ResultContextMenu, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}" Value="Visible">
Expand Down Expand Up @@ -419,7 +419,7 @@
</ContentControl>
<ContentControl>
<flowlauncher:ResultListBox
x:Name="ContextMenu"
x:Name="ResultContextMenu"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Rename result list instance to ResultContextMenu
This ResultListBox instance has been renamed, aligning with the new naming convention. Please ensure corresponding bindings and any code-behind references in MainWindow.xaml.cs are also updated.

Run this script to verify no residual <ContextMenu> references remain:


🏁 Script executed:

#!/bin/bash
# Search for leftover ContextMenu references
rg -n '<ContextMenu ' .

Length of output: 223


Review leftover <ContextMenu> definitions
The search for <ContextMenu shows remaining definitions in:

  • Flow.Launcher/MainWindow.xaml:262
  • Flow.Launcher/Resources/CustomControlTemplate.xaml:25

Please verify and update as needed:

  • If the <ContextMenu> at MainWindow.xaml:262 is the one for your renamed ResultContextMenu, adjust its x:Name, bindings and any code‐behind references to match.
  • If the TextBoxContextMenu in CustomControlTemplate.xaml is unrelated, you can leave it intact. Otherwise, rename or refactor it to fit the new naming convention.
🧰 Tools
🪛 GitHub Actions: Check Spelling

[warning] 460-31: VSTHRD is not a recognized word. (unrecognized-spelling)


[warning] 475-31: VSTHRD is not a recognized word. (unrecognized-spelling)


[warning] 487-31: VSTHRD is not a recognized word. (unrecognized-spelling)


[warning] 491-27: Wnd is not a recognized word. (unrecognized-spelling)


[warning] 493-27: Wnd is not a recognized word. (unrecognized-spelling)


[warning] 564-30: WMP is not a recognized word. (unrecognized-spelling)


[warning] 566-34: WMP is not a recognized word. (unrecognized-spelling)


[warning] 567-34: WMP is not a recognized word. (unrecognized-spelling)


[warning] 568-34: WMP is not a recognized word. (unrecognized-spelling)


[warning] 648-25: gamemode is not a recognized word. (unrecognized-spelling)


[warning] 649-25: gamemode is not a recognized word. (unrecognized-spelling)


[warning] 652-32: gamemode is not a recognized word. (unrecognized-spelling)


[warning] 655-30: positionreset is not a recognized word. (unrecognized-spelling)


[warning] 658-37: positionreset is not a recognized word. (unrecognized-spelling)


[warning] 674-21: gamemode is not a recognized word. (unrecognized-spelling)


[warning] 675-26: positionreset is not a recognized word. (unrecognized-spelling)


[warning] 680-26: positionreset is not a recognized word. (unrecognized-spelling)


[warning] 790-64: XRatio is not a recognized word. (unrecognized-spelling)


[warning] 791-63: YRatio is not a recognized word. (unrecognized-spelling)


[warning] 1005-20: clocksb is not a recognized word. (unrecognized-spelling)


[warning] 1006-20: clocksb is not a recognized word. (unrecognized-spelling)


[warning] 1007-19: iconsb is not a recognized word. (unrecognized-spelling)


[warning] 1008-19: iconsb is not a recognized word. (unrecognized-spelling)


[warning] 1013-20: clocksb is not a recognized word. (unrecognized-spelling)


[warning] 1014-19: iconsb is not a recognized word. (unrecognized-spelling)

🤖 Prompt for AI Agents
In Flow.Launcher/MainWindow.xaml around lines 262 and 422, the ResultListBox
instance has been renamed to ResultContextMenu, but the corresponding
<ContextMenu> definition at line 262 still uses the old naming. Update the
x:Name and any bindings in the <ContextMenu> at line 262 to match
ResultContextMenu, and ensure all code-behind references in MainWindow.xaml.cs
are updated accordingly. Leave unrelated ContextMenu definitions like
TextBoxContextMenu in Resources/CustomControlTemplate.xaml unchanged.

DataContext="{Binding ContextMenu}"
LeftClickResultCommand="{Binding LeftClickResultCommand}"
RightClickResultCommand="{Binding RightClickResultCommand}" />
Expand Down
20 changes: 10 additions & 10 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
public MainWindow()
{
_settings = Ioc.Default.GetRequiredService<Settings>();
_theme = Ioc.Default.GetRequiredService<Theme>();

Check warning on line 83 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ioc` is not a recognized word. (unrecognized-spelling)
_viewModel = Ioc.Default.GetRequiredService<MainViewModel>();

Check warning on line 84 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ioc` is not a recognized word. (unrecognized-spelling)
DataContext = _viewModel;

InitializeComponent();
Expand All @@ -108,7 +108,7 @@
{
var handle = Win32Helper.GetWindowHandle(this, true);
_hwndSource = HwndSource.FromHwnd(handle);
_hwndSource.AddHook(WndProc);

Check warning on line 111 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
Win32Helper.HideFromAltTab(this);
Win32Helper.DisableControlBox(this);
}
Expand Down Expand Up @@ -295,14 +295,14 @@
// QueryTextBox.Text change detection (modified to only work when character count is 1 or higher)
QueryTextBox.TextChanged += (s, e) => UpdateClockPanelVisibility();

// Detecting ContextMenu.Visibility changes
// Detecting ResultContextMenu.Visibility changes
DependencyPropertyDescriptor
.FromProperty(VisibilityProperty, typeof(ContextMenu))
.AddValueChanged(ContextMenu, (s, e) => UpdateClockPanelVisibility());
.FromProperty(VisibilityProperty, typeof(ResultListBox))
.AddValueChanged(ResultContextMenu, (s, e) => UpdateClockPanelVisibility());

// Detect History.Visibility changes
DependencyPropertyDescriptor
.FromProperty(VisibilityProperty, typeof(StackPanel))
.FromProperty(VisibilityProperty, typeof(ResultListBox))
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The owner type for the History subscription should match the actual control type (e.g., StackPanel or Border) rather than ResultListBox, otherwise the Descriptor may not fire when History.Visibility changes.

Suggested change
.FromProperty(VisibilityProperty, typeof(ResultListBox))
.FromProperty(VisibilityProperty, typeof(StackPanel)) // Replace ResultListBox with the actual type of History

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jack251970 is this relevant?

.AddValueChanged(History, (s, e) => UpdateClockPanelVisibility());

// Initialize query state
Expand Down Expand Up @@ -333,7 +333,7 @@
{
try
{
_hwndSource.RemoveHook(WndProc);

Check warning on line 336 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
}
catch (Exception)
{
Expand Down Expand Up @@ -457,7 +457,7 @@
}
}

#pragma warning restore VSTHRD100 // Avoid async void methods

Check warning on line 460 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`VSTHRD` is not a recognized word. (unrecognized-spelling)

#endregion

Expand All @@ -472,7 +472,7 @@

#region Window Context Menu Event

#pragma warning disable VSTHRD100 // Avoid async void methods

Check warning on line 475 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`VSTHRD` is not a recognized word. (unrecognized-spelling)

private async void OnContextMenusForSettingsClick(object sender, RoutedEventArgs e)
{
Expand All @@ -484,13 +484,13 @@
App.API.OpenSettingDialog();
}

#pragma warning restore VSTHRD100 // Avoid async void methods

Check warning on line 487 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`VSTHRD` is not a recognized word. (unrecognized-spelling)

#endregion

#region Window WndProc

Check warning on line 491 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)

private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)

Check warning on line 493 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Wnd` is not a recognized word. (unrecognized-spelling)
{
if (msg == Win32Helper.WM_ENTERSIZEMOVE)
{
Expand Down Expand Up @@ -561,7 +561,7 @@

private void InitSoundEffects()
{
if (_settings.WMPInstalled)

Check warning on line 564 in Flow.Launcher/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`WMP` is not a recognized word. (unrecognized-spelling)
{
animationSoundWMP?.Close();
animationSoundWMP = new MediaPlayer();
Expand Down Expand Up @@ -1016,7 +1016,7 @@

private void UpdateClockPanelVisibility()
{
if (QueryTextBox == null || ContextMenu == null || History == null || ClockPanel == null)
if (QueryTextBox == null || ResultContextMenu == null || History == null || ClockPanel == null)
{
return;
}
Expand All @@ -1031,20 +1031,20 @@
};
var animationDuration = TimeSpan.FromMilliseconds(animationLength * 2 / 3);

// ✅ Conditions for showing ClockPanel (No query input & ContextMenu, History are closed)
// ✅ Conditions for showing ClockPanel (No query input / ResultContextMenu & History are closed)
var shouldShowClock = QueryTextBox.Text.Length == 0 &&
ContextMenu.Visibility != Visibility.Visible &&
ResultContextMenu.Visibility != Visibility.Visible &&
History.Visibility != Visibility.Visible;

// ✅ 1. When ContextMenu opens, immediately set Visibility.Hidden (force hide without animation)
if (ContextMenu.Visibility == Visibility.Visible)
// ✅ 1. When ResultContextMenu opens, immediately set Visibility.Hidden (force hide without animation)
if (ResultContextMenu.Visibility == Visibility.Visible)
{
_viewModel.ClockPanelVisibility = Visibility.Hidden;
_viewModel.ClockPanelOpacity = 0.0; // Set to 0 in case Opacity animation affects it
return;
}

// ✅ 2. When ContextMenu is closed, keep it Hidden if there's text in the query (remember previous state)
// ✅ 2. When ResultContextMenu is closed, keep it Hidden if there's text in the query (remember previous state)
else if (QueryTextBox.Text.Length > 0)
{
_viewModel.ClockPanelVisibility = Visibility.Hidden;
Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
IsHitTestVisible="False"
Visibility="Visible" />
</ContentControl>
<Border x:Name="ContextMenu" Visibility="Collapsed" />
<Border x:Name="ResultContextMenu" Visibility="Collapsed" />
<Border x:Name="History" Visibility="Collapsed" />
</Grid>
</Border>
Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/Themes/Base.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@
<MultiDataTrigger.Conditions>
<!--
<Condition Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Collapsed" />
<Condition Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Collapsed" />-->
<Condition Binding="{Binding ElementName=ResultContextMenu, Path=Visibility}" Value="Collapsed" />-->
Comment on lines 480 to +482
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The comment block opens on line 480 but closes here, which can be hard to follow; consider using a single-line comment (<!-- ... -->) or moving both markers onto each individual line to improve readability.

Copilot uses AI. Check for mistakes.

<Condition Binding="{Binding ElementName=History, Path=Visibility}" Value="Collapsed" />
<Condition Binding="{Binding ElementName=ResultListBox, Path=Items.Count}" Value="0" />
</MultiDataTrigger.Conditions>
Expand Down
Loading