Skip to content

Commit 68e8f23

Browse files
committed
improve ui ux
1 parent 0fb62ee commit 68e8f23

File tree

2 files changed

+72
-69
lines changed

2 files changed

+72
-69
lines changed

RevitPythonShell/Views/IronPythonConsole.xaml

Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,16 @@
1414
-->
1515
<Grid>
1616
<Grid.RowDefinitions>
17-
<RowDefinition Height="50*" />
18-
<RowDefinition Height="Auto" />
19-
<RowDefinition Height="30*" />
17+
<RowDefinition Height="30" />
18+
<RowDefinition Height="20*" />
19+
<RowDefinition Height="10" />
20+
<RowDefinition Height="12*" />
2021
</Grid.RowDefinitions>
2122
<Grid.ColumnDefinitions>
2223
<ColumnDefinition Width="1*" />
2324
<ColumnDefinition Width="Auto" />
2425
</Grid.ColumnDefinitions>
25-
<Grid Grid.Column="0" Grid.Row="0">
26-
<console:IronPythonConsoleControl Name="consoleControl" />
27-
</Grid>
28-
<GridSplitter
29-
Grid.Row="1"
30-
Height="10"
31-
HorizontalAlignment="Stretch"
32-
VerticalAlignment="Center" />
33-
<DockPanel Grid.Column="0" Grid.Row="2">
26+
<DockPanel Grid.Column="0" Grid.Row="0">
3427
<ToolBar DockPanel.Dock="Top">
3528
<ToolBar.Resources>
3629
<Style TargetType="{x:Type Image}">
@@ -43,103 +36,112 @@
4336
</ToolBar.Resources>
4437
<Button Click="openFileClick">
4538
<Image
46-
Height="16"
47-
SnapsToDevicePixels="True"
48-
Source="/RevitPythonShell;component/Resources/Theme/Open.png"
49-
ToolTip="Open Python Script" />
39+
Height="16"
40+
SnapsToDevicePixels="True"
41+
Source="/RevitPythonShell;component/Resources/Theme/Open.png"
42+
ToolTip="Open Python Script" />
5043
</Button>
5144
<Button Click="saveFileClick">
5245
<Image
53-
Height="16"
54-
SnapsToDevicePixels="True"
55-
Source="/RevitPythonShell;component/Resources/Theme/Save.png"
56-
ToolTip="Save This Script Into File" />
46+
Height="16"
47+
SnapsToDevicePixels="True"
48+
Source="/RevitPythonShell;component/Resources/Theme/Save.png"
49+
ToolTip="Save This Script Into File" />
5750
</Button>
5851
<Separator />
5952
<Button Command="Cut">
6053
<Image
61-
Height="16"
62-
SnapsToDevicePixels="True"
63-
Source="/RevitPythonShell;component/Resources/Theme/Cut.png"
64-
ToolTip="Cut Selected" />
54+
Height="16"
55+
SnapsToDevicePixels="True"
56+
Source="/RevitPythonShell;component/Resources/Theme/Cut.png"
57+
ToolTip="Cut Selected" />
6558
</Button>
6659
<Button Command="Copy">
6760
<Image
68-
Height="16"
69-
SnapsToDevicePixels="True"
70-
Source="/RevitPythonShell;component/Resources/Theme/Copy.png"
71-
ToolTip="Copy Selected" />
61+
Height="16"
62+
SnapsToDevicePixels="True"
63+
Source="/RevitPythonShell;component/Resources/Theme/Copy.png"
64+
ToolTip="Copy Selected" />
7265
</Button>
7366
<Button Command="Paste">
7467
<Image
75-
Height="16"
76-
SnapsToDevicePixels="True"
77-
Source="/RevitPythonShell;component/Resources/Theme/Paste.png"
78-
ToolTip="Paste Into Script Editor" />
68+
Height="16"
69+
SnapsToDevicePixels="True"
70+
Source="/RevitPythonShell;component/Resources/Theme/Paste.png"
71+
ToolTip="Paste Into Script Editor" />
7972
</Button>
8073
<Button Command="Delete">
8174
<Image
82-
Height="16"
83-
SnapsToDevicePixels="True"
84-
Source="/RevitPythonShell;component/Resources/Theme/Delete.png"
85-
ToolTip="Delete Selected" />
75+
Height="16"
76+
SnapsToDevicePixels="True"
77+
Source="/RevitPythonShell;component/Resources/Theme/Delete.png"
78+
ToolTip="Delete Selected" />
8679
</Button>
8780
<Separator />
8881
<Button Command="Undo">
8982
<Image
90-
Height="16"
91-
SnapsToDevicePixels="True"
92-
Source="/RevitPythonShell;component/Resources/Theme/Undo.png"
93-
ToolTip="Undo" />
83+
Height="16"
84+
SnapsToDevicePixels="True"
85+
Source="/RevitPythonShell;component/Resources/Theme/Undo.png"
86+
ToolTip="Undo" />
9487
</Button>
9588
<Button Command="Redo">
9689
<Image
97-
Height="16"
98-
SnapsToDevicePixels="True"
99-
Source="/RevitPythonShell;component/Resources/Theme/Redo.png"
100-
ToolTip="Redo" />
90+
Height="16"
91+
SnapsToDevicePixels="True"
92+
Source="/RevitPythonShell;component/Resources/Theme/Redo.png"
93+
ToolTip="Redo" />
10194
</Button>
10295
<Separator />
10396
<CheckBox IsChecked="{Binding ElementName=textEditor, Path=WordWrap}">
10497
<Image
105-
Height="16"
106-
SnapsToDevicePixels="True"
107-
Source="/RevitPythonShell;component/Resources/Theme/WordWrap.png"
108-
ToolTip="Toggle Word Wrap" />
98+
Height="16"
99+
SnapsToDevicePixels="True"
100+
Source="/RevitPythonShell;component/Resources/Theme/WordWrap.png"
101+
ToolTip="Toggle Word Wrap" />
109102
</CheckBox>
110103
<CheckBox IsChecked="{Binding ElementName=textEditor, Path=ShowLineNumbers}">
111104
<Image
112-
Height="16"
113-
SnapsToDevicePixels="True"
114-
Source="/RevitPythonShell;component/Resources/Theme/Number.png"
115-
ToolTip="Toggle Line Numbers" />
105+
Height="16"
106+
SnapsToDevicePixels="True"
107+
Source="/RevitPythonShell;component/Resources/Theme/Number.png"
108+
ToolTip="Toggle Line Numbers" />
116109
</CheckBox>
117110
<CheckBox IsChecked="{Binding ElementName=textEditor, Path=Options.ShowEndOfLine}">
118111
<Image
119-
Height="16"
120-
SnapsToDevicePixels="True"
121-
Source="/RevitPythonShell;component/Resources/Theme/Paragraph.png"
122-
ToolTip="Toggle Show End of Line" />
112+
Height="16"
113+
SnapsToDevicePixels="True"
114+
Source="/RevitPythonShell;component/Resources/Theme/Paragraph.png"
115+
ToolTip="Toggle Show End of Line" />
123116
</CheckBox>
124117
<Separator />
125118
<Button Click="runClick">
126119
<Image
127-
Height="16"
128-
SnapsToDevicePixels="True"
129-
Source="/RevitPythonShell;component/Resources/Theme/Run.png"
130-
ToolTip="Run Script. Results will be displayed in the IronPython prompt." />
120+
Height="16"
121+
SnapsToDevicePixels="True"
122+
Source="/RevitPythonShell;component/Resources/Theme/Run.png"
123+
ToolTip="Run Script. Results will be displayed in the IronPython prompt." />
131124
</Button>
132125
</ToolBar>
133-
<Grid DockPanel.Dock="Bottom">
134-
<avalonEdit:TextEditor
135-
FontFamily="Consolas"
136-
FontSize="10pt"
137-
GotFocus="textEditor_GotFocus"
138-
Name="textEditor">
139-
# IronPython Pad. Write code snippets here and F5 to run.
140-
</avalonEdit:TextEditor>
141-
</Grid>
142126
</DockPanel>
127+
<Grid Grid.Column="0" Grid.Row="1">
128+
<avalonEdit:TextEditor
129+
FontFamily="Consolas"
130+
FontSize="10pt"
131+
GotFocus="textEditor_GotFocus"
132+
Name="textEditor">
133+
# IronPython Pad. Write code snippets here and F5 to run.
134+
</avalonEdit:TextEditor>
135+
</Grid>
136+
<GridSplitter
137+
Grid.Row="2"
138+
Height="10"
139+
HorizontalAlignment="Stretch"
140+
VerticalAlignment="Center" />
141+
142+
<Grid Grid.Row="3" MinHeight="20">
143+
<console:IronPythonConsoleControl Name="consoleControl" />
144+
</Grid>
143145

144146
</Grid>
145147
</Window>

RevitPythonShell/Views/IronPythonConsole.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public IronPythonConsole()
5151
private void MainWindow_Initialized(object sender, EventArgs e)
5252
{
5353
//propertyGridComboBox.SelectedIndex = 1;
54+
textEditor.ShowLineNumbers = true;
5455
}
5556

5657
private void openFileClick(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)