style<Welcome,PageTabBar>: re-design the style for Welcome page

This commit is contained in:
leo 2022-10-14 20:49:02 +08:00
parent b43044a7bf
commit 5ef6642306
3 changed files with 14 additions and 3 deletions

View file

@ -87,7 +87,7 @@ namespace SourceGit.Views {
iconMode.Width = 12;
iconMode.Height = 12;
iconMode.Data = FindResource(icon) as Geometry;
iconMode.SetResourceReference(Path.FillProperty, "Brush.FG2");
iconMode.SetResourceReference(Path.FillProperty, "Brush.FG1");
var item = new MenuItem();
item.Icon = iconMode;

View file

@ -149,6 +149,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Background="Transparent" Width="16" BorderThickness="0" ToolTip="{DynamicResource Text.RepoCM.Bookmark}" Click="OnChangeRepositoryBookmark">
@ -165,10 +166,13 @@
<Button Grid.Column="4" BorderThickness="0" Background="Transparent" ToolTip="{DynamicResource Text.RepoCM.Open}" Click="OnOpenRepository">
<Path Width="15" Data="{StaticResource Icon.Folder.Open}" Fill="{DynamicResource Brush.Accent1}"/>
</Button>
<Button Grid.Column="5" Margin="8,0,0,0" BorderThickness="0" Background="Transparent" ToolTip="{DynamicResource Text.Welcome.OpenTerminal}" Click="OnOpenRepositoryTerminal">
<Button Grid.Column="5" Margin="8,0,0,0" BorderThickness="0" Background="Transparent" ToolTip="{DynamicResource Text.RepoCM.Explore}" Click="OnExploreRepository">
<Path Width="15" Data="{StaticResource Icon.DiffWith}" Fill="{DynamicResource Brush.Accent1}"/>
</Button>
<Button Grid.Column="6" Margin="8,0,0,0" BorderThickness="0" Background="Transparent" ToolTip="{DynamicResource Text.Welcome.OpenTerminal}" Click="OnOpenRepositoryTerminal">
<Path Width="14" Data="{StaticResource Icon.Terminal}" Fill="{DynamicResource Brush.Accent1}"/>
</Button>
<Button Grid.Column="6" Margin="8,0,0,0" BorderThickness="0" Background="Transparent" ToolTip="{DynamicResource Text.Welcome.Delete}" Click="OnRemoveRepository">
<Button Grid.Column="7" Margin="8,0,0,0" BorderThickness="0" Background="Transparent" ToolTip="{DynamicResource Text.Welcome.Delete}" Click="OnRemoveRepository">
<Path Width="10" Data="{StaticResource Icon.Close}" Fill="{DynamicResource Brush.Accent1}"/>
</Button>
</Grid>

View file

@ -7,6 +7,7 @@ using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Linq;
namespace SourceGit.Views.Widgets {
@ -83,6 +84,12 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
}
private void OnExploreRepository(object sender, RoutedEventArgs e) {
var repo = (sender as Control).DataContext as Models.Repository;
Process.Start("explorer", repo.Path);
e.Handled = true;
}
private void OnChangeRepositoryBookmark(object sender, RoutedEventArgs e) {
var btn = (sender as Button);
var repo = btn.DataContext as Models.Repository;