Skip to content

Portable Tool for an Ideal Windows Setup

fix togglebutton hit-test area & prevent invisible navigation area mouse capture

Greedeks81e49238e48d
diff --git a/.Source/GTweak/Assets/UserControls/ToggleButton.xaml b/.Source/GTweak/Assets/UserControls/ToggleButton.xaml
index ce72dad2..b41b72ea 100644
--- a/.Source/GTweak/Assets/UserControls/ToggleButton.xaml
+++ b/.Source/GTweak/Assets/UserControls/ToggleButton.xaml
@@ -8,13 +8,13 @@
d:Height="auto" d:Width="auto" IsTabStop="False" Focusable="False" KeyboardNavigation.TabNavigation="None"
SnapsToDevicePixels="True" UseLayoutRounding="True">
<Viewbox Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Left">
- <Grid Cursor="Hand">
+ <Grid Cursor="Hand" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
- <Grid Grid.Column="0" Width="44" Height="20" MouseLeftButtonUp="Toggle_MouseLeftButtonUp" MouseEnter="Toggle_MouseEnter" MouseLeave="Toggle_MouseLeave">
+ <Grid Grid.Column="0" Background="Transparent" Width="44" Height="20" MouseLeftButtonUp="Toggle_MouseLeftButtonUp" MouseEnter="Toggle_MouseEnter" MouseLeave="Toggle_MouseLeave">
<Rectangle x:Name="Back" Width="44" Height="20" RadiusY="10" RadiusX="10" StrokeThickness="1" Stroke="{StaticResource Brush_ToggleBorder_Off}">
<Rectangle.Fill>
<SolidColorBrush Color="Transparent"/>
@@ -37,7 +37,9 @@
</Ellipse>
</Grid>
- <TextBlock x:Name="ToggleText" Grid.Column="1" Text="TextTglButton" Style="{StaticResource TextInactivity}" Margin="10,2,0,2"/>
+ <Grid Grid.Column="1" Background="Transparent">
+ <TextBlock x:Name="ToggleText" Text="TextTglButton" Style="{StaticResource TextInactivity}" Margin="10,2,0,2"/>
+ </Grid>
</Grid>
</Viewbox>
</UserControl>
diff --git a/.Source/GTweak/Styles/Buttons/RadioButtons.xaml b/.Source/GTweak/Styles/Buttons/RadioButtons.xaml
index 052ce3b6..a60fcd7d 100644
--- a/.Source/GTweak/Styles/Buttons/RadioButtons.xaml
+++ b/.Source/GTweak/Styles/Buttons/RadioButtons.xaml
@@ -12,12 +12,12 @@
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
- <Setter Property="Focusable" Value="False"/>
<Setter Property="IsTabStop" Value="False"/>
+ <Setter Property="Focusable" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
- <Border x:Name="OuterPanel" CornerRadius="12" Width="50" Height="48" Background="Transparent" HorizontalAlignment="Left" SnapsToDevicePixels="True">
+ <Border x:Name="OuterPanel" CornerRadius="12" Width="50" Height="48" Background="{x:Null}" HorizontalAlignment="Left" SnapsToDevicePixels="True">
<Grid RenderOptions.BitmapScalingMode="HighQuality">
<Grid.CacheMode>
<BitmapCache RenderAtScale="2" EnableClearType="True"/>
@@ -55,7 +55,7 @@
</Border>
</Grid>
</Border>
- <ControlTemplate.Triggers>
+ <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="InnerPanel" Property="Background" Value="{StaticResource Brush_BtnBG_Navigation}"/>
<Setter Property="Foreground" Value="{StaticResource Brush_Accent}"/>