style<*>: more flat-style theme

This commit is contained in:
leo 2021-04-02 11:34:08 +08:00
parent e370f93458
commit a163c2e4e8
15 changed files with 107 additions and 150 deletions

View file

@ -55,7 +55,7 @@ namespace SourceGit {
/// <summary>
/// Base URL to get avatar
/// </summary>
public string AvatarServer { get; set; } = "https://www.gravatar.com/avatar";
public string AvatarServer { get; set; } = "https://www.gravatar.com/avatar/";
/// <summary>
/// Main window width
/// </summary>

View file

@ -13,9 +13,8 @@
<Geometry x:Key="Icon.ScrollLeft">M753.613 996.727L269.38 511.505 754.602 27.272z</Geometry>
<Geometry x:Key="Icon.ScrollRight">M270.387 27.273L754.62 512.495 269.398 996.728z</Geometry>
<Geometry x:Key="Icon.Minimize">F1M0,6L0,9 9,9 9,6 0,6z</Geometry>
<Geometry x:Key="Icon.Maximize">F1M0,0L0,9 9,9 9,0 0,0 0,3 8,3 8,8 1,8 1,3z</Geometry>
<Geometry x:Key="Icon.Restore">F1M0,10L0,3 3,3 3,0 10,0 10,2 4,2 4,3 7,3 7,6 6,6 6,5 1,5 1,10z M1,10L7,10 7,7 10,7 10,2 9,2 9,6 6,6 6,9 1,9z</Geometry>
<Geometry x:Key="Icon.Minimize">M256 810.666667h512v85.333333H256z</Geometry>
<Geometry x:Key="Icon.Maximize">M255.13 382.7h425.11v382.65h-425.1l-0.01-382.65z m42.64 340.17l340.09-0.09V425.34H297.77v297.53z m382.46-85.1h42.64V340.32H382.7v42.38h-42.38v-85.02h425l0.04 382.47h-85.21l0.08-42.38z</Geometry>
<Geometry x:Key="Icon.Close">M810.666667 273.493333L750.506667 213.333333 512 451.84 273.493333 213.333333 213.333333 273.493333 451.84 512 213.333333 750.506667 273.493333 810.666667 512 572.16 750.506667 810.666667 810.666667 750.506667 572.16 512z</Geometry>
<Geometry x:Key="Icon.Check">M512 597.33333332m-1.26648097 0a1.26648097 1.26648097 0 1 0 2.53296194 0 1.26648097 1.26648097 0 1 0-2.53296194 0ZM809.691429 392.777143L732.16 314.514286 447.634286 599.771429 292.571429 443.977143 214.308571 521.508571l155.794286 155.794286 77.531429 77.531429 362.057143-362.057143z</Geometry>
<Geometry x:Key="Icon.Loading">M511.680999 0C233.071131 0 6.524722 222.580887 0.12872 499.655715 6.013042 257.886821 189.834154 63.960025 415.740962 63.960025c229.61649 0 415.740162 200.450718 415.740162 447.720175 0 52.958901 42.981137 95.940037 95.940038 95.940037s95.940037-42.981137 95.940037-95.940037c0-282.57539-229.104809-511.6802-511.6802-511.6802z m0 1023.3604c278.609869 0 505.156277-222.580887 511.55228-499.655715-5.884322 241.768894-189.705434 435.69569-415.612242 435.69569-229.61649 0-415.740162-200.450718-415.740163-447.720175 0-52.958901-42.981137-95.940037-95.940037-95.940038s-95.940037 42.981137-95.940037 95.940038c0 282.57539 229.104809 511.6802 511.680199 511.6802z</Geometry>

View file

@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Style.Icon" TargetType="{x:Type Path}">
<Setter Property="Width" Value="16"/>
@ -9,13 +9,4 @@
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"/>
</Style>
<Style x:Key="Style.WindowControlIcon" TargetType="{x:Type Path}">
<Setter Property="Stretch" Value="None"/>
<Setter Property="Fill" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality"/>
<Setter Property="RenderOptions.EdgeMode" Value="Aliased"/>
</Style>
</ResourceDictionary>

View file

@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Brush.Logo" Color="#FFF05133"/>
<SolidColorBrush x:Key="Brush.TitleBar" Color="#FF151515"/>
<SolidColorBrush x:Key="Brush.TitleBar" Color="#FF1F1F1F"/>
<SolidColorBrush x:Key="Brush.Window" Color="#FF252525"/>
<SolidColorBrush x:Key="Brush.NewPageHover" Color="#FF404040"/>
<SolidColorBrush x:Key="Brush.Popup" Color="#FF2B2B2B"/>
@ -15,7 +15,7 @@
<SolidColorBrush x:Key="Brush.Decorator" Color="#FF505050"/>
<SolidColorBrush x:Key="Brush.Conflict" Color="#FFFAFAD2"/>
<SolidColorBrush x:Key="Brush.Border0" Color="#FF121212"/>
<SolidColorBrush x:Key="Brush.Border0" Color="#FF101010"/>
<SolidColorBrush x:Key="Brush.Border1" Color="#FF7C7C7C"/>
<SolidColorBrush x:Key="Brush.Border2" Color="#FF404040"/>
<SolidColorBrush x:Key="Brush.Border3" Color="#FF252525"/>

View file

@ -61,23 +61,10 @@
<!-- Options -->
<StackPanel Grid.Column="2" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="Minimize" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path Style="{StaticResource Style.WindowControlIcon}" Data="{StaticResource Icon.Minimize}"/>
<Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Minimize}"/>
</Button>
<Button Click="MaximizeOrRestore" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path>
<Path.Style>
<Style TargetType="{x:Type Path}" BasedOn="{StaticResource Style.WindowControlIcon}">
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized">
<Setter Property="Data" Value="{StaticResource Icon.Restore}"/>
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal">
<Setter Property="Data" Value="{StaticResource Icon.Maximize}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
<Path Width="14" Height="14" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Maximize}"/>
</Button>
<Button Click="Quit" Width="32">
<Button.Style>

