Skip to content

Commit fdaf960

Browse files
committed
ux: use transparent tab separator pen
Signed-off-by: leo <[email protected]>
1 parent 823949a commit fdaf960

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Views/LauncherTabBar.axaml.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Avalonia.Input;
66
using Avalonia.Interactivity;
77
using Avalonia.Media;
8+
using Avalonia.Styling;
89

910
namespace SourceGit.Views
1011
{
@@ -69,7 +70,7 @@ public override void Render(DrawingContext context)
6970

7071
var selectedIdx = LauncherTabsList.SelectedIndex;
7172
var count = LauncherTabsList.ItemCount;
72-
var separatorPen = new Pen(this.FindResource("Brush.FG2") as IBrush);
73+
var separatorPen = new Pen(new SolidColorBrush(ActualThemeVariant == ThemeVariant.Dark ? Colors.White : Colors.Black, 0.2));
7374
var separatorY = (height - 18) * 0.5 + 1;
7475

7576
if (!IsScrollerVisible && selectedIdx > 0)
@@ -152,6 +153,14 @@ public override void Render(DrawingContext context)
152153
context.DrawGeometry(fill, stroke, geo);
153154
}
154155

156+
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
157+
{
158+
base.OnPropertyChanged(change);
159+
160+
if (change.Property.Name == nameof(ActualThemeVariant))
161+
InvalidateVisual();
162+
}
163+
155164
private void ScrollTabs(object _, PointerWheelEventArgs e)
156165
{
157166
if (!e.KeyModifiers.HasFlag(KeyModifiers.Shift))

0 commit comments

Comments
 (0)