|
7 | 7 | xmlns:local="clr-namespace:CodeSnip.Views.HighlightingEditorView" |
8 | 8 | xmlns:behaviors="clr-namespace:Microsoft.Xaml.Behaviors;assembly=Microsoft.Xaml.Behaviors" |
9 | 9 | xmlns:helpers="clr-namespace:CodeSnip.Helpers" |
| 10 | + d:DataContext="{d:DesignInstance Type={x:Type local:HighlightingEditorViewModel}}" |
10 | 11 | x:Name="flyHighlightingEditor" |
11 | 12 | MinWidth="500" |
12 | | - MaxWidth="600" |
13 | | - mah:HeaderedControlHelper.HeaderMargin="10" |
| 13 | + MaxWidth="600" |
14 | 14 | mc:Ignorable="d" |
15 | 15 | d:DesignHeight="400" |
16 | 16 | d:DesignWidth="300"> |
|
24 | 24 | <TextBlock Grid.Row="0" Text="{Binding Message}" FontWeight="Bold" Margin="0,0,0,10" /> |
25 | 25 | <ListBox Grid.Row="1" |
26 | 26 | ItemsSource="{Binding HighlightingColors}" |
27 | | - SelectedItem="{Binding SelectedColor, Mode=TwoWay}"> |
| 27 | + SelectedItem="{Binding SelectedColor, Mode=TwoWay}" |
| 28 | + ScrollViewer.HorizontalScrollBarVisibility="Disabled" > |
28 | 29 | <ListBox.ItemTemplate> |
29 | 30 | <DataTemplate> |
30 | | - <Border BorderBrush="LightGray" BorderThickness="0,0,0,1" Padding="2"> |
31 | | - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" > |
32 | | - <TextBlock Text="{Binding Name}" Width="120" VerticalAlignment="Center" /> |
33 | | - <Rectangle Width="16" Height="16" Margin="5,0,0,0" VerticalAlignment="Center"> |
| 31 | + <Border BorderBrush="{DynamicResource MahApps.Brushes.Gray3}" BorderThickness="0,0,0,1" Padding="2"> |
| 32 | + <Grid VerticalAlignment="Center"> |
| 33 | + <Grid.ColumnDefinitions> |
| 34 | + <ColumnDefinition Width="2*" /> |
| 35 | + <!-- Name --> |
| 36 | + <ColumnDefinition Width="Auto" /> |
| 37 | + <!-- Rectangle --> |
| 38 | + <ColumnDefinition Width="Auto" /> |
| 39 | + <!-- Weight label and combobox --> |
| 40 | + <ColumnDefinition Width="Auto" /> |
| 41 | + <!-- Style label and combobox --> |
| 42 | + </Grid.ColumnDefinitions> |
| 43 | + |
| 44 | + <TextBlock Text="{Binding Name}" Grid.Column="0" VerticalAlignment="Center" |
| 45 | + TextTrimming="CharacterEllipsis" ToolTip="{Binding Name}" /> |
| 46 | + |
| 47 | + <Rectangle Width="16" Height="16" Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="1"> |
34 | 48 | <Rectangle.Fill> |
35 | 49 | <SolidColorBrush Color="{Binding Foreground}" /> |
36 | 50 | </Rectangle.Fill> |
37 | 51 | </Rectangle> |
38 | 52 |
|
39 | | - <!-- Label i ComboBox za FontWeight --> |
40 | | - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,0"> |
| 53 | + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,0" Grid.Column="2"> |
41 | 54 | <TextBlock Text="Weight:" VerticalAlignment="Center" Margin="0,0,5,0" /> |
42 | 55 | <ComboBox Width="80" |
43 | | - SelectedItem="{Binding FontWeight, Mode=TwoWay}" |
44 | | - ItemsSource="{Binding AvailableFontWeights}" |
45 | | - IsEditable="False" |
46 | | - VerticalAlignment="Center"> |
| 56 | + SelectedItem="{Binding FontWeight, Mode=TwoWay}" |
| 57 | + ItemsSource="{Binding AvailableFontWeights}" |
| 58 | + IsEditable="False" |
| 59 | + VerticalAlignment="Center"> |
47 | 60 | <ComboBox.ItemTemplate> |
48 | 61 | <DataTemplate> |
49 | 62 | <TextBlock Text="{Binding}" /> |
50 | 63 | </DataTemplate> |
51 | 64 | </ComboBox.ItemTemplate> |
52 | 65 | </ComboBox> |
53 | 66 | </StackPanel> |
54 | | - <!-- Label i ComboBox za FontStyle --> |
55 | | - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,0"> |
| 67 | + |
| 68 | + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,0" Grid.Column="3"> |
56 | 69 | <TextBlock Text="Style:" VerticalAlignment="Center" Margin="0,0,5,0" /> |
57 | 70 | <ComboBox Width="80" |
58 | | - SelectedItem="{Binding FontStyle, Mode=TwoWay}" |
59 | | - ItemsSource="{Binding AvailableFontStyles}" |
60 | | - IsEditable="False" |
61 | | - VerticalAlignment="Center"> |
| 71 | + SelectedItem="{Binding FontStyle, Mode=TwoWay}" |
| 72 | + ItemsSource="{Binding AvailableFontStyles}" |
| 73 | + IsEditable="False" |
| 74 | + VerticalAlignment="Center"> |
62 | 75 | <ComboBox.ItemTemplate> |
63 | 76 | <DataTemplate> |
64 | 77 | <TextBlock Text="{Binding}" /> |
65 | 78 | </DataTemplate> |
66 | 79 | </ComboBox.ItemTemplate> |
67 | 80 | </ComboBox> |
68 | 81 | </StackPanel> |
69 | | - </StackPanel> |
| 82 | + </Grid> |
70 | 83 | </Border> |
71 | 84 | </DataTemplate> |
72 | 85 | </ListBox.ItemTemplate> |
|
0 commit comments