From 9b471982293dd7a8fd1edb7f4b7984dcf5316e58 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 11 Sep 2024 10:08:31 +0800 Subject: [PATCH] fix: the width of `ConfigureWorkspace` window sometimes tool small (#458) --- src/Views/ColorPicker.cs | 15 ++++++++++++--- src/Views/ConfigureWorkspace.axaml | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Views/ColorPicker.cs b/src/Views/ColorPicker.cs index 66e4501a..23355376 100644 --- a/src/Views/ColorPicker.cs +++ b/src/Views/ColorPicker.cs @@ -93,8 +93,6 @@ namespace SourceGit.Views base.Render(context); // Color table. - var border = this.FindResource("Brush.Border0") as IBrush; - var pen = new Pen(border, 0.2); { for (int i = 0; i < 6; i++) { @@ -103,11 +101,22 @@ namespace SourceGit.Views var idx = i * 8 + j; var x = j * 32.0; var y = i * 32.0; - context.DrawRectangle(new SolidColorBrush(COLOR_TABLE[i, j]), pen, new Rect(x, y, 32, 32)); + context.FillRectangle(new SolidColorBrush(COLOR_TABLE[i, j]), new Rect(x, y, 32, 32)); + if (idx == _hightlightedTableElement) context.DrawRectangle(new Pen(Brushes.White, 2), new Rect(x + 2, y + 2, 28, 28)); } } + + var border = this.FindResource("Brush.Border0") as IBrush; + var pen = new Pen(border, 0.4); + for (int i = 1; i < 6; i++) + { + for (int j = 1; j < 8; j++) + context.DrawLine(pen, new Point(j * 32, 0), new Point(j * 32, 192)); + + context.DrawLine(pen, new Point(0, i * 32), new Point(256, i * 32)); + } } // Palette picker diff --git a/src/Views/ConfigureWorkspace.axaml b/src/Views/ConfigureWorkspace.axaml index cb5ba607..95b7e91a 100644 --- a/src/Views/ConfigureWorkspace.axaml +++ b/src/Views/ConfigureWorkspace.axaml @@ -46,7 +46,7 @@ - + @@ -104,12 +104,12 @@ - + - +