View file

@ -306,6 +306,8 @@
FontFamily="Consolas"
Visibility="{Binding ElementName=toggleSwitchMode, Path=IsChecked, Converter={StaticResource InverseBoolToCollapsed}}"
Background="{StaticResource Brush.Contents}"
BorderBrush="{StaticResource Brush.Border2}"
BorderThickness="1"
SelectedItemChanged="ChangeTreeItemSelected"
PreviewMouseWheel="TreeMouseWheel">
<TreeView.Resources>
@ -354,6 +356,8 @@
SelectionChanged="ChangeListSelectionChanged"
SelectionMode="Single"
SelectionUnit="FullRow"
BorderBrush="{StaticResource Brush.Border2}"
BorderThickness="1"
Background="{StaticResource Brush.Contents}">
<DataGrid.Resources>
<converters:FileStatusToColor x:Key="StatusColorConverter"/>
@ -400,8 +404,12 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Margin="2" Background="{StaticResource Brush.Contents}">
<TreeView x:Name="fileTree" SelectedItemChanged="FileTreeItemSelected" FontFamily="Consolas" PreviewMouseWheel="TreeMouseWheel">
<Border Grid.Column="0" Background="{StaticResource Brush.Contents}" BorderBrush="{StaticResource Brush.Border2}" BorderThickness="1">
<TreeView
x:Name="fileTree"
SelectedItemChanged="FileTreeItemSelected"
FontFamily="Consolas"
PreviewMouseWheel="TreeMouseWheel">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource Style.TreeView.ItemContainerStyle}">
<Setter Property="IsExpanded" Value="{Binding IsNodeExpanded, Mode=TwoWay}"/>
@ -435,6 +443,7 @@
</TreeView>
</Border>
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent"/>
<Border Grid.Column="2" BorderThickness="1" Margin="2,0" BorderBrush="{StaticResource Brush.Border2}">

