Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1eacdf8
Add Control in PluginDisplay
onesounds Mar 31, 2025
5fa244c
Add setting filter
onesounds Mar 31, 2025
0136c57
Add Setting Filter
onesounds Mar 31, 2025
fb50e6d
Add search delay control
onesounds Mar 31, 2025
d77400d
Add customcontrol for searchdelay
onesounds Mar 31, 2025
378e98f
Merge branch 'dev' into 250331-NewPluginsPage
onesounds Apr 3, 2025
3ca958c
Merge remote-tracking branch 'origin/dev' into 250331-NewPluginsPage
onesounds Apr 3, 2025
a65e89b
Adjust advanced control UI
onesounds Apr 4, 2025
f3fcaee
- Add strings
onesounds Apr 4, 2025
276af43
Remove Delay item in plugin setting page layout
onesounds Apr 4, 2025
44a1a47
Add help window with content dialogue style
onesounds Apr 4, 2025
b81f9be
Adjust numberbox
onesounds Apr 4, 2025
cd39164
Fix Typo
onesounds Apr 4, 2025
adbd262
Merge branch 'dev' into 250331-NewPluginsPage
Jack251970 Apr 7, 2025
81715f1
Cleanup codes
Jack251970 Apr 7, 2025
bf63dda
Improve code quality
Jack251970 Apr 7, 2025
44f136c
Use binding instead of local functions
Jack251970 Apr 7, 2025
dc7b812
Change search delay time to int & Improve code quality & Improve strings
Jack251970 Apr 7, 2025
dfb6b0a
Fix string resource issue
Jack251970 Apr 7, 2025
24bbfcc
Support numerical box for priority
Jack251970 Apr 7, 2025
6726828
Support numerical box for search delay
Jack251970 Apr 7, 2025
65f48e3
Force priority to 0 when inputing empty
Jack251970 Apr 7, 2025
e955e47
- Change combobox to numberbox
onesounds Apr 7, 2025
cbf5031
Fix content dialog style
onesounds Apr 7, 2025
d30f292
Remove unused string
Jack251970 Apr 8, 2025
970bb3a
Add code comments
Jack251970 Apr 8, 2025
61fa460
Disable search delay number box when search delay is disabled
Jack251970 Apr 8, 2025
ade4fbf
Adjust number box width
Jack251970 Apr 8, 2025
c33fae9
Change default search delay time to value
Jack251970 Apr 8, 2025
d09899e
Adjust Placeholder color
onesounds Apr 8, 2025
c351a38
Merge branch 'dev' into 250331-NewPluginsPage
onesounds Apr 8, 2025
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
23 changes: 23 additions & 0 deletions Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace Flow.Launcher.Converters
{
public class StringEqualityToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || parameter == null)
return Visibility.Collapsed;

return value.ToString() == parameter.ToString() ? Visibility.Visible : Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
4 changes: 4 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@
<system:String x:Key="actionKeywordsTooltip">Change Action Keywords</system:String>
<system:String x:Key="pluginSearchDelayTime">Plugin seach delay time</system:String>
<system:String x:Key="pluginSearchDelayTimeTooltip">Change Plugin Seach Delay Time</system:String>
<system:String x:Key="FilterComboboxLabel">Advanced Settings:</system:String>
<system:String x:Key="EnabledCombobox">Enabled</system:String>
<system:String x:Key="PriorityCombobox">Priority</system:String>
<system:String x:Key="SearchDelayCombobox">Search Delay</system:String>
<system:String x:Key="currentPriority">Current Priority</system:String>
<system:String x:Key="newPriority">New Priority</system:String>
<system:String x:Key="priority">Priority</system:String>
Expand Down
64 changes: 57 additions & 7 deletions Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel"
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
d:DataContext="{d:DesignInstance viewModel:PluginViewModel}"
d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<UserControl.Resources>
<converters:StringEqualityToVisibilityConverter x:Key="StringEqualityToVisibilityConverter" />
</UserControl.Resources>
<Expander
Padding="0"
BorderThickness="0"
Expand Down Expand Up @@ -48,7 +52,7 @@
Grid.Column="2"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock
<!--<TextBlock
Margin="0 0 8 0"
VerticalAlignment="Center"
FontSize="12"
Expand All @@ -62,7 +66,9 @@
Content="{Binding Priority}"
Cursor="Hand"
ToolTip="{DynamicResource priorityToolTip}">
<!--#region Priority Button Style-->
-->
<!--#region Priority Button Style-->
<!--
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2" />
Expand All @@ -82,23 +88,67 @@
</Style.Triggers>
</Style>
</Button.Style>
<!--#endregion-->
</Button>
-->
<!--#endregion-->
<!--
</Button>-->
<StackPanel VerticalAlignment="Center"
x:Name="PriorityControl"
Orientation="Horizontal"
Visibility="{Binding DataContext.CurrentDisplayMode,
RelativeSource={RelativeSource AncestorType=ListBox},
Converter={StaticResource StringEqualityToVisibilityConverter},
ConverterParameter=Priority}">
<TextBlock
Margin="0 0 8 0"
VerticalAlignment="Center"
FontSize="13" ToolTip="{DynamicResource priorityToolTip}"
Foreground="{DynamicResource Color08B}"
Text="{DynamicResource priority}" />
<ui:NumberBox
Margin="0 0 8 0"
Maximum="999" ToolTip="{DynamicResource priorityToolTip}"
Minimum="-999"
SpinButtonPlacementMode="Inline" />
</StackPanel>

