Skip to content

Commit 9e09567

Browse files
author
Tomasz Solik
committed
Adds navigation panel toggle button
Implements a toggle button for the navigation panel, improving UI responsiveness and user control over screen real estate. This change introduces a new style for the toggle button and integrates it into the navigation sidebar. The button provides a cleaner and more intuitive way to hide or show the navigation panel, replacing the previous subtle icon button.
1 parent 4c19126 commit 9e09567

2 files changed

Lines changed: 34 additions & 11 deletions

File tree

BusLane/Styles/AppStyles.axaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,34 @@
11281128
<Setter Property="BoxShadow" Value="{DynamicResource FocusRingAccent}"/>
11291129
</Style>
11301130

1131+
<!-- Sidebar panel toggle button -->
1132+
<Style Selector="Button.panel-toggle">
1133+
<Setter Property="Background" Value="Transparent"/>
1134+
<Setter Property="Foreground" Value="{DynamicResource SubtleForeground}"/>
1135+
<Setter Property="Padding" Value="6"/>
1136+
<Setter Property="BorderThickness" Value="0"/>
1137+
<Setter Property="BorderBrush" Value="Transparent"/>
1138+
<Setter Property="CornerRadius" Value="6"/>
1139+
<Setter Property="Cursor" Value="Hand"/>
1140+
<Setter Property="MinWidth" Value="30"/>
1141+
<Setter Property="MinHeight" Value="30"/>
1142+
</Style>
1143+
1144+
<Style Selector="Button.panel-toggle:pointerover /template/ ContentPresenter">
1145+
<Setter Property="Background" Value="{DynamicResource HoverBackground}"/>
1146+
<Setter Property="Foreground" Value="{DynamicResource AppForeground}"/>
1147+
<Setter Property="BorderBrush" Value="Transparent"/>
1148+
</Style>
1149+
1150+
<Style Selector="Button.panel-toggle:pressed /template/ ContentPresenter">
1151+
<Setter Property="Background" Value="{DynamicResource PressedBackground}"/>
1152+
<Setter Property="BorderBrush" Value="Transparent"/>
1153+
</Style>
1154+
1155+
<Style Selector="Button.panel-toggle:focus-visible /template/ ContentPresenter">
1156+
<Setter Property="BoxShadow" Value="{DynamicResource FocusRingAccent}"/>
1157+
</Style>
1158+
11311159
<Style Selector="ToggleButton.icon-button">
11321160
<Setter Property="Background" Value="Transparent"/>
11331161
<Setter Property="Foreground" Value="{DynamicResource AppForeground}"/>

BusLane/Views/Controls/NavigationSidebar.axaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<!-- App Header -->
1717
<Border DockPanel.Dock="Top" Classes="sidebar-header">
1818
<StackPanel>
19-
<Grid ColumnDefinitions="Auto,*,Auto">
19+
<Grid ColumnDefinitions="*,Auto">
2020
<StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="10">
2121
<Viewbox Width="32" Height="32">
2222
<Canvas Width="512" Height="512">
@@ -80,23 +80,18 @@
8080
</Viewbox>
8181
<StackPanel VerticalAlignment="Center">
8282
<TextBlock Text="BusLane" Classes="heading-large"/>
83-
<StackPanel Orientation="Horizontal" Spacing="6">
84-
<TextBlock Text="Service Bus Manager" Classes="caption" FontSize="11"/>
85-
<Border Classes="badge-info" Padding="4,1">
86-
<TextBlock Text="{Binding AppVersion}" FontSize="12" Foreground="{DynamicResource AccentBrand}"/>
87-
</Border>
88-
</StackPanel>
83+
<TextBlock Text="Service Bus Manager" Classes="caption" FontSize="11"/>
8984
</StackPanel>
9085
</StackPanel>
9186

9287
<!-- Toggle Panel Button -->
93-
<Button Grid.Column="2"
94-
Classes="subtle icon-button"
88+
<Button Grid.Column="1"
89+
Classes="panel-toggle"
9590
Command="{Binding ToggleNavigationPanelCommand}"
96-
ToolTip.Tip="Hide panel"
91+
ToolTip.Tip="Hide navigation panel"
9792
VerticalAlignment="Center"
9893
HorizontalAlignment="Right"
99-
Margin="8,0,0,0"
94+
Margin="12,0,0,0"
10095
Padding="6">
10196
<LucideIcon Kind="PanelLeftClose" Size="18"/>
10297
</Button>

0 commit comments

Comments
 (0)