Skip to content

Commit 5161796

Browse files
committed
PluginSettingsWindow: Fix tooltips not showing on disabled toggle and make delay 0 when disabled
1 parent c7bc02d commit 5161796

1 file changed

Lines changed: 36 additions & 10 deletions

File tree

Flow.Launcher/PluginSettingsWindow.xaml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@
249249

250250
<!-- Home row -->
251251
<Border Style="{StaticResource PluginSettingsRowBorderStyle}">
252-
<DockPanel Margin="{StaticResource SettingPanelMargin}" LastChildFill="False">
252+
<DockPanel
253+
Margin="{StaticResource SettingPanelMargin}"
254+
LastChildFill="False">
253255
<TextBlock Style="{StaticResource PluginSettingsRowGlyphStyle}">
254256
&#xE80F;
255257
</TextBlock>
@@ -263,20 +265,33 @@
263265
IsOn="{Binding PluginHomeState}"
264266
OffContent="{DynamicResource disable}"
265267
OnContent="{DynamicResource enable}"
266-
ToolTip="{DynamicResource homeToggleBoxToolTip}" />
268+
ToolTip="{DynamicResource homeToggleBoxToolTip}"
269+
ToolTipService.ShowOnDisabled="True">
270+
<ui:ToggleSwitch.Style>
271+
<Style
272+
BasedOn="{StaticResource {x:Type ui:ToggleSwitch}}"
273+
TargetType="ui:ToggleSwitch">
274+
<Style.Triggers>
275+
<Trigger Property="IsEnabled" Value="False">
276+
<Setter Property="ToolTipService.InitialShowDelay" Value="0" />
277+
</Trigger>
278+
</Style.Triggers>
279+
</Style>
280+
</ui:ToggleSwitch.Style>
281+
</ui:ToggleSwitch>
267282
</DockPanel>
268283
</Border>
269284

270285
<!-- Priority row -->
271286
<Border Style="{StaticResource PluginSettingsRowBorderStyle}">
272-
<DockPanel Margin="{StaticResource SettingPanelMargin}">
287+
<DockPanel
288+
Margin="{StaticResource SettingPanelMargin}">
273289
<TextBlock Style="{StaticResource PluginSettingsRowGlyphStyle}">
274290
&#xE74A;
275291
</TextBlock>
276292
<TextBlock
277293
Style="{StaticResource PluginSettingsRowLabelStyle}"
278-
Text="{DynamicResource priority}"
279-
ToolTip="{DynamicResource priorityToolTip}" />
294+
Text="{DynamicResource priority}" />
280295
<ui:NumberBox
281296
MinWidth="120"
282297
Margin="0 -4.5 0 -4.5"
@@ -292,14 +307,14 @@
292307

293308
<!-- Search Delay row -->
294309
<Border Style="{StaticResource PluginSettingsRowBorderStyle}">
295-
<DockPanel Margin="{StaticResource SettingPanelMargin}">
310+
<DockPanel
311+
Margin="{StaticResource SettingPanelMargin}">
296312
<TextBlock Style="{StaticResource PluginSettingsRowGlyphStyle}">
297313
&#xE961;
298314
</TextBlock>
299315
<TextBlock
300316
Style="{StaticResource PluginSettingsRowLabelStyle}"
301-
Text="{DynamicResource searchDelay}"
302-
ToolTip="{DynamicResource searchDelayToolTip}" />
317+
Text="{DynamicResource searchDelay}" />
303318
<ui:NumberBox
304319
Width="120"
305320
MinWidth="120"
@@ -312,9 +327,20 @@
312327
SmallChange="10"
313328
SpinButtonPlacementMode="Compact"
314329
ToolTip="{DynamicResource searchDelayNumberBoxToolTip}"
315-
ToolTipService.InitialShowDelay="0"
316330
ToolTipService.ShowOnDisabled="True"
317-
Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" />
331+
Value="{Binding PluginSearchDelayTime, Mode=TwoWay}">
332+
<ui:NumberBox.Style>
333+
<Style
334+
BasedOn="{StaticResource {x:Type ui:NumberBox}}"
335+
TargetType="ui:NumberBox">
336+
<Style.Triggers>
337+
<Trigger Property="IsEnabled" Value="False">
338+
<Setter Property="ToolTipService.InitialShowDelay" Value="0" />
339+
</Trigger>
340+
</Style.Triggers>
341+
</Style>
342+
</ui:NumberBox.Style>
343+
</ui:NumberBox>
318344
</DockPanel>
319345
</Border>
320346
</StackPanel>

0 commit comments

Comments
 (0)