|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
5 | 5 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
6 | | - xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" |
| 6 | + xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" |
7 | 7 | xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit" |
8 | 8 | xmlns:behaviors="clr-namespace:Microsoft.Xaml.Behaviors;assembly=Microsoft.Xaml.Behaviors" |
9 | 9 | xmlns:helpers="clr-namespace:CodeSnip.Helpers" |
|
25 | 25 | Width="{Binding WindowWidth, Mode=TwoWay}" Height="{Binding WindowHeight, Mode=TwoWay}" > |
26 | 26 | <!--WindowButtonCommandsOverlayBehavior="Never"--> |
27 | 27 | <mah:MetroWindow.Resources> |
28 | | - |
| 28 | + |
29 | 29 | <helpers:InverseBooleanConverter x:Key="InverseBooleanConverter" /> |
30 | 30 | <helpers:EnumToBooleanConverter x:Key="EnumToBooleanConverter" /> |
31 | 31 | <helpers:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> |
32 | | - |
| 32 | + |
33 | 33 | <DataTemplate DataType="{x:Type settingsView:SettingsViewModel}"> |
34 | 34 | <settingsView:SettingsView /> |
35 | 35 | </DataTemplate> |
|
54 | 54 | <KeyBinding Key="F1" Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=OpenAboutCommand}" /> |
55 | 55 | <!-- Ctrl + S : Save snippet code --> |
56 | 56 | <KeyBinding Key="S" Modifiers="Ctrl" Command="{Binding SaveCodeCommand}"/> |
57 | | - <!-- Ctrl+Shift + A : Add new snippet --> |
| 57 | + <!-- Ctrl + A : Add new snippet --> |
58 | 58 | <KeyBinding Key="A" Modifiers="Ctrl+Shift" Command="{Binding AddSnippetCommand}"/> |
59 | | - <!-- Ctrl+Shift + E : Edit current cnippet metadata --> |
| 59 | + <!-- Ctrl + E : Edit current cnippet metadata --> |
60 | 60 | <KeyBinding Key="E" Modifiers="Ctrl+Shift" Command="{Binding EditSnippetCommand}"/> |
61 | | - <!-- Ctrl+Shift + D : Delete current snippet --> |
| 61 | + <!-- Ctrl + D : Delete current snippet --> |
62 | 62 | <KeyBinding Key="D" Modifiers="Ctrl+Shift" Command="{Binding DeleteSnippetCommand}"/> |
63 | | - <!-- Ctrl+Shift + L : Open Language/Category management --> |
| 63 | + <!-- Ctrl + L : Open Language/Category management --> |
64 | 64 | <KeyBinding Key="L" Modifiers="Ctrl+Shift" Command="{Binding OpenLanguageCategoryCommand}"/> |
65 | | - <!-- Ctrl+Shift + P : Open application settings --> |
| 65 | + <!-- Ctrl + P : Open application settings --> |
66 | 66 | <KeyBinding Key="P" Modifiers="Ctrl+Shift" Command="{Binding OpenSettingsCommand}"/> |
67 | | - <!-- Ctrl+Shift + R : Open Code Runner window --> |
| 67 | + <!-- Ctrl + R : Open Code Runner window --> |
68 | 68 | <KeyBinding Key="R" Modifiers="Ctrl+Shift" Command="{Binding OpenCodeRunnerViewCommand}"/> |
69 | 69 | <!-- Ctrl + K : Toggle Single-Line Comment --> |
70 | 70 | <KeyBinding Key="K" Modifiers="Ctrl" |
|
74 | 74 | <KeyBinding Key="K" Modifiers="Ctrl+Shift" |
75 | 75 | Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=ToggleMultiLineCommentCommand}" /> |
76 | 76 |
|
77 | | - <!-- Ctrl + Shift + I : Toggle Inline Block Comment (selected text) --> |
| 77 | + <!-- Ctrl + Shift + I : Toggle Inline Block Comment (samo selekcija) --> |
78 | 78 | <KeyBinding Key="I" Modifiers="Ctrl+Shift" |
79 | 79 | Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=ToggleCommentSelectionCommand}" /> |
80 | 80 | <!--<KeyBinding Key="F" Modifiers="Ctrl" Command="{Binding SearchReplaceCommand}"/>--> |
|
104 | 104 | PaneBackground="{x:Null}" CanResizeOpenPane="True" MaximumOpenPaneLength="600" > |
105 | 105 | <mah:SplitView.Pane> |
106 | 106 | <Grid> |
107 | | - <GroupBox Header="Snippets" Margin="0,0,2,0"> |
| 107 | + <Grid.RowDefinitions> |
| 108 | + <RowDefinition Height="Auto"/> |
| 109 | + <!-- Search expander --> |
| 110 | + <RowDefinition Height="*"/> |
| 111 | + <!-- Snippets expander --> |
| 112 | + </Grid.RowDefinitions> |
| 113 | + <Expander Header="Search" Grid.Row="0" IsExpanded="False" Margin="0,0,2,3"> |
| 114 | + <Grid Margin="0,10,0,0" VerticalAlignment="Center"> |
| 115 | + <Grid.ColumnDefinitions> |
| 116 | + <ColumnDefinition Width="Auto" /> |
| 117 | + <!-- RadioButton "by Name" --> |
| 118 | + <ColumnDefinition Width="Auto" /> |
| 119 | + <!-- RadioButton "by Tag" --> |
| 120 | + <ColumnDefinition Width="10" /> |
| 121 | + <!-- Razmak --> |
| 122 | + <ColumnDefinition Width="*" /> |
| 123 | + <!-- TextBox za filter --> |
| 124 | + </Grid.ColumnDefinitions> |
| 125 | + <RadioButton x:Name="rbName" Content="Name" GroupName="FilterMode" |
| 126 | + Grid.Column="0" VerticalAlignment="Center" ToolTip="Search by Name" |
| 127 | + IsChecked="{Binding FilterMode, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Name}" /> |
| 128 | + <RadioButton x:Name="rbTag" Content="Tag" Grid.Column="1" Margin="10,0,0,0" GroupName="FilterMode" |
| 129 | + VerticalAlignment="Center" ToolTip="Search by Tag" |
| 130 | + IsChecked="{Binding FilterMode, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Tag}" /> |
| 131 | + <TextBox x:Name="txtFilter" mah:TextBoxHelper.Watermark="Search snippets..." |
| 132 | + Grid.Column="3" VerticalAlignment="Center" |
| 133 | + IsEnabled="{Binding IsFilteringEnabled, Mode=TwoWay}" |
| 134 | + Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}" /> |
| 135 | + </Grid> |
| 136 | + </Expander> |
| 137 | + <Expander Header="Snippets" Grid.Row="1" IsExpanded="True" Margin="0,0,2,0"> |
108 | 138 | <Grid> |
109 | 139 | <Grid.RowDefinitions> |
110 | 140 | <RowDefinition Height="*"/> |
111 | 141 | <!-- TreeView --> |
112 | 142 | <RowDefinition Height="Auto"/> |
113 | | - <!-- Kontrole ispod TreeView-a --> |
114 | | - <RowDefinition Height="Auto"/> |
| 143 | + <!-- Snippets metadata expander --> |
115 | 144 | </Grid.RowDefinitions> |
116 | 145 | <TreeView x:Name="treeSnippets" Grid.Row="0" |
117 | 146 | ItemsSource="{Binding Languages}" |
118 | | - SelectedItemChanged="TreeView_SelectedItemChanged" > |
| 147 | + SelectedItemChanged="TreeView_SelectedItemChanged"> |
119 | 148 | <TreeView.Resources> |
120 | 149 | <!-- Ikona za jezik --> |
121 | 150 | <Geometry x:Key="LanguageIcon">M9,15h6m-3,3V12M14,2v6h6M14,2H6A2,2 0 0 0 4,4v16a2,2 0 0 0 2,2h12a2,2 0 0 0 2,-2V8Z</Geometry> |
|
160 | 189 | </TreeView.ItemTemplate> |
161 | 190 | </TreeView> |
162 | 191 | <!-- Kontrole ispod TreeView-a --> |
163 | | - <Grid Grid.Row="1" Margin="0,10,0,0"> |
164 | | - <Grid.RowDefinitions> |
165 | | - <RowDefinition Height="Auto"/> |
166 | | - <!-- Labela Description --> |
167 | | - <RowDefinition Height="*"/> |
168 | | - <!-- TextBox za Description --> |
169 | | - <RowDefinition Height="Auto"/> |
170 | | - <!-- Labela Tag --> |
171 | | - <RowDefinition Height="Auto"/> |
172 | | - <!-- TextBox za Tag --> |
173 | | - <RowDefinition Height="Auto"/> |
174 | | - <!-- RadioButtons i Filter --> |
175 | | - </Grid.RowDefinitions> |
176 | | - <!-- Description label --> |
177 | | - <TextBlock Text="Description:" Margin="0,5,0,5" Grid.Row="0" /> |
178 | | - <!-- Description TextBox koji se rasteže --> |
179 | | - <TextBox x:Name="txtDescription" Grid.Row="1" TextWrapping="Wrap" |
| 192 | + <Expander Header="Snippet Metadata" Grid.Row="1" IsExpanded="False" Margin="0,10,0,0"> |
| 193 | + <Grid> |
| 194 | + <Grid.RowDefinitions> |
| 195 | + <RowDefinition Height="Auto"/> |
| 196 | + <!-- Labela Description --> |
| 197 | + <RowDefinition Height="*"/> |
| 198 | + <!-- TextBox za Description --> |
| 199 | + <RowDefinition Height="Auto"/> |
| 200 | + <!-- Labela Tag --> |
| 201 | + <RowDefinition Height="Auto"/> |
| 202 | + <!-- TextBox za Tag --> |
| 203 | + </Grid.RowDefinitions> |
| 204 | + <!-- Description label --> |
| 205 | + <TextBlock Text="Description:" Margin="0,5,0,5" Grid.Row="0" /> |
| 206 | + <!-- Description TextBox koji se rasteže --> |
| 207 | + <TextBox x:Name="txtDescription" Grid.Row="1" TextWrapping="Wrap" |
180 | 208 | VerticalScrollBarVisibility="Auto" Height="80" IsReadOnly="True" |
181 | 209 | Text="{Binding SelectedSnippet.Description}" Focusable="False"/> |
182 | | - <!-- Tag label --> |
183 | | - <TextBlock Text="Tag:" Margin="0,10,0,5" Grid.Row="2" /> |
184 | | - <!-- Tag TextBox --> |
185 | | - <TextBox x:Name="txtTag" Grid.Row="3" Text="{Binding SelectedSnippet.Tag}" IsReadOnly="True" Focusable="False"/> |
186 | | - <!-- RadioButtons i Filter --> |
187 | | - <Grid Margin="0,10,0,0" VerticalAlignment="Center" Grid.Row="4"> |
188 | | - <Grid.ColumnDefinitions> |
189 | | - <ColumnDefinition Width="Auto" /> |
190 | | - <!-- RadioButton "by Name" --> |
191 | | - <ColumnDefinition Width="Auto" /> |
192 | | - <!-- RadioButton "by Tag" --> |
193 | | - <ColumnDefinition Width="10" /> |
194 | | - <!-- Razmak --> |
195 | | - <ColumnDefinition Width="*" /> |
196 | | - <!-- TextBox za filter --> |
197 | | - </Grid.ColumnDefinitions> |
198 | | - |
199 | | - <RadioButton x:Name="rbName" Content="by Name" GroupName="FilterMode" |
200 | | - Grid.Column="0" VerticalAlignment="Center" ToolTip="Search by Name" |
201 | | - IsChecked="{Binding FilterMode, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Name}" /> |
202 | | - <RadioButton x:Name="rbTag" Content="by Tag" Grid.Column="1" Margin="10,0,0,0" GroupName="FilterMode" |
203 | | - VerticalAlignment="Center" ToolTip="Search by Tag" |
204 | | - IsChecked="{Binding FilterMode, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter=Tag}" /> |
205 | | - <TextBox x:Name="txtFilter" mah:TextBoxHelper.Watermark="Search snippets..." |
206 | | - Grid.Column="3" VerticalAlignment="Center" |
207 | | - IsEnabled="{Binding IsFilteringEnabled, Mode=TwoWay}" |
208 | | - Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}" /> |
| 210 | + <!-- Tag label --> |
| 211 | + <TextBlock Text="Tag:" Margin="0,10,0,5" Grid.Row="2" /> |
| 212 | + <!-- Tag TextBox --> |
| 213 | + <TextBox x:Name="txtTag" Grid.Row="3" Text="{Binding SelectedSnippet.Tag}" IsReadOnly="True" Focusable="False"/> |
209 | 214 | </Grid> |
210 | | - </Grid> |
| 215 | + </Expander> |
211 | 216 | </Grid> |
212 | | - </GroupBox> |
| 217 | + </Expander> |
213 | 218 | </Grid> |
214 | 219 | </mah:SplitView.Pane> |
215 | 220 | <Grid> |
|
221 | 226 | <RowDefinition Height="Auto" /> |
222 | 227 | <!-- Status bar --> |
223 | 228 | </Grid.RowDefinitions> |
224 | | - <!--<StackPanel Grid.Row="0" Orientation="Horizontal">--> |
225 | 229 | <ToolBarTray Grid.Row="0"> |
226 | 230 | <ToolBar x:Name="toolbarMain" Height="40" > |
227 | 231 | <Button Command="{Binding TogglePanelCommand}" ToolTip="Collapse/Expand"> |
|
279 | 283 | <Path Data="{StaticResource ZoomOutMap}" Fill="{DynamicResource MahApps.Brushes.AccentBase}" |
280 | 284 | Width="20" Height="20" Stretch="Uniform" /> |
281 | 285 | </Button> |
282 | | - <Button Margin="5,0,0,0" ToolTip="Search-Replace
Ctrl+F" Command="{Binding SearchReplaceCommand}" > |
| 286 | + <Button Margin="5,0,0,0" ToolTip="Search / Replace" Command="{Binding SearchReplaceCommand}" > |
283 | 287 | <Path Data="{StaticResource TextSearch}" Fill="{DynamicResource MahApps.Brushes.AccentBase}" |
284 | 288 | Width="20" Height="20" Stretch="Uniform" /> |
285 | 289 | </Button> |
|
299 | 303 |
|
300 | 304 | </ToolBar> |
301 | 305 | </ToolBarTray> |
302 | | - <!--</StackPanel>--> |
303 | 306 | <avalonEdit:TextEditor |
304 | 307 | x:Name="textEditor" |
305 | 308 | Grid.Row="1" |
|
0 commit comments