Skip to content

Commit 70af06b

Browse files
committed
Enhance Section Box Navigator UI with improved button styles and layout adjustments. Introduced consistent styling for buttons and group boxes, optimized grid structure for better organization, and updated control margins for a cleaner interface.
1 parent 8988d8f commit 70af06b

File tree

1 file changed

+45
-16
lines changed

1 file changed

+45
-16
lines changed

extensions/pyRevitTools.extension/pyRevit.tab/Modify.panel/3D.pulldown/Section Box Navigator.pushbutton/SectionBoxNavigator.xaml

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
Title="Section Box Navigator" Height="670" Width="600"
44
ShowInTaskbar="False" Topmost="True"
55
ScrollViewer.VerticalScrollBarVisibility="Disabled">
6+
<Window.Resources>
7+
<Style TargetType="Button">
8+
<Setter Property="BorderThickness" Value="0"/>
9+
<Setter Property="Height" Value="30"/>
10+
<Setter Property="Template">
11+
<Setter.Value>
12+
<ControlTemplate TargetType="Button">
13+
<Border Background="{TemplateBinding Background}"
14+
CornerRadius="5"
15+
Padding="{TemplateBinding Padding}">
16+
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
17+
</Border>
18+
</ControlTemplate>
19+
</Setter.Value>
20+
</Setter>
21+
</Style>
22+
<Style TargetType="GroupBox">
23+
<Setter Property="BorderBrush" Value="#F0F0F0"/>
24+
<Setter Property="BorderThickness" Value="1"/>
25+
</Style>
26+
</Window.Resources>
627
<Grid Margin="15">
728
<Grid.RowDefinitions>
829
<RowDefinition Height="Auto"/>
@@ -18,9 +39,13 @@
1839
<!-- Row 0: Controls -->
1940

2041
<!-- Column 0: Level Navigation + View Alignment -->
21-
<StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,5,0">
42+
<Grid Grid.Row="0" Grid.Column="0" Margin="0,0,5,0">
43+
<Grid.RowDefinitions>
44+
<RowDefinition Height="Auto"/>
45+
<RowDefinition Height="Auto"/>
46+
</Grid.RowDefinitions>
2247
<!-- Level Navigation Controls -->
23-
<GroupBox Margin="0,0,0,10">
48+
<GroupBox Grid.Row="0" Margin="0,0,0,10">
2449
<GroupBox.Header>
2550
<StackPanel Orientation="Horizontal">
2651
<TextBlock>🏢</TextBlock>
@@ -90,22 +115,26 @@
90115
</GroupBox>
91116

92117
<!-- 2D View alignment-->
93-
<GroupBox Margin="0,0,0,10">
118+
<GroupBox Grid.Row="1" Margin="0,0,0,0">
94119
<GroupBox.Header>
95120
<StackPanel Orientation="Horizontal">
96121
<TextBlock>📐</TextBlock>
97122
<TextBlock FontWeight="Bold" Margin="5,0,0,0">View alignment</TextBlock>
98123
</StackPanel>
99124
</GroupBox.Header>
100-
<Button x:Name="btnAlignToView" Content="Align with 2D View"
101-
Height="35" Margin="2" Click="btn_align_box_to_view_click"/>
125+
<Button x:Name="btnAlignToView" Content="Align 2D View"
126+
Margin="5" Click="btn_align_box_to_view_click"/>
102127
</GroupBox>
103-
</StackPanel>
128+
</Grid>
104129

105130
<!-- Column 1: Grid Navigation + Expand/Shrink -->
106-
<StackPanel Grid.Row="0" Grid.Column="1" Margin="5,0,0,0">
131+
<Grid Grid.Row="0" Grid.Column="1" Margin="5,0,0,0">
132+
<Grid.RowDefinitions>
133+
<RowDefinition Height="Auto"/>
134+
<RowDefinition Height="Auto"/>
135+
</Grid.RowDefinitions>
107136
<!-- Grid Navigation -->
108-
<GroupBox Margin="0,0,0,10">
137+
<GroupBox Grid.Row="0" Margin="0,0,0,10">
109138
<GroupBox.Header>
110139
<StackPanel Orientation="Horizontal">
111140
<TextBlock>▦</TextBlock>
@@ -189,7 +218,7 @@
189218
</GroupBox>
190219

191220
<!-- Expansion Controls -->
192-
<GroupBox Margin="0,0,0,10">
221+
<GroupBox Grid.Row="1" Margin="0,0,0,10">
193222
<GroupBox.Header>
194223
<StackPanel Orientation="Horizontal">
195224
<TextBlock>⬍</TextBlock>
@@ -229,7 +258,7 @@
229258
</Grid>
230259
</StackPanel>
231260
</GroupBox>
232-
</StackPanel>
261+
</Grid>
233262

234263
<!-- Row 1: Actions (full width) -->
235264
<GroupBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,0,10">
@@ -238,19 +267,19 @@
238267
</GroupBox.Header>
239268
<UniformGrid Columns="3" Margin="5,0,5,2" HorizontalAlignment="Stretch">
240269
<Button x:Name="btnToggleBox" Content="Toggle Box"
241-
Height="35" Margin="2" Click="btn_toggle_box_click"
270+
Margin="2" Click="btn_toggle_box_click"
242271
MouseEnter="btn_preview_toggle_enter" MouseLeave="btn_preview_leave"/>
243272
<Button x:Name="btnHideBox" Content="(Un-)Hide Box"
244-
Height="35" Margin="2" Click="btn_hide_box_click"/>
273+
Margin="2" Click="btn_hide_box_click"/>
245274
<Button x:Name="btnAlignBoxToFace" Content="Align Box"
246-
Height="35" Margin="2" Click="btn_align_box_to_face_click"/>
275+
Margin="2" Click="btn_align_box_to_face_click"/>
247276
</UniformGrid>
248277
</GroupBox>
249278

250279
<!-- Row 2: Status Sections -->
251280

252281
<!-- Column 0: Vertical Position Status -->
253-
<GroupBox Grid.Row="2" Grid.Column="0" Margin="0,0,5,10" VerticalAlignment="Stretch">
282+
<GroupBox Grid.Row="2" Grid.Column="0" Margin="0,0,5,10" VerticalAlignment="Stretch" Background="#F5F5F5">
254283
<GroupBox.Header>
255284
<TextBlock FontWeight="Bold">Vertical Position Status</TextBlock>
256285
</GroupBox.Header>
@@ -279,7 +308,7 @@
279308
</Grid.RowDefinitions>
280309

281310
<!-- Grid Navigation Status (top half) -->
282-
<GroupBox Grid.Row="0" VerticalAlignment="Stretch">
311+
<GroupBox Grid.Row="0" VerticalAlignment="Stretch" Background="#F5F5F5">
283312
<GroupBox.Header>
284313
<StackPanel Orientation="Horizontal">
285314
<TextBlock>▦</TextBlock>
@@ -296,7 +325,7 @@
296325
</GroupBox>
297326

298327
<!-- Expand/Shrink + Actions Status (bottom half) -->
299-
<GroupBox Grid.Row="2" VerticalAlignment="Stretch">
328+
<GroupBox Grid.Row="2" VerticalAlignment="Stretch" Background="#F5F5F5">
300329
<GroupBox.Header>
301330
<StackPanel Orientation="Horizontal">
302331
<TextBlock>⬍</TextBlock>

0 commit comments

Comments
 (0)