View file

@ -490,7 +490,7 @@
</Grid>
<!-- Splitter -->
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border4}"/>
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
<!-- Right -->
<Grid Grid.Column="2">

View file

@ -61,23 +61,10 @@
<!-- Options -->
<StackPanel Grid.Column="2" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="Minimize" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path Style="{StaticResource Style.WindowControlIcon}" Data="{StaticResource Icon.Minimize}"/>
<Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Minimize}"/>
</Button>
<Button Click="MaximizeOrRestore" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path>
<Path.Style>
<Style TargetType="{x:Type Path}" BasedOn="{StaticResource Style.WindowControlIcon}">
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized">
<Setter Property="Data" Value="{StaticResource Icon.Restore}"/>
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal">
<Setter Property="Data" Value="{StaticResource Icon.Maximize}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
<Path Width="14" Height="14" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Maximize}"/>
</Button>
<Button Click="Quit" Width="32">
<Button.Style>

View file

@ -171,7 +171,7 @@
</Grid>
<!-- Split -->
<GridSplitter x:Name="splitter" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.CommitViewer}"/>
<GridSplitter x:Name="splitter" Background="{StaticResource Brush.Border0}"/>
<!-- Detail for selected commit -->
<Grid x:Name="commitDetailPanel" Background="{StaticResource Brush.CommitViewer}">

View file

@ -554,7 +554,7 @@ namespace SourceGit.UI {
if (App.Setting.UI.MoveCommitViewerRight) {
layout.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star), MinWidth = 200 });
layout.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(2) });
layout.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1) });
layout.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star), MinWidth = 200 });
Grid.SetRow(commitListPanel, 0);
@ -563,9 +563,14 @@ namespace SourceGit.UI {
Grid.SetColumn(commitListPanel, 0);
Grid.SetColumn(splitter, 1);
Grid.SetColumn(commitDetailPanel, 2);
splitter.HorizontalAlignment = HorizontalAlignment.Center;
splitter.VerticalAlignment = VerticalAlignment.Stretch;
splitter.Width = 1;
splitter.Height = double.NaN;
} else {
layout.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star), MinHeight = 100 });
layout.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(2) });
layout.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1) });
layout.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star), MinHeight = 100 });
Grid.SetRow(commitListPanel, 0);
@ -574,6 +579,11 @@ namespace SourceGit.UI {
Grid.SetColumn(commitListPanel, 0);
Grid.SetColumn(splitter, 0);
Grid.SetColumn(commitDetailPanel, 0);
splitter.HorizontalAlignment = HorizontalAlignment.Stretch;
splitter.VerticalAlignment = VerticalAlignment.Center;
splitter.Width = double.NaN;
splitter.Height = 1;
}
layout.InvalidateVisual();

View file

@ -62,23 +62,10 @@
<!-- Options -->
<StackPanel Grid.Column="2" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="Minimize" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path Style="{StaticResource Style.WindowControlIcon}" Data="{StaticResource Icon.Minimize}"/>
<Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Minimize}"/>
</Button>
<Button Click="MaximizeOrRestore" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path>
<Path.Style>
<Style TargetType="{x:Type Path}" BasedOn="{StaticResource Style.WindowControlIcon}">
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized">
<Setter Property="Data" Value="{StaticResource Icon.Restore}"/>
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal">
<Setter Property="Data" Value="{StaticResource Icon.Maximize}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
<Path Width="14" Height="14" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Maximize}"/>
</Button>
<Button Click="Quit" Width="32">
<Button.Style>

View file