<StackPanel
x:Name="SearchDelayControl"
Orientation="Horizontal"
VerticalAlignment="Center"
Visibility="{Binding DataContext.CurrentDisplayMode,
RelativeSource={RelativeSource AncestorType=ListBox},
Converter={StaticResource StringEqualityToVisibilityConverter},
ConverterParameter=SearchDelay}">
<TextBlock
Margin="0 0 8 0"
VerticalAlignment="Center"
FontSize="13" ToolTip="{DynamicResource searchDelayToolTip}"
Foreground="{DynamicResource Color08B}"
Text="{DynamicResource searchDelay}" />
<cc:InstalledPluginSearchDelayCombobox
Margin="0 0 8 0" />
</StackPanel>

<ui:ToggleSwitch
x:Name="OnOffControl"
Margin="0 0 8 0"
IsOn="{Binding PluginState}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</StackPanel>
OnContent="{DynamicResource enable}"
Visibility="{Binding DataContext.CurrentDisplayMode,
RelativeSource={RelativeSource AncestorType=ListBox},
Converter={StaticResource StringEqualityToVisibilityConverter},
ConverterParameter=OnOff}" />
</StackPanel>
</Grid>
</Border>
</Expander.Header>

<StackPanel>
<ContentControl Content="{Binding BottomPart1}" />

<ContentControl Content="{Binding BottomPart2}" />
<!-- <ContentControl Content="{Binding BottomPart2}" /> -->

<Border
Background="{DynamicResource Color00B}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<UserControl
x:Class="Flow.Launcher.Resources.Controls.InstalledPluginSearchDelayCombobox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel"
d:DataContext="{d:DesignInstance viewModel:PluginViewModel}"
d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<Border
Width="Auto"
Height="Auto"
Margin="0"
Padding="0"
BorderThickness="0"
CornerRadius="0">
<DockPanel>
<TextBlock Visibility="Collapsed"
Margin="0 0 8 0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="{DynamicResource pluginSearchDelayTime}"
FontSize="13"
Foreground="{DynamicResource Color08B}" />
<ComboBox
x:Name="cbDelay"
Width="100"
HorizontalAlignment="Right"
DisplayMemberPath="Display"
SelectedValuePath="Value"
SelectionChanged="CbDelay_SelectionChanged"
DockPanel.Dock="Right"
ToolTip="{DynamicResource pluginSearchDelayTimeTooltip}" />
</DockPanel>
</Border>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System.Collections.Generic;
using System.Windows.Controls;
using Flow.Launcher.Plugin;

namespace Flow.Launcher.Resources.Controls
{
public partial class InstalledPluginSearchDelayCombobox
{
public InstalledPluginSearchDelayCombobox()
{
InitializeComponent();
LoadDelayOptions();
Loaded += InstalledPluginSearchDelayCombobox_Loaded;
}

private void InstalledPluginSearchDelayCombobox_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
if (DataContext is ViewModel.PluginViewModel viewModel)
{
// 초기 값 설정
int currentDelayMs = GetCurrentDelayMs(viewModel);
foreach (DelayOption option in cbDelay.Items)
{
if (option.Value == currentDelayMs)
{
cbDelay.SelectedItem = option;
break;
}
}
}
}

private int GetCurrentDelayMs(ViewModel.PluginViewModel viewModel)
{
// SearchDelayTime enum 값을 int로 변환
SearchDelayTime? delayTime = viewModel.PluginPair.Metadata.SearchDelayTime;
if (delayTime.HasValue)
{
return (int)delayTime.Value;
}
return 0; // 기본값
}

private void LoadDelayOptions()
{
// 검색 지연 시간 옵션들 (SearchDelayTime enum 값에 맞춰야 함)
var delayOptions = new List<DelayOption>
{
new DelayOption { Display = "0 ms", Value = 0 },
new DelayOption { Display = "50 ms", Value = 50 },
new DelayOption { Display = "100 ms", Value = 100 },
new DelayOption { Display = "150 ms", Value = 150 },
new DelayOption { Display = "200 ms", Value = 200 },
new DelayOption { Display = "250 ms", Value = 250 },
new DelayOption { Display = "300 ms", Value = 300 },
new DelayOption { Display = "350 ms", Value = 350 },
new DelayOption { Display = "400 ms", Value = 400 },
new DelayOption { Display = "450 ms", Value = 450 },
new DelayOption { Display = "500 ms", Value = 500 },
};

cbDelay.ItemsSource = delayOptions;
}

private void CbDelay_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (DataContext is ViewModel.PluginViewModel viewModel && cbDelay.SelectedItem is DelayOption selectedOption)
{
// int 값을 SearchDelayTime enum으로 변환
int delayValue = selectedOption.Value;
viewModel.PluginPair.Metadata.SearchDelayTime = (SearchDelayTime)delayValue;

// 설정 저장
//How to save?
}
}
}

public class DelayOption
{
public string Display { get; set; }
public int Value { get; set; }
}
}
Loading
Loading