|
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
5 | 5 | xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
|
| 6 | + xmlns:converters="clr-namespace:Flow.Launcher.Converters" |
6 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
7 | 8 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
8 | 9 | xmlns:ui="http://schemas.modernwpf.com/2019"
|
9 | 10 | xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel"
|
10 |
| - xmlns:converters="clr-namespace:Flow.Launcher.Converters" |
11 | 11 | d:DataContext="{d:DesignInstance viewModel:PluginViewModel}"
|
12 | 12 | d:DesignHeight="300"
|
13 | 13 | d:DesignWidth="300"
|
14 | 14 | mc:Ignorable="d">
|
15 | 15 | <UserControl.Resources>
|
16 |
| - <converters:StringEqualityToVisibilityConverter x:Key="StringEqualityToVisibilityConverter" /> |
| 16 | + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
17 | 17 | </UserControl.Resources>
|
18 | 18 | <Expander
|
19 | 19 | Padding="0"
|
|
48 | 48 | Text="{Binding PluginPair.Metadata.Description}"
|
49 | 49 | TextWrapping="WrapWithOverflow" />
|
50 | 50 | </StackPanel>
|
| 51 | + |
51 | 52 | <StackPanel
|
52 | 53 | Grid.Column="2"
|
53 | 54 | HorizontalAlignment="Right"
|
54 | 55 | Orientation="Horizontal">
|
55 |
| - <!--<TextBlock |
56 |
| - Margin="0 0 8 0" |
57 |
| - VerticalAlignment="Center" |
58 |
| - FontSize="12" |
59 |
| - Foreground="{DynamicResource Color08B}" |
60 |
| - Text="{DynamicResource priority}" /> |
61 |
| - <Button |
62 |
| - x:Name="PriorityButton" |
63 |
| - Margin="0 0 22 0" |
64 |
| - VerticalAlignment="Center" |
65 |
| - Command="{Binding EditPluginPriorityCommand}" |
66 |
| - Content="{Binding Priority}" |
67 |
| - Cursor="Hand" |
68 |
| - ToolTip="{DynamicResource priorityToolTip}"> |
69 |
| - --> |
70 |
| - <!--#region Priority Button Style--> |
71 |
| - <!-- |
72 |
| - <Button.Resources> |
73 |
| - <Style TargetType="Border"> |
74 |
| - <Setter Property="CornerRadius" Value="2" /> |
75 |
| - </Style> |
76 |
| - </Button.Resources> |
77 |
| - <Button.Style> |
78 |
| - <Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button"> |
79 |
| - <Setter Property="Padding" Value="12 8" /> |
80 |
| - <Setter Property="BorderThickness" Value="0" /> |
81 |
| - <Setter Property="FontWeight" Value="DemiBold" /> |
82 |
| - <Setter Property="Foreground" Value="{DynamicResource Color05B}" /> |
83 |
| - <Style.Triggers> |
84 |
| - <DataTrigger Binding="{Binding ElementName=PriorityButton, UpdateSourceTrigger=PropertyChanged, Path=Content}" Value="0"> |
85 |
| - <Setter Property="Foreground" Value="{DynamicResource Color08B}" /> |
86 |
| - <Setter Property="FontWeight" Value="Normal" /> |
87 |
| - </DataTrigger> |
88 |
| - </Style.Triggers> |
89 |
| - </Style> |
90 |
| - </Button.Style> |
91 |
| - --> |
92 |
| - <!--#endregion--> |
93 |
| - <!-- |
94 |
| - </Button>--> |
95 |
| - <StackPanel VerticalAlignment="Center" |
| 56 | + <StackPanel |
96 | 57 | x:Name="PriorityControl"
|
| 58 | + VerticalAlignment="Center" |
97 | 59 | Orientation="Horizontal"
|
98 |
| - Visibility="{Binding DataContext.CurrentDisplayMode, |
99 |
| - RelativeSource={RelativeSource AncestorType=ListBox}, |
100 |
| - Converter={StaticResource StringEqualityToVisibilityConverter}, |
101 |
| - ConverterParameter=Priority}"> |
| 60 | + Visibility="{Binding DataContext.IsPrioritySelected, RelativeSource={RelativeSource AncestorType=ListBox}, Converter={StaticResource BooleanToVisibilityConverter}}"> |
102 | 61 | <TextBlock
|
103 |
| - Margin="0 0 8 0" |
104 |
| - VerticalAlignment="Center" |
105 |
| - FontSize="13" ToolTip="{DynamicResource priorityToolTip}" |
106 |
| - Foreground="{DynamicResource Color08B}" |
107 |
| - Text="{DynamicResource priority}" /> |
| 62 | + Margin="0 0 8 0" |
| 63 | + VerticalAlignment="Center" |
| 64 | + FontSize="13" |
| 65 | + Foreground="{DynamicResource Color08B}" |
| 66 | + Text="{DynamicResource priority}" |
| 67 | + ToolTip="{DynamicResource priorityToolTip}" /> |
108 | 68 | <ui:NumberBox
|
109 | 69 | Margin="0 0 8 0"
|
110 |
| - Maximum="999" ToolTip="{DynamicResource priorityToolTip}" |
| 70 | + Maximum="999" |
111 | 71 | Minimum="-999"
|
112 |
| - SpinButtonPlacementMode="Inline" /> |
| 72 | + SpinButtonPlacementMode="Inline" |
| 73 | + ToolTip="{DynamicResource priorityToolTip}" /> |
113 | 74 | </StackPanel>
|
114 | 75 |
|
115 | 76 | <StackPanel
|
116 | 77 | x:Name="SearchDelayControl"
|
117 |
| - Orientation="Horizontal" |
118 | 78 | VerticalAlignment="Center"
|
119 |
| - Visibility="{Binding DataContext.CurrentDisplayMode, |
120 |
| - RelativeSource={RelativeSource AncestorType=ListBox}, |
121 |
| - Converter={StaticResource StringEqualityToVisibilityConverter}, |
122 |
| - ConverterParameter=SearchDelay}"> |
| 79 | + Orientation="Horizontal" |
| 80 | + Visibility="{Binding DataContext.IsSearchDelaySelected, RelativeSource={RelativeSource AncestorType=ListBox}, Converter={StaticResource BooleanToVisibilityConverter}}"> |
123 | 81 | <TextBlock
|
124 | 82 | Margin="0 0 8 0"
|
125 | 83 | VerticalAlignment="Center"
|
126 |
| - FontSize="13" ToolTip="{DynamicResource searchDelayToolTip}" |
| 84 | + FontSize="13" |
127 | 85 | Foreground="{DynamicResource Color08B}"
|
128 |
| - Text="{DynamicResource searchDelay}" /> |
129 |
| - <cc:InstalledPluginSearchDelayCombobox |
130 |
| - Margin="0 0 8 0" /> |
| 86 | + Text="{DynamicResource searchDelay}" |
| 87 | + ToolTip="{DynamicResource searchDelayToolTip}" /> |
| 88 | + <cc:InstalledPluginSearchDelayCombobox Margin="0 0 8 0" /> |
131 | 89 | </StackPanel>
|
132 | 90 |
|
| 91 | + <!-- Put OnOffControl after PriorityControl & SearchDelayControl so that it can display correctly --> |
133 | 92 | <ui:ToggleSwitch
|
134 | 93 | x:Name="OnOffControl"
|
135 | 94 | Margin="0 0 8 0"
|
136 | 95 | IsOn="{Binding PluginState}"
|
137 | 96 | OffContent="{DynamicResource disable}"
|
138 | 97 | OnContent="{DynamicResource enable}"
|
139 |
| - Visibility="{Binding DataContext.CurrentDisplayMode, |
140 |
| - RelativeSource={RelativeSource AncestorType=ListBox}, |
141 |
| - Converter={StaticResource StringEqualityToVisibilityConverter}, |
142 |
| - ConverterParameter=OnOff}" /> |
143 |
| - </StackPanel> |
| 98 | + Visibility="{Binding DataContext.IsOnOffSelected, RelativeSource={RelativeSource AncestorType=ListBox}, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
| 99 | + </StackPanel> |
144 | 100 | </Grid>
|
145 | 101 | </Border>
|
146 | 102 | </Expander.Header>
|
147 | 103 |
|
148 | 104 | <StackPanel>
|
149 | 105 | <ContentControl Content="{Binding BottomPart1}" />
|
150 | 106 |
|
151 |
| - <!-- <ContentControl Content="{Binding BottomPart2}" /> --> |
152 |
| - |
153 | 107 | <Border
|
154 | 108 | Background="{DynamicResource Color00B}"
|
155 | 109 | BorderBrush="{DynamicResource Color03B}"
|
|
170 | 124 | Content="{Binding SettingControl}" />
|
171 | 125 | </Border>
|
172 | 126 |
|
173 |
| - <ContentControl Content="{Binding BottomPart3}" /> |
| 127 | + <ContentControl Content="{Binding BottomPart2}" /> |
174 | 128 | </StackPanel>
|
175 | 129 | </Expander>
|
176 | 130 | </UserControl>
|
0 commit comments