@ -17,7 +17,7 @@
<!-- Enable WindowChrome Feature -->
<WindowChrome.WindowChrome>
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="32" ResizeBorderThickness="1"/>
<WindowChrome UseAeroCaptionButtons="False" CornerRadius="0" CaptionHeight="28" ResizeBorderThickness="1"/>
</WindowChrome.WindowChrome>
<!-- Window Layout -->
@ -42,31 +42,39 @@
<!-- Window Content -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition Height="28"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition x:Name="openedTabsColumn" Width="*"/>
<ColumnDefinition Width="32"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Grid.ColumnSpan="3"
<Rectangle Grid.Column="0" Grid.ColumnSpan="4"
Height="1"
VerticalAlignment="Bottom"
Fill="{StaticResource Brush.Border0}"/>
<!-- Tab scroller left -->
<Border Grid.Column="0" x:Name="tabScrollerLeft" Width="18" Height="28" BorderThickness="0,0,1,0" BorderBrush="{StaticResource Brush.Border0}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="ScrollToLeft" Margin="0" Padding="0">
<Path Width="10" Height="12" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.ScrollLeft}"/>
</Button>
</Border>
<!-- Tabs -->
<ScrollViewer x:Name="openedTabsScroller" Grid.Column="0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
<ScrollViewer x:Name="openedTabsScroller" Grid.Column="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
<TabControl x:Name="openedTabs" Padding="0" SnapsToDevicePixels="True" ItemsSource="{Binding ElementName=me, Path=Tabs}" SizeChanged="OpenedTabsSizeChanged">
<TabControl.Style>
<Style TargetType="{x:Type TabControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<StackPanel Orientation="Horizontal" Margin="4,6,4,0">
<StackPanel Orientation="Horizontal" Margin="0">
<StackPanel Orientation="Horizontal" IsItemsHost="True" SnapsToDevicePixels="True" KeyboardNavigation.TabIndex="1"/>
<Button Margin="4,0,0,0" Click="NewTab" ToolTip="{StaticResource Text.Launcher.NewPageButton}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button.Style>
@ -124,9 +132,9 @@
x:Name="Title"
Grid.Column="1"
Content="{Binding Title}"
Foreground="{StaticResource Brush.FG2}" FontFamily="Consolas" FontWeight="Bold"/>
Foreground="{StaticResource Brush.FG1}" FontFamily="Consolas" FontWeight="Bold"/>
<Button Grid.Column="3" Click="CloseTab" ToolTip="{StaticResource Text.Close}">
<Button Grid.Column="3" Click="CloseTab" Width="16" Height="16" VerticalAlignment="Center" ToolTip="{StaticResource Text.Close}" Style="{StaticResource Style.Button.HighlightHover}">
<Path
Width="8" Height="8"
Fill="{StaticResource Brush.FG1}"
@ -136,9 +144,6 @@
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsActive}" Value="True">
<Setter TargetName="Title" Property="Foreground" Value="{StaticResource Brush.FG1}"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsRepo}" Value="False">
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.NewPage}"/>
<Setter TargetName="Icon" Property="Fill" Value="{StaticResource Brush.FG1}"/>
@ -151,13 +156,6 @@
<Setter TargetName="Icon" Property="Data" Value="{StaticResource Icon.Git}"/>
<Setter TargetName="Icon" Property="Fill" Value="{StaticResource Brush.FG1}"/>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsActive}" Value="False"/>
<Condition Binding="{Binding ElementName=BG, Path=IsMouseOver}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter TargetName="Title" Property="Foreground" Value="{StaticResource Brush.FG1}"/>
</MultiDataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</TabControl.ItemTemplate>
@ -175,36 +173,29 @@
<Grid x:Name="Container" SnapsToDevicePixels="True" WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="{Binding Tooltip}">
<Border
x:Name="BG"
BorderThickness="0"
BorderThickness="0,0,1,0"
BorderBrush="{StaticResource Brush.Border0}"
Background="Transparent"
CornerRadius="4,4,0,0"/>
Background="Transparent"/>
<ContentPresenter
x:Name="ContentSite"
VerticalAlignment="Center"
ContentSource="Header"
RecognizesAccessKey="True"/>
<Rectangle
x:Name="Splitter"
HorizontalAlignment="Right"
Margin="0,0,-1,0"
Width="1" Height="16"
Fill="{StaticResource Brush.Border2}"
Visibility="Hidden"/>
RecognizesAccessKey="True"
Opacity=".5"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Panel.ZIndex" Value="2"/>
<Setter TargetName="BG" Property="Background" Value="{StaticResource Brush.Window}"/>
<Setter TargetName="BG" Property="BorderThickness" Value="1,1,1,0"/>
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Panel.ZIndex" Value="-1"/>
<Setter TargetName="Splitter" Property="Visibility" Value="Visible"/>
<Setter TargetName="ContentSite" Property="Opacity" Value="1"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter TargetName="ContentSite" Property="Opacity" Value=".9"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
@ -218,52 +209,35 @@
</TabControl>
</ScrollViewer>
<!-- Tab scroller -->
<StackPanel x:Name="openedTabsOpts" Grid.Column="1" VerticalAlignment="Bottom" Orientation="Horizontal" Height="28" Margin="4,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="ScrollToLeft">
<Path Width="10" Height="12" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.ScrollLeft}"/>
</Button>
<Button Click="ScrollToRight">
<!-- Tab scroller right -->
<Border Grid.Column="2" x:Name="tabScrollerRight" Width="18" Height="28" BorderThickness="1,0,1,0" BorderBrush="{StaticResource Brush.Border0}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="ScrollToRight" Margin="0" Padding="0">
<Path Width="10" Height="12" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.ScrollRight}"/>
</Button>
</StackPanel>
</Border>
<!-- Window Command -->
<StackPanel
Grid.Column="2"
Grid.Column="3"
Margin="32,0,0,0"
Orientation="Horizontal"
HorizontalAlignment="Right"
Height="32"
VerticalAlignment="Top"
Height="27"
WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="ShowPreference" Width="24" ToolTip="{StaticResource Text.Launcher.Preference}">
<Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Preference}"/>
<Button Click="ShowPreference" Width="28" ToolTip="{StaticResource Text.Launcher.Preference}">
<Path Width="14" Height="14" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Preference}"/>
</Button>
<Rectangle Width="1" Height="18" Margin="6,0" VerticalAlignment="Center" Fill="{StaticResource Brush.Border1}"/>
<Button Click="ShowAbout" Width="24" ToolTip="{StaticResource Text.Launcher.About}">
<Path Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Info}"/>
<Button Click="ShowAbout" Width="28" ToolTip="{StaticResource Text.Launcher.About}">
<Path Width="14" Height="14" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Info}"/>
</Button>
<Rectangle Width="1" Height="18" Margin="6,0" VerticalAlignment="Center" Fill="{StaticResource Brush.Border1}"/>
<Button Click="Minimize" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path Style="{StaticResource Style.WindowControlIcon}" Data="{StaticResource Icon.Minimize}"/>
<Button Click="Minimize" Width="28" Style="{StaticResource Style.Button.HighlightHover}">
<Path Width="14" Height="14" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Minimize}"/>
</Button>
<Button Click="MaximizeOrRestore" Width="32" Style="{StaticResource Style.Button.HighlightHover}">
<Path>
<Path.Style>
<Style TargetType="{x:Type Path}" BasedOn="{StaticResource Style.WindowControlIcon}">
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized">
<Setter Property="Data" Value="{StaticResource Icon.Restore}"/>
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal">
<Setter Property="Data" Value="{StaticResource Icon.Maximize}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
<Button Click="MaximizeOrRestore" Width="28" Style="{StaticResource Style.Button.HighlightHover}">
<Path Width="14" Height="14" Style="{StaticResource Style.Icon}" Data="{StaticResource Icon.Maximize}"/>
</Button>
<Button Click="Quit" Width="32">
<Button Click="Quit" Width="28">
<Button.Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource Style.Button.HighlightHover}">
<Style.Triggers>

