ux: main tab bar style

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-10-13 16:25:35 +08:00
parent 5d7d3d9939
commit 99d1d69d4d
3 changed files with 20 additions and 8 deletions

View File

@@ -32,7 +32,7 @@
<Color x:Key="Color.Window">#FF252525</Color>
<Color x:Key="Color.WindowBorder">#FF444444</Color>
<Color x:Key="Color.TitleBar">#FF1F1F1F</Color>
<Color x:Key="Color.ToolBar">#FF2C2C2C</Color>
<Color x:Key="Color.ToolBar">#FF2F2F2F</Color>
<Color x:Key="Color.Popup">#FF2B2B2B</Color>
<Color x:Key="Color.Contents">#FF1C1C1C</Color>
<Color x:Key="Color.Badge">#FF8F8F8F</Color>

View File

@@ -42,7 +42,8 @@
<ListBox.ItemTemplate>
<DataTemplate DataType="vm:LauncherPage">
<Border Height="30"
<Border Width="{Binding Source={x:Static vm:Preferences.Instance}, Path=UseFixedTabWidth, Converter={x:Static c:BoolConverters.ToPageTabWidth}}" Height="30"
Padding="0,2,0,0"
Background="Transparent"
PointerPressed="OnPointerPressedTab"
PointerMoved="OnPointerMovedOverTab"
@@ -61,7 +62,7 @@
</Grid>
</ToolTip.Tip>
<Grid Width="{Binding Source={x:Static vm:Preferences.Instance}, Path=UseFixedTabWidth, Converter={x:Static c:BoolConverters.ToPageTabWidth}}" Height="30" ColumnDefinitions="Auto,*,Auto" VerticalAlignment="Center">
<Grid ColumnDefinitions="Auto,*,Auto">
<Path Grid.Column="0"
Width="12" Height="12" Margin="12,0"
Fill="{Binding Node.Bookmark, Converter={x:Static c:IntConverters.ToBookmarkBrush}}"
@@ -84,7 +85,7 @@
Width="8" Height="8"
Margin="0,0,6,0"
VerticalAlignment="Center"
IsVisible="{Binding DirtyState, Converter={x:Static ObjectConverters.IsNotNull}, ConverterParameter={x:Static m:DirtyState.None}}"
IsVisible="{Binding DirtyState, Converter={x:Static ObjectConverters.NotEqual}, ConverterParameter={x:Static m:DirtyState.None}}"
Fill="{Binding DirtyState, Converter={x:Static c:DirtyStateConverters.ToBrush}}"/>
<TextBlock Grid.Column="1"
@@ -107,7 +108,7 @@
<Button Grid.Column="2"
Classes="icon_button"
Width="16" Height="16" Margin="12,0"
Width="12" Height="12" Margin="12,0"
Click="OnCloseTab">
<ToolTip.Tip>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
@@ -129,7 +130,7 @@
<Button Classes="icon_button"
Width="16" Height="16"
Margin="8,0"
Margin="8,2,8,0"
Command="{Binding AddNewTab}"
IsVisible="{Binding !#ThisControl.IsScrollerVisible}">
<ToolTip.Tip>

View File

@@ -38,7 +38,18 @@ namespace SourceGit.Views
var selectedIdx = LauncherTabsList.SelectedIndex;
var count = LauncherTabsList.ItemCount;
var separatorPen = new Pen(this.FindResource("Brush.FG2") as IBrush, 0.5);
var separatorY = (height - 20) * 0.5;
var separatorY = (height - 18) * 0.5 + 1;
if (!IsScrollerVisible && selectedIdx > 0)
{
var container = LauncherTabsList.ContainerFromIndex(0);
if (container != null)
{
var x = container.Bounds.Left - startX + LauncherTabsScroller.Bounds.X;
context.DrawLine(separatorPen, new Point(x, separatorY), new Point(x, separatorY + 18));
}
}
for (var i = 0; i < count; i++)
{
if (i == selectedIdx || i == selectedIdx - 1)
@@ -56,7 +67,7 @@ namespace SourceGit.Views
break;
var separatorX = containerEndX - startX + LauncherTabsScroller.Bounds.X;
context.DrawLine(separatorPen, new Point(separatorX, separatorY), new Point(separatorX, separatorY + 20));
context.DrawLine(separatorPen, new Point(separatorX, separatorY), new Point(separatorX, separatorY + 18));
}
var selected = LauncherTabsList.ContainerFromIndex(selectedIdx);