Skip to content

Commit 9b47198

Browse files
committed
fix: the width of ConfigureWorkspace window sometimes tool small (#458)
1 parent f314da5 commit 9b47198

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/Views/ColorPicker.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ public override void Render(DrawingContext context)
9393
base.Render(context);
9494

9595
// Color table.
96-
var border = this.FindResource("Brush.Border0") as IBrush;
97-
var pen = new Pen(border, 0.2);
9896
{
9997
for (int i = 0; i < 6; i++)
10098
{
@@ -103,11 +101,22 @@ public override void Render(DrawingContext context)
103101
var idx = i * 8 + j;
104102
var x = j * 32.0;
105103
var y = i * 32.0;
106-
context.DrawRectangle(new SolidColorBrush(COLOR_TABLE[i, j]), pen, new Rect(x, y, 32, 32));
104+
context.FillRectangle(new SolidColorBrush(COLOR_TABLE[i, j]), new Rect(x, y, 32, 32));
105+
107106
if (idx == _hightlightedTableElement)
108107
context.DrawRectangle(new Pen(Brushes.White, 2), new Rect(x + 2, y + 2, 28, 28));
109108
}
110109
}
110+
111+
var border = this.FindResource("Brush.Border0") as IBrush;
112+
var pen = new Pen(border, 0.4);
113+
for (int i = 1; i < 6; i++)
114+
{
115+
for (int j = 1; j < 8; j++)
116+
context.DrawLine(pen, new Point(j * 32, 0), new Point(j * 32, 192));
117+
118+
context.DrawLine(pen, new Point(0, i * 32), new Point(256, i * 32));
119+
}
111120
}
112121

113122
// Palette picker

src/Views/ConfigureWorkspace.axaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</Grid>
4747

4848
<!-- BODY -->
49-
<Grid Grid.Row="1" ColumnDefinitions="200,*" Height="324" Margin="8">
49+
<Grid Grid.Row="1" ColumnDefinitions="200,16,256" Height="324" Margin="8">
5050
<Border Grid.Column="0"
5151
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"
5252
Background="{DynamicResource Brush.Contents}">
@@ -104,12 +104,12 @@
104104
</Grid>
105105
</Border>
106106

107-
<ContentControl Grid.Column="1" Margin="16,0,0,0" Content="{Binding Selected}">
107+
<ContentControl Grid.Column="2" Content="{Binding Selected}">
108108
<ContentControl.DataTemplates>
109109
<DataTemplate DataType="vm:Workspace">
110110
<Grid RowDefinitions="Auto,Auto,Auto,Auto">
111111
<TextBlock Grid.Row="0" Text="{DynamicResource Text.ConfigureWorkspace.Name}"/>
112-
<TextBox Grid.Row="1" Margin="-4,4,0,0" CornerRadius="3" Height="28" Width="256" Text="{Binding Name, Mode=TwoWay}"/>
112+
<TextBox Grid.Row="1" Margin="0,4,0,0" CornerRadius="3" Height="28" Text="{Binding Name, Mode=TwoWay}"/>
113113

114114
<TextBlock Grid.Row="2" Margin="0,12,0,4" Text="{DynamicResource Text.ConfigureWorkspace.Color}"/>
115115
<v:ColorPicker Grid.Row="3" HorizontalAlignment="Left" Value="{Binding Color, Mode=TwoWay}"/>

0 commit comments

Comments
 (0)