View file

@ -320,9 +320,11 @@ namespace SourceGit.UI {
#region TAB_SCROLL
private void OpenedTabsSizeChanged(object sender, SizeChangedEventArgs e) {
if (openedTabs.ActualWidth > openedTabsColumn.ActualWidth) {
openedTabsOpts.Visibility = Visibility.Visible;
tabScrollerLeft.Visibility = Visibility.Visible;
tabScrollerRight.Visibility = Visibility.Visible;
} else {
openedTabsOpts.Visibility = Visibility.Collapsed;
tabScrollerLeft.Visibility = Visibility.Collapsed;
tabScrollerRight.Visibility = Visibility.Collapsed;
}
}

View file

@ -27,12 +27,14 @@
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Content="{StaticResource Text.Stashes.Stashes}" Foreground="{StaticResource Brush.FG2}" Margin="4,0,0,0" FontWeight="Bold"/>
<Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource Brush.Border0}"/>
<ListView
Grid.Row="1"
Grid.Row="2"
x:Name="stashList"
Background="{StaticResource Brush.Contents}" BorderThickness="0"
SelectedIndex="-1"
@ -67,12 +69,13 @@
</Grid>
<!-- Splitter -->
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent"/>
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
<!-- Changed file in this stash -->
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
@ -86,9 +89,11 @@
<Label Grid.Column="1" Content="{StaticResource Text.Stashes.Changes.Tip}" Foreground="{StaticResource Brush.FG2}" FontSize="10"/>
</Grid>
<Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource Brush.Border0}"/>
<ListView
x:Name="changeList"
Grid.Row="1"
Grid.Row="2"
Background="{StaticResource Brush.Contents}" BorderThickness="0"
SelectedIndex="-1"
ScrollViewer.VerticalScrollBarVisibility="Auto"
@ -125,7 +130,7 @@
</Grid>
<!-- Splitter -->
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border3}"/>
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
<!-- Right Panel -->
<local:DiffViewer Grid.Column="2" x:Name="diff" Padding="8"/>

