Skip to content

Commit 99d1d69

Browse files
committed
ux: main tab bar style
Signed-off-by: leo <[email protected]>
1 parent 5d7d3d9 commit 99d1d69

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

src/Resources/Themes.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<Color x:Key="Color.Window">#FF252525</Color>
3333
<Color x:Key="Color.WindowBorder">#FF444444</Color>
3434
<Color x:Key="Color.TitleBar">#FF1F1F1F</Color>
35-
<Color x:Key="Color.ToolBar">#FF2C2C2C</Color>
35+
<Color x:Key="Color.ToolBar">#FF2F2F2F</Color>
3636
<Color x:Key="Color.Popup">#FF2B2B2B</Color>
3737
<Color x:Key="Color.Contents">#FF1C1C1C</Color>
3838
<Color x:Key="Color.Badge">#FF8F8F8F</Color>

src/Views/LauncherTabBar.axaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242

4343
<ListBox.ItemTemplate>
4444
<DataTemplate DataType="vm:LauncherPage">
45-
<Border Height="30"
45+
<Border Width="{Binding Source={x:Static vm:Preferences.Instance}, Path=UseFixedTabWidth, Converter={x:Static c:BoolConverters.ToPageTabWidth}}" Height="30"
46+
Padding="0,2,0,0"
4647
Background="Transparent"
4748
PointerPressed="OnPointerPressedTab"
4849
PointerMoved="OnPointerMovedOverTab"
@@ -61,7 +62,7 @@
6162
</Grid>
6263
</ToolTip.Tip>
6364

64-
<Grid Width="{Binding Source={x:Static vm:Preferences.Instance}, Path=UseFixedTabWidth, Converter={x:Static c:BoolConverters.ToPageTabWidth}}" Height="30" ColumnDefinitions="Auto,*,Auto" VerticalAlignment="Center">
65+
<Grid ColumnDefinitions="Auto,*,Auto">
6566
<Path Grid.Column="0"
6667
Width="12" Height="12" Margin="12,0"
6768
Fill="{Binding Node.Bookmark, Converter={x:Static c:IntConverters.ToBookmarkBrush}}"
@@ -84,7 +85,7 @@
8485
Width="8" Height="8"
8586
Margin="0,0,6,0"
8687
VerticalAlignment="Center"
87-
IsVisible="{Binding DirtyState, Converter={x:Static ObjectConverters.IsNotNull}, ConverterParameter={x:Static m:DirtyState.None}}"
88+
IsVisible="{Binding DirtyState, Converter={x:Static ObjectConverters.NotEqual}, ConverterParameter={x:Static m:DirtyState.None}}"
8889
Fill="{Binding DirtyState, Converter={x:Static c:DirtyStateConverters.ToBrush}}"/>
8990

9091
<TextBlock Grid.Column="1"
@@ -107,7 +108,7 @@
107108

108109
<Button Grid.Column="2"
109110
Classes="icon_button"
110-
Width="16" Height="16" Margin="12,0"
111+
Width="12" Height="12" Margin="12,0"
111112
Click="OnCloseTab">
112113
<ToolTip.Tip>
113114
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
@@ -129,7 +130,7 @@
129130

130131
<Button Classes="icon_button"
131132
Width="16" Height="16"
132-
Margin="8,0"
133+
Margin="8,2,8,0"
133134
Command="{Binding AddNewTab}"
134135
IsVisible="{Binding !#ThisControl.IsScrollerVisible}">
135136
<ToolTip.Tip>

src/Views/LauncherTabBar.axaml.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,18 @@ public override void Render(DrawingContext context)
3838
var selectedIdx = LauncherTabsList.SelectedIndex;
3939
var count = LauncherTabsList.ItemCount;
4040
var separatorPen = new Pen(this.FindResource("Brush.FG2") as IBrush, 0.5);
41-
var separatorY = (height - 20) * 0.5;
41+
var separatorY = (height - 18) * 0.5 + 1;
42+
43+
if (!IsScrollerVisible && selectedIdx > 0)
44+
{
45+
var container = LauncherTabsList.ContainerFromIndex(0);
46+
if (container != null)
47+
{
48+
var x = container.Bounds.Left - startX + LauncherTabsScroller.Bounds.X;
49+
context.DrawLine(separatorPen, new Point(x, separatorY), new Point(x, separatorY + 18));
50+
}
51+
}
52+
4253
for (var i = 0; i < count; i++)
4354
{
4455
if (i == selectedIdx || i == selectedIdx - 1)
@@ -56,7 +67,7 @@ public override void Render(DrawingContext context)
5667
break;
5768

5869
var separatorX = containerEndX - startX + LauncherTabsScroller.Bounds.X;
59-
context.DrawLine(separatorPen, new Point(separatorX, separatorY), new Point(separatorX, separatorY + 20));
70+
context.DrawLine(separatorPen, new Point(separatorX, separatorY), new Point(separatorX, separatorY + 18));
6071
}
6172

6273
var selected = LauncherTabsList.ContainerFromIndex(selectedIdx);

0 commit comments

Comments
 (0)