Skip to content

Commit 1384b86

Browse files
authored
Merge branch 'dev' into OpenRecycleBinCommand
2 parents d257810 + 3135f48 commit 1384b86

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

Flow.Launcher/Converters/OpenResultHotkeyVisibilityConverter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ namespace Flow.Launcher.Converters
1111
[ValueConversion(typeof(bool), typeof(Visibility))]
1212
public class OpenResultHotkeyVisibilityConverter : IValueConverter
1313
{
14-
private const int MaxVisibleHotkeys = 9;
14+
private const int MaxVisibleHotkeys = 10;
1515

1616
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1717
{
18-
var hotkeyNumber = int.MaxValue;
18+
var number = int.MaxValue;
1919

2020
if (value is ListBoxItem listBoxItem
2121
&& ItemsControl.ItemsControlFromItemContainer(listBoxItem) is ListBox listBox)
22-
hotkeyNumber = listBox.ItemContainerGenerator.IndexFromContainer(listBoxItem) + 1;
22+
number = listBox.ItemContainerGenerator.IndexFromContainer(listBoxItem) + 1;
2323

24-
return hotkeyNumber <= MaxVisibleHotkeys ? Visibility.Visible : Visibility.Collapsed;
24+
return number <= MaxVisibleHotkeys ? Visibility.Visible : Visibility.Collapsed;
2525
}
2626

2727
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException();

Flow.Launcher/Converters/OrdinalConverter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ public object Convert(object value, System.Type targetType, object parameter, Cu
1010
{
1111
if (value is ListBoxItem listBoxItem
1212
&& ItemsControl.ItemsControlFromItemContainer(listBoxItem) is ListBox listBox)
13-
return listBox.ItemContainerGenerator.IndexFromContainer(listBoxItem) + 1;
13+
{
14+
var res = listBox.ItemContainerGenerator.IndexFromContainer(listBoxItem) + 1;
15+
return res == 10 ? 0 : res; // 10th item => HOTKEY+0
16+
}
1417

1518
return 0;
1619
}

Flow.Launcher/MainWindow.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@
150150
Command="{Binding OpenResultCommand}"
151151
CommandParameter="8"
152152
Modifiers="{Binding OpenResultCommandModifiers}" />
153+
<KeyBinding
154+
Key="D0"
155+
Command="{Binding OpenResultCommand}"
156+
CommandParameter="9"
157+
Modifiers="{Binding OpenResultCommandModifiers}" />
153158
</Window.InputBindings>
154159
<Grid>
155160
<Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,20 @@ private void OnLoaded(object sender, RoutedEventArgs _)
138138
}
139139
case nameof(MainViewModel.ProgressBarVisibility):
140140
{
141-
Dispatcher.Invoke(async () =>
141+
Dispatcher.Invoke(() =>
142142
{
143143
if (_viewModel.ProgressBarVisibility == Visibility.Hidden && !isProgressBarStoryboardPaused)
144144
{
145-
await Task.Delay(50);
146145
_progressBarStoryboard.Stop(ProgressBar);
147146
isProgressBarStoryboardPaused = true;
148147
}
149148
else if (_viewModel.MainWindowVisibilityStatus &&
150-
isProgressBarStoryboardPaused)
149+
isProgressBarStoryboardPaused)
151150
{
152151
_progressBarStoryboard.Begin(ProgressBar, true);
153152
isProgressBarStoryboardPaused = false;
154153
}
155-
}, System.Windows.Threading.DispatcherPriority.Render);
156-
154+
});
157155
break;
158156
}
159157
case nameof(MainViewModel.QueryTextCursorMovedToEnd):

0 commit comments

Comments
 (0)