View file

@ -45,6 +45,7 @@
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
@ -70,8 +71,10 @@
</Button>
</Grid>
<Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource Brush.Border0}"/>
<TreeView
Grid.Row="1"
Grid.Row="2"
x:Name="unstagedTree"
ItemsSource="{Binding ElementName=me, Path=UnstagedTreeData, IsAsync=True}"
Background="{StaticResource Brush.Contents}"
@ -126,7 +129,7 @@
</TreeView>
<DataGrid
Grid.Row="1"
Grid.Row="2"
x:Name="unstagedList"
ItemsSource="{Binding ElementName=me, Path=UnstagedListData, IsAsync=True}"
Visibility="{Binding Source={x:Static source:App.Setting}, Path=UI.UnstageFileDisplayMode, Converter={StaticResource FilesDisplayModeToList}}"
@ -197,12 +200,13 @@
</Grid>
<!-- Splitter -->
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent"/>
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
<!-- Staged changes -->
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
@ -228,8 +232,10 @@
</Button>
</Grid>
<Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource Brush.Border0}"/>
<TreeView
Grid.Row="1"
Grid.Row="2"
x:Name="stageTree"
ItemsSource="{Binding ElementName=me, Path=StagedTreeData, IsAsync=False}"
Visibility="{Binding Source={x:Static source:App.Setting}, Path=UI.StagedFileDisplayMode, Converter={StaticResource FilesDisplayModeToTree}}"
@ -284,7 +290,7 @@
</TreeView>
<DataGrid
Grid.Row="1"
Grid.Row="2"
x:Name="stageList"
ItemsSource="{Binding ElementName=me, Path=StagedListData, IsAsync=False}"
RowHeight="24"
@ -356,7 +362,7 @@
</Grid>
<!-- Splitter -->
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border3}"/>
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
<!-- Right -->
<Grid Grid.Column="2" Margin="8">