|
2 | 2 | x:Class="Flow.Launcher.PluginSettingsWindow" |
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
5 | | - xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" |
| 5 | + xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" |
6 | 6 | Width="920" |
7 | 7 | Height="320" |
8 | 8 | MinWidth="720" |
|
22 | 22 | <Window.CommandBindings> |
23 | 23 | <CommandBinding Command="Close" Executed="OnCloseExecuted" /> |
24 | 24 | </Window.CommandBindings> |
| 25 | + <Window.Resources> |
| 26 | + <Style x:Key="PluginSettingsRowBorderStyle" TargetType="Border"> |
| 27 | + <Setter Property="BorderBrush" Value="{DynamicResource Color03B}" /> |
| 28 | + <Setter Property="BorderThickness" Value="0 1 0 0" /> |
| 29 | + </Style> |
| 30 | + <Style |
| 31 | + x:Key="PluginSettingsRowLabelStyle" |
| 32 | + BasedOn="{StaticResource SettingTitleLabel}" |
| 33 | + TargetType="TextBlock"> |
| 34 | + <Setter Property="Margin" Value="{StaticResource SettingPanelItemRightMargin}" /> |
| 35 | + <Setter Property="HorizontalAlignment" Value="Left" /> |
| 36 | + <Setter Property="VerticalAlignment" Value="Center" /> |
| 37 | + <Setter Property="DockPanel.Dock" Value="Left" /> |
| 38 | + </Style> |
| 39 | + <Style |
| 40 | + x:Key="PluginSettingsRowGlyphStyle" |
| 41 | + BasedOn="{StaticResource Glyph}" |
| 42 | + TargetType="TextBlock"> |
| 43 | + <Setter Property="Margin" Value="{StaticResource SettingPanelItemRightMargin}" /> |
| 44 | + <Setter Property="HorizontalAlignment" Value="Left" /> |
| 45 | + <Setter Property="VerticalAlignment" Value="Center" /> |
| 46 | + <Setter Property="DockPanel.Dock" Value="Left" /> |
| 47 | + </Style> |
| 48 | + </Window.Resources> |
25 | 49 |
|
26 | 50 | <Grid> |
27 | 51 | <Border Style="{StaticResource WindowMainPanelStyle}"> |
|
151 | 175 | Grid.Row="1" |
152 | 176 | Grid.Column="0" |
153 | 177 | Grid.ColumnSpan="5" |
154 | | - Margin="20 8 20 16" |
155 | | - Background="{DynamicResource Color01B}"> |
156 | | - <ListBox |
157 | | - x:Name="PluginListBox" |
158 | | - Padding="0 0 7 0" |
159 | | - Background="{DynamicResource Color01B}" |
| 178 | + Margin="20 8 20 16"> |
| 179 | + <ScrollViewer |
160 | 180 | FontSize="14" |
161 | | - ItemContainerStyle="{DynamicResource PluginList}" |
162 | | - ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
163 | | - SnapsToDevicePixels="True" |
164 | | - Style="{DynamicResource PluginListStyle}" |
165 | | - VirtualizingPanel.ScrollUnit="Pixel" |
166 | | - VirtualizingStackPanel.IsVirtualizing="True" |
167 | | - VirtualizingStackPanel.VirtualizationMode="Recycling"> |
168 | | - <ListBox.ItemTemplate> |
169 | | - <DataTemplate> |
170 | | - <cc:InstalledPluginDisplay /> |
171 | | - </DataTemplate> |
172 | | - </ListBox.ItemTemplate> |
173 | | - </ListBox> |
| 181 | + HorizontalScrollBarVisibility="Disabled" |
| 182 | + VerticalScrollBarVisibility="Auto"> |
| 183 | + <StackPanel Margin="8 0 32 0"> |
| 184 | + <!-- Plugin header --> |
| 185 | + <Border |
| 186 | + Margin="0" |
| 187 | + Padding="0 12"> |
| 188 | + <Grid Margin="16 12 18 12"> |
| 189 | + <Grid.ColumnDefinitions> |
| 190 | + <ColumnDefinition Width="36" MinWidth="36" /> |
| 191 | + <ColumnDefinition Width="*" /> |
| 192 | + </Grid.ColumnDefinitions> |
| 193 | + <Image |
| 194 | + Grid.Column="0" |
| 195 | + Width="32" |
| 196 | + Height="32" |
| 197 | + VerticalAlignment="Center" |
| 198 | + Source="{Binding Image, Mode=OneWay, IsAsync=True}" /> |
| 199 | + <StackPanel |
| 200 | + Grid.Column="1" |
| 201 | + Margin="16 0 0 0" |
| 202 | + VerticalAlignment="Center"> |
| 203 | + <TextBlock |
| 204 | + FontSize="15" |
| 205 | + FontWeight="SemiBold" |
| 206 | + Foreground="{DynamicResource Color05B}" |
| 207 | + Text="{Binding PluginPair.Metadata.Name}" |
| 208 | + TextWrapping="Wrap" |
| 209 | + ToolTip="{Binding PluginPair.Metadata.Version}" /> |
| 210 | + <TextBlock |
| 211 | + Margin="0 2 0 0" |
| 212 | + FontSize="12" |
| 213 | + Foreground="{DynamicResource Color04B}" |
| 214 | + Text="{Binding PluginPair.Metadata.Description}" |
| 215 | + TextWrapping="WrapWithOverflow" /> |
| 216 | + </StackPanel> |
| 217 | + </Grid> |
| 218 | + </Border> |
| 219 | + |
| 220 | + <Border |
| 221 | + Margin="0" |
| 222 | + Padding="0" |
| 223 | + CornerRadius="5 5 0 0"> |
| 224 | + <Border.Style> |
| 225 | + <Style BasedOn="{StaticResource SettingGroupBox}" TargetType="Border"> |
| 226 | + <Setter Property="BorderThickness" Value="0" /> |
| 227 | + <Setter Property="Padding" Value="0" /> |
| 228 | + <Setter Property="Margin" Value="0" /> |
| 229 | + </Style> |
| 230 | + </Border.Style> |
| 231 | + <StackPanel> |
| 232 | + <!-- Enabled row --> |
| 233 | + <Border Style="{StaticResource PluginSettingsRowBorderStyle}"> |
| 234 | + <DockPanel Margin="{StaticResource SettingPanelMargin}" LastChildFill="False"> |
| 235 | + <TextBlock Style="{StaticResource PluginSettingsRowGlyphStyle}"> |
| 236 | +  |
| 237 | + </TextBlock> |
| 238 | + <TextBlock |
| 239 | + Style="{StaticResource PluginSettingsRowLabelStyle}" |
| 240 | + Text="{DynamicResource DisplayModeOnOff}" /> |
| 241 | + <ui:ToggleSwitch |
| 242 | + DockPanel.Dock="Right" |
| 243 | + Margin="0 -8.5 0 -8.5" |
| 244 | + IsOn="{Binding PluginState}" |
| 245 | + OffContent="{DynamicResource disable}" |
| 246 | + OnContent="{DynamicResource enable}" /> |
| 247 | + </DockPanel> |
| 248 | + </Border> |
| 249 | + |
| 250 | + <!-- Home row --> |
| 251 | + <Border Style="{StaticResource PluginSettingsRowBorderStyle}"> |
| 252 | + <DockPanel Margin="{StaticResource SettingPanelMargin}" LastChildFill="False"> |
| 253 | + <TextBlock Style="{StaticResource PluginSettingsRowGlyphStyle}"> |
| 254 | +  |
| 255 | + </TextBlock> |
| 256 | + <TextBlock |
| 257 | + Style="{StaticResource PluginSettingsRowLabelStyle}" |
| 258 | + Text="{DynamicResource homeTitle}" /> |
| 259 | + <ui:ToggleSwitch |
| 260 | + DockPanel.Dock="Right" |
| 261 | + Margin="0 -8.5 0 -8.5" |
| 262 | + IsEnabled="{Binding HomeEnabled}" |
| 263 | + IsOn="{Binding PluginHomeState}" |
| 264 | + OffContent="{DynamicResource disable}" |
| 265 | + OnContent="{DynamicResource enable}" |
| 266 | + ToolTip="{DynamicResource homeToggleBoxToolTip}" /> |
| 267 | + </DockPanel> |
| 268 | + </Border> |
| 269 | + |
| 270 | + <!-- Priority row --> |
| 271 | + <Border Style="{StaticResource PluginSettingsRowBorderStyle}"> |
| 272 | + <DockPanel Margin="{StaticResource SettingPanelMargin}"> |
| 273 | + <TextBlock Style="{StaticResource PluginSettingsRowGlyphStyle}"> |
| 274 | +  |
| 275 | + </TextBlock> |
| 276 | + <TextBlock |
| 277 | + Style="{StaticResource PluginSettingsRowLabelStyle}" |
| 278 | + Text="{DynamicResource priority}" |
| 279 | + ToolTip="{DynamicResource priorityToolTip}" /> |
| 280 | + <ui:NumberBox |
| 281 | + MinWidth="120" |
| 282 | + Margin="0 -4.5 0 -4.5" |
| 283 | + HorizontalAlignment="Right" |
| 284 | + Maximum="999" |
| 285 | + Minimum="-999" |
| 286 | + SpinButtonPlacementMode="Inline" |
| 287 | + ToolTip="{DynamicResource priorityToolTip}" |
| 288 | + Value="{Binding Priority, Mode=TwoWay}" |
| 289 | + ValueChanged="NumberBox_OnValueChanged" /> |
| 290 | + </DockPanel> |
| 291 | + </Border> |
| 292 | + |
| 293 | + <!-- Search Delay row --> |
| 294 | + <Border Style="{StaticResource PluginSettingsRowBorderStyle}"> |
| 295 | + <DockPanel Margin="{StaticResource SettingPanelMargin}"> |
| 296 | + <TextBlock Style="{StaticResource PluginSettingsRowGlyphStyle}"> |
| 297 | +  |
| 298 | + </TextBlock> |
| 299 | + <TextBlock |
| 300 | + Style="{StaticResource PluginSettingsRowLabelStyle}" |
| 301 | + Text="{DynamicResource searchDelay}" |
| 302 | + ToolTip="{DynamicResource searchDelayToolTip}" /> |
| 303 | + <ui:NumberBox |
| 304 | + Width="120" |
| 305 | + MinWidth="120" |
| 306 | + Margin="0 -4.5 0 -4.5" |
| 307 | + HorizontalAlignment="Right" |
| 308 | + IsEnabled="{Binding SearchDelayEnabled}" |
| 309 | + Maximum="1000" |
| 310 | + Minimum="0" |
| 311 | + PlaceholderText="{Binding DefaultSearchDelay}" |
| 312 | + SmallChange="10" |
| 313 | + SpinButtonPlacementMode="Compact" |
| 314 | + ToolTip="{DynamicResource searchDelayNumberBoxToolTip}" |
| 315 | + ToolTipService.InitialShowDelay="0" |
| 316 | + ToolTipService.ShowOnDisabled="True" |
| 317 | + Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" /> |
| 318 | + </DockPanel> |
| 319 | + </Border> |
| 320 | + </StackPanel> |
| 321 | + </Border> |
| 322 | + |
| 323 | + <!-- Action keyword row --> |
| 324 | + <ContentControl Content="{Binding BottomPart1}" /> |
| 325 | + |
| 326 | + <!-- Plugin's own settings panel, if it has one --> |
| 327 | + <Border |
| 328 | + Margin="0" |
| 329 | + Padding="0" |
| 330 | + BorderThickness="0 1 0 0" |
| 331 | + CornerRadius="0"> |
| 332 | + <Border.Style> |
| 333 | + <Style BasedOn="{StaticResource SettingGroupBox}" TargetType="Border"> |
| 334 | + <Style.Triggers> |
| 335 | + <DataTrigger Binding="{Binding HasSettingControl}" Value="False"> |
| 336 | + <Setter Property="Visibility" Value="Collapsed" /> |
| 337 | + </DataTrigger> |
| 338 | + </Style.Triggers> |
| 339 | + </Style> |
| 340 | + </Border.Style> |
| 341 | + <ContentControl |
| 342 | + Margin="0" |
| 343 | + Padding="1" |
| 344 | + VerticalAlignment="Stretch" |
| 345 | + Content="{Binding SettingControl}" /> |
| 346 | + </Border> |
| 347 | + |
| 348 | + <!-- Plugin Footer --> |
| 349 | + <ContentControl Content="{Binding BottomPart2}" /> |
| 350 | + </StackPanel> |
| 351 | + </ScrollViewer> |
174 | 352 | </Border> |
175 | 353 | </Grid> |
176 | 354 | </Border> |
|
0 commit comments