refactor<*>: use DynamicResource instead of StaticResource for brushes and locales

This commit is contained in:
leo 2021-07-20 16:26:10 +08:00
parent 4a56b47265
commit afc4eafb6f
73 changed files with 630 additions and 601 deletions

View file

@ -1,11 +1,5 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
namespace SourceGit {
@ -14,7 +8,6 @@ namespace SourceGit {
/// 程序入口.
/// </summary>
public partial class App : Application {
private static bool restart = false;
/// <summary>
/// 读取本地化字串
@ -28,15 +21,6 @@ namespace SourceGit {
return string.Format(data, args);
}
/// <summary>
/// 重启程序
/// </summary>
public static void Restart() {
restart = true;
Process.Start(Process.GetCurrentProcess().MainModule.FileName);
Current.Shutdown();
}
/// <summary>
/// 启动.
/// </summary>
@ -48,31 +32,11 @@ namespace SourceGit {
Directory.CreateDirectory(Views.Controls.Avatar.CACHE_PATH);
}
// 控制主题
if (Models.Preference.Instance.General.UseDarkTheme) {
foreach (var rs in Current.Resources.MergedDictionaries) {
if (rs.Source != null && rs.Source.OriginalString.StartsWith("pack://application:,,,/Resources/Themes/", StringComparison.Ordinal)) {
rs.Source = new Uri("pack://application:,,,/Resources/Themes/Dark.xaml", UriKind.Absolute);
break;
}
}
}
// 控制显示语言
var lang = Models.Preference.Instance.General.Locale;
if (lang != "en_US") {
foreach (var rs in Current.Resources.MergedDictionaries) {
if (rs.Source != null && rs.Source.OriginalString.StartsWith("pack://application:,,,/Resources/Locales/", StringComparison.Ordinal)) {
rs.Source = new Uri($"pack://application:,,,/Resources/Locales/{lang}.xaml", UriKind.Absolute);
break;
}
}
}
// 主界面显示
MainWindow = new Views.Launcher();
Models.Theme.Change();
Models.Locale.Change();
// 如果启动命令中指定了路径,打开指定目录的仓库
var launcher = new Views.Launcher();
if (e.Args.Length > 0) {
var repo = Models.Preference.Instance.FindRepository(e.Args[0]);
if (repo == null) {
@ -99,33 +63,15 @@ namespace SourceGit {
}
}
// 主界面显示
MainWindow = launcher;
MainWindow.Show();
// 检测更新
if (Models.Preference.Instance.General.CheckForUpdate) {
var curDayOfYear = DateTime.Now.DayOfYear;
var lastDayOfYear = Models.Preference.Instance.General.LastCheckDay;
if (lastDayOfYear != curDayOfYear) {
Models.Preference.Instance.General.LastCheckDay = curDayOfYear;
Task.Run(() => {
try {
var web = new WebClient() { Encoding = Encoding.UTF8 };
var raw = web.DownloadString("https://gitee.com/api/v5/repos/sourcegit/sourcegit/releases/latest");
var ver = Models.Version.Load(raw);
var cur = Assembly.GetExecutingAssembly().GetName().Version;
var matches = Regex.Match(ver.TagName, @"^v(\d+)\.(\d+).*");
if (!matches.Success) return;
var major = int.Parse(matches.Groups[1].Value);
var minor = int.Parse(matches.Groups[2].Value);
if (major > cur.Major || (major == cur.Major && minor > cur.Minor)) {
Dispatcher.Invoke(() => Views.Upgrade.Open(MainWindow, ver));
}
} catch {}
});
}
}
// 检测版本更新
Models.Version.Check(ver => Dispatcher.Invoke(() => {
var dialog = new Views.Upgrade(ver) { Owner = MainWindow };
dialog.ShowDialog();
}));
}
/// <summary>
@ -135,7 +81,7 @@ namespace SourceGit {
/// <param name="e"></param>
private void OnAppDeactivated(object sender, EventArgs e) {
GC.Collect();
if (!restart) Models.Preference.Save();
Models.Preference.Save();
}
}
}

View file

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
namespace SourceGit.Models {
@ -18,5 +19,15 @@ namespace SourceGit.Models {
Name = name;
Resource = res;
}
public static void Change() {
var lang = Preference.Instance.General.Locale;
foreach (var rs in App.Current.Resources.MergedDictionaries) {
if (rs.Source != null && rs.Source.OriginalString.StartsWith("pack://application:,,,/Resources/Locales/", StringComparison.Ordinal)) {
rs.Source = new Uri($"pack://application:,,,/Resources/Locales/{lang}.xaml", UriKind.Absolute);
break;
}
}
}
}
}

38
src/Models/Theme.cs Normal file
View file

@ -0,0 +1,38 @@
using System;
using System.Windows;
namespace SourceGit.Models {
/// <summary>
/// 主题
/// </summary>
public static class Theme {
/// <summary>
/// 主题切换事件
/// </summary>
public static event Action Changed;
/// <summary>
/// 启用主题变化监听
/// </summary>
/// <param name="elem"></param>
public static void AddListener(FrameworkElement elem, Action callback) {
elem.Loaded += (_, __) => Changed += callback;
elem.Unloaded += (_, __) => Changed -= callback;
}
/// <summary>
/// 切换主题
/// </summary>
public static void Change() {
var theme = Preference.Instance.General.UseDarkTheme ? "Dark" : "Light";
foreach (var rs in App.Current.Resources.MergedDictionaries) {
if (rs.Source != null && rs.Source.OriginalString.StartsWith("pack://application:,,,/Resources/Themes/", StringComparison.Ordinal)) {
rs.Source = new Uri($"pack://application:,,,/Resources/Themes/{theme}.xaml", UriKind.Absolute);
break;
}
}
Changed?.Invoke();
}
}
}

View file

@ -1,4 +1,9 @@
using System;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
#if NET48
using Newtonsoft.Json;
@ -52,12 +57,36 @@ namespace SourceGit.Models {
get { return PreRelease ? "YES" : "NO"; }
}
public static Version Load(string data) {
public static void Check(Action<Version> onUpgradable) {
if (!Preference.Instance.General.CheckForUpdate) return;
var curDayOfYear = DateTime.Now.DayOfYear;
var lastDayOfYear = Preference.Instance.General.LastCheckDay;
if (lastDayOfYear != curDayOfYear) {
Preference.Instance.General.LastCheckDay = curDayOfYear;
Task.Run(() => {
try {
var web = new WebClient() { Encoding = Encoding.UTF8 };
var raw = web.DownloadString("https://gitee.com/api/v5/repos/sourcegit/sourcegit/releases/latest");
#if NET48
return JsonConvert.DeserializeObject<Version>(data);
var ver = JsonConvert.DeserializeObject<Version>(raw);
#else
return JsonSerializer.Deserialize<Version>(data);
var ver = JsonSerializer.Deserialize<Version>(raw);
#endif
var cur = Assembly.GetExecutingAssembly().GetName().Version;
var matches = Regex.Match(ver.TagName, @"^v(\d+)\.(\d+).*");
if (!matches.Success) return;
var major = int.Parse(matches.Groups[1].Value);
var minor = int.Parse(matches.Groups[2].Value);
if (major > cur.Major || (major == cur.Major && minor > cur.Minor)) {
onUpgradable?.Invoke(ver);
}
} catch {
}
});
}
}
}
}

View file

@ -19,5 +19,6 @@
<ResourceDictionary Source="pack://application:,,,/Resources/Styles/ToggleButton.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources/Styles/Tooltip.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources/Styles/Tree.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources/Styles/Window.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View file

@ -28,6 +28,9 @@
<Geometry x:Key="Icon.Curve">M1017 598c0-25-25-50-50-50c-30 0-50 25-50 50c0 35-10 136-55 186c-25 25-55 35-95 35c-70 0-121-191-161-326c-50-196-100-377-231-377c-186 0-271 286-326 472c-10 40-20 75-30 95c-10 25 5 55 30 65c25 10 55-5 65-30c10-25 20-60 35-105c35-136 116-397 226-397c55 0 105 181 141 301c55 196 110 402 256 402c65 0 121-20 161-65c90-95 85-251 85-256z</Geometry>
<Geometry x:Key="Icon.Polyline">M341 475 147 675 65 593l271-284 281 265 254-295 89 77-336 387z</Geometry>
<Geometry x:Key="Icon.DarkTheme">M512 768c-38 0-74-9-107-23C493 704 555 615 555 512c0-103-61-192-149-233C438 265 474 256 512 256a256 256 0 01256 256a256 256 0 01-256 256m341-397V171h-200L512 29 371 171H171v200L29 512 171 653V853h200L512 995 653 853H853v-200L995 512 853 371z</Geometry>
<Geometry x:Key="Icon.LightTheme">M853 653l141-141-141-141 0-200-200 0-141-141-141 141-200 0 0 200-141 141 141 141 0 200 200 0 141 141 141-141 200 0 0-200zM512 768c-141 0-256-115-256-256s115-256 256-256s256 115 256 256s-115 256-256 256z</Geometry>
<Geometry x:Key="Icon.Down">M509 546l271-271 91 91-348 349-1-1-13 13-363-361 91-91z</Geometry>
<Geometry x:Key="Icon.DoubleDown">M256 224l0 115L512 544l256-205 0-115-256 205L256 224zM512 685l-256-205L256 595 512 800 768 595l0-115L512 685z</Geometry>

View file

@ -16,12 +16,13 @@
<sys:String x:Key="Text.Optional">Optional.</sys:String>
<sys:String x:Key="Text.FakeFolderFilter">‡Directory|*.this.directory</sys:String>
<sys:String x:Key="Text.OpenFolder">SELECT FOLDER</sys:String>
<sys:String x:Key="Text.ThemeSwitcher">DARK/LIGHT THEME</sys:String>
<sys:String x:Key="Text.URL">URL :</sys:String>
<sys:String x:Key="Text.RepositoryURL">Git Repository URL</sys:String>
<sys:String x:Key="Text.ParentFolder">Parent Folder :</sys:String>
<sys:String x:Key="Text.ParentFolder.Placeholder">Relative foler to store this module. Optional.</sys:String>
<sys:String x:Key="Text.About">ABOUT</sys:String>
<sys:String x:Key="Text.About.Title">SourceGit - OPEN SOURCE GIT CLIENT</sys:String>
@ -361,10 +362,8 @@
<sys:String x:Key="Text.Preference">Preference</sys:String>
<sys:String x:Key="Text.Preference.General">GENERAL SETTING</sys:String>
<sys:String x:Key="Text.Preference.RestartRequired">RESTART REQUIRED</sys:String>
<sys:String x:Key="Text.Preference.Locale">Language :</sys:String>
<sys:String x:Key="Text.Preference.AvatarServer">Avatar Server :</sys:String>
<sys:String x:Key="Text.Preference.UseDark">Use dark theme</sys:String>
<sys:String x:Key="Text.Preference.CheckUpdate">Check for update</sys:String>
<sys:String x:Key="Text.Preference.AutoFetch">Fetch remotes automatically</sys:String>
<sys:String x:Key="Text.Preference.RestoreTabs">Restore windows</sys:String>

View file

@ -15,6 +15,7 @@
<sys:String x:Key="Text.Optional">选填</sys:String>
<sys:String x:Key="Text.FakeFolderFilter">‡路径|*.this.directory</sys:String>
<sys:String x:Key="Text.OpenFolder">选择文件夹</sys:String>
<sys:String x:Key="Text.ThemeSwitcher">切换主题</sys:String>
<sys:String x:Key="Text.URL">仓库地址 </sys:String>
<sys:String x:Key="Text.RepositoryURL">远程仓库地址</sys:String>
@ -360,10 +361,8 @@
<sys:String x:Key="Text.Preference">偏好设置</sys:String>
<sys:String x:Key="Text.Preference.General">通用配置</sys:String>
<sys:String x:Key="Text.Preference.RestartRequired">需要重启软件</sys:String>
<sys:String x:Key="Text.Preference.Locale">显示语言 </sys:String>
<sys:String x:Key="Text.Preference.AvatarServer">头像服务 </sys:String>
<sys:String x:Key="Text.Preference.UseDark">启用—暗色主题</sys:String>
<sys:String x:Key="Text.Preference.CheckUpdate">启用检测更新</sys:String>
<sys:String x:Key="Text.Preference.AutoFetch">启用定时自动拉取远程更新</sys:String>
<sys:String x:Key="Text.Preference.RestoreTabs">启动时恢复上次打开的仓库</sys:String>

View file

@ -143,6 +143,35 @@
</Setter>
</Style>
<Style x:Key="Style.ToggleButton.Theme" TargetType="{x:Type ToggleButton}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Background="Transparent">
<Path
x:Name="Icon"
Style="{DynamicResource Style.Icon}"
Width="16"
Height="16"
Fill="{DynamicResource Brush.FG1}"
Data="{DynamicResource Icon.LightTheme}"
Opacity=".9"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Icon" Property="Data" Value="{DynamicResource Icon.DarkTheme}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Style.ToggleButton.MaxOrRestore" TargetType="{x:Type ToggleButton}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>

View file

@ -0,0 +1,27 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Style.Window" TargetType="{x:Type Window}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="Background" Value="{DynamicResource Brush.Window}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource Brush.WindowBorder}"/>
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
<Setter Property="TextOptions.TextHintingMode" Value="Animated"/>
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType"/>
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome CaptionHeight="28" UseAeroCaptionButtons="False" ResizeBorderThickness="4" CornerRadius="0"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="WindowState" Value="Maximized">
<Setter Property="BorderThickness" Value="0"/>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

View file

@ -7,7 +7,7 @@
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
mc:Ignorable="d"
WindowStartupLocation="CenterOwner"
Title="{StaticResource Text.About}"
Title="{DynamicResource Text.About}"
Height="280" Width="400"
ResizeMode="NoResize">
<Grid>
@ -18,7 +18,7 @@
</Grid.RowDefinitions>
<!-- Title bar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@ -30,7 +30,7 @@
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Help}"/>
<!-- Title -->
<TextBlock Grid.Column="1" Text="{StaticResource Text.About}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.About}"/>
<!-- Close -->
<controls:IconButton
@ -47,7 +47,7 @@
Grid.Row="1"
Height="1"
HorizontalAlignment="Stretch"
Fill="{StaticResource Brush.Border0}"/>
Fill="{DynamicResource Brush.Border0}"/>
<!-- Content -->
<StackPanel Grid.Row="2" Orientation="Vertical">
@ -57,12 +57,12 @@
Margin="0,16,0,0"
Width="64" Height="64"
Data="{StaticResource Icon.Git}"
Fill="{StaticResource Brush.Logo}"/>
Fill="{DynamicResource Brush.Logo}"/>
<!-- Title -->
<TextBlock
Margin="0,24,0,8"
Text="{StaticResource Text.About.Title}"
Text="{DynamicResource Text.About.Title}"
HorizontalAlignment="Center"
TextOptions.TextFormattingMode="Ideal"
FontSize="18" FontWeight="Bold"/>

View file

@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
mc:Ignorable="d"
Title="{StaticResource Text.Blame}"
Title="{DynamicResource Text.Blame}"
WindowStartupLocation="CenterOwner"
Height="600" Width="800">
<Grid>
@ -19,7 +19,7 @@
</Grid.RowDefinitions>
<!-- Title Bar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@ -31,7 +31,7 @@
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Commit}"/>
<!-- Title -->
<TextBlock Grid.Column="1" Text="{StaticResource Text.Blame}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.Blame}"/>
<!-- Window Commands -->
<StackPanel Grid.Column="3" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
@ -46,7 +46,7 @@
Grid.Row="1"
Height="1"
HorizontalAlignment="Stretch"
Fill="{StaticResource Brush.Border0}"/>
Fill="{DynamicResource Brush.Border0}"/>
<!-- Description -->
<Border Grid.Row="2">
@ -56,8 +56,8 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="txtFile" FontSize="11" Foreground="{StaticResource Brush.FG2}" FontFamily="Consolas"/>
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Foreground="{StaticResource Brush.FG2}" FontFamily="11" Text="{StaticResource Text.Blame.Tip}"/>
<TextBlock Grid.Column="0" x:Name="txtFile" FontSize="11" Foreground="{DynamicResource Brush.FG2}" FontFamily="Consolas"/>
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Foreground="{DynamicResource Brush.FG2}" FontFamily="11" Text="{DynamicResource Text.Blame.Tip}"/>
</Grid>
</Border>
@ -66,8 +66,8 @@
Grid.Row="3"
x:Name="blame"
GridLinesVisibility="Vertical"
VerticalGridLinesBrush="{StaticResource Brush.Border2}"
BorderBrush="{StaticResource Brush.Border2}"
VerticalGridLinesBrush="{DynamicResource Brush.Border2}"
BorderBrush="{DynamicResource Brush.Border2}"
BorderThickness="1"
FrozenColumnCount="1"
RowHeight="16"
@ -90,7 +90,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border Background="{Binding BG}" BorderThickness="0">
<TextBlock Text="{Binding Line.Content}" Background="Transparent" Foreground="{StaticResource Brush.FG1}" FontFamily="Consolas,Microsoft YaHei UI" FontSize="9pt" Margin="0" Padding="2,0,0,0"/>
<TextBlock Text="{Binding Line.Content}" Background="Transparent" Foreground="{DynamicResource Brush.FG1}" FontFamily="Consolas,Microsoft YaHei UI" FontSize="9pt" Margin="0" Padding="2,0,0,0"/>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@ -103,10 +103,10 @@
Grid.Row="3"
Orientation="Vertical"
VerticalAlignment="Center" HorizontalAlignment="Center"
Background="{StaticResource Brush.Window}"
Background="{DynamicResource Brush.Window}"
Visibility="Collapsed">
<Path Width="64" Height="64" Data="{StaticResource Icon.Error}" Fill="{StaticResource Brush.FG2}"/>
<TextBlock Text="{StaticResource Text.BlameTypeNotSupported}" Margin="0,16,0,0" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{StaticResource Brush.FG2}"/>
<Path Width="64" Height="64" Data="{StaticResource Icon.Error}" Fill="{DynamicResource Brush.FG2}"/>
<TextBlock Text="{DynamicResource Text.BlameTypeNotSupported}" Margin="0,16,0,0" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
<!-- Loading -->
@ -114,7 +114,7 @@
<!-- Popup to show commit info -->
<Popup x:Name="popup" Grid.Row="3" Placement="MousePoint" IsOpen="False" StaysOpen="False" Focusable="True">
<Border BorderBrush="{StaticResource Brush.Accent1}" BorderThickness="1" Background="{StaticResource Brush.Popup}">
<Border BorderBrush="{DynamicResource Brush.Accent1}" BorderThickness="1" Background="{DynamicResource Brush.Popup}">
<Grid Margin="4">
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
@ -127,11 +127,11 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource Text.Blame.SHA}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Text.Blame.SHA}" Foreground="{DynamicResource Brush.FG2}" Margin="4,0"/>
<Label Grid.Row="0" Grid.Column="1" x:Name="commitID" Margin="8,0,4,0" Padding="0" VerticalAlignment="Center"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="{StaticResource Text.Blame.Author}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Text.Blame.Author}" Foreground="{DynamicResource Brush.FG2}" Margin="4,0"/>
<TextBlock Grid.Row="1" Grid.Column="1" x:Name="authorName" Margin="8,0,4,0"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="{StaticResource Text.Blame.ModifyTime}" Foreground="{StaticResource Brush.FG2}" Margin="4,0"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource Text.Blame.ModifyTime}" Foreground="{DynamicResource Brush.FG2}" Margin="4,0"/>
<TextBlock Grid.Row="2" Grid.Column="1" x:Name="authorTime" Margin="8,0,4,0"/>
</Grid>
</Border>

View file

@ -26,9 +26,10 @@ namespace SourceGit.Views.Controls {
Height = 18;
CornerRadius = new CornerRadius(9);
VerticalAlignment = VerticalAlignment.Center;
Background = FindResource("Brush.Badge") as Brush;
Visibility = Visibility.Collapsed;
SetResourceReference(BackgroundProperty, "Brush.Badge");
label = new TextBlock();
label.FontSize = 10;
label.HorizontalAlignment = HorizontalAlignment.Center;

View file

@ -69,14 +69,14 @@ namespace SourceGit.Views.Controls {
if (!mark.IsNewPage) {
if (mark.Color == 0) {
mark.icon.Fill = mark.FindResource("Brush.FG1") as Brush;
mark.icon.SetResourceReference(Path.FillProperty, "Brush.FG1");
mark.icon.Data = mark.FindResource("Icon.Git") as Geometry;
} else {
mark.icon.Fill = COLORS[mark.Color % COLORS.Length];
mark.icon.Data = mark.FindResource("Icon.Bookmark") as Geometry;
}
} else {
mark.icon.Fill = mark.FindResource("Brush.FG1") as Brush;
mark.icon.SetResourceReference(Path.FillProperty, "Brush.FG1");
mark.icon.Data = mark.FindResource("Icon.WelcomePage") as Geometry;
}

View file

@ -36,8 +36,8 @@ namespace SourceGit.Views.Controls {
public ChangeDisplaySwitcher() {
icon = new Path();
icon.Fill = FindResource("Brush.FG2") as Brush;
icon.Data = FindResource("Icon.Tree") as Geometry;
icon.SetResourceReference(Path.FillProperty, "Brush.FG2");
Content = icon;
Style = FindResource("Style.Button") as Style;
@ -73,8 +73,8 @@ namespace SourceGit.Views.Controls {
var iconMode = new Path();
iconMode.Width = 12;
iconMode.Height = 12;
iconMode.Fill = FindResource("Brush.FG2") as Brush;
iconMode.Data = FindResource(icon) as Geometry;
iconMode.SetResourceReference(Path.FillProperty, "Brush.FG2");
var item = new MenuItem();
item.Icon = iconMode;

View file

@ -109,6 +109,7 @@ namespace SourceGit.Views.Controls {
private double startY = 0;
public CommitGraph() {
Models.Theme.AddListener(this, InvalidateVisual);
IsHitTestVisible = false;
ClipToBounds = true;
}

View file

@ -1,6 +1,4 @@
using System.Windows;
using System.Windows.Media;
using System.Windows.Shell;
namespace SourceGit.Views.Controls {
/// <summary>
@ -20,32 +18,16 @@ namespace SourceGit.Views.Controls {
}
public Window() {
Background = FindResource("Brush.Window") as Brush;
BorderBrush = FindResource("Brush.WindowBorder") as Brush;
BorderThickness = new Thickness(1);
SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display);
SetValue(TextOptions.TextRenderingModeProperty, TextRenderingMode.ClearType);
SetValue(TextOptions.TextHintingModeProperty, TextHintingMode.Animated);
UseLayoutRounding = true;
var chrome = new WindowChrome();
chrome.ResizeBorderThickness = new Thickness(4);
chrome.UseAeroCaptionButtons = false;
chrome.CornerRadius = new CornerRadius(0);
chrome.CaptionHeight = 28;
WindowChrome.SetWindowChrome(this, chrome);
Style = FindResource("Style.Window") as Style;
StateChanged += (_, __) => {
var content = Content as FrameworkElement;
if (WindowState == WindowState.Maximized) {
if (!IsMaximized) IsMaximized = true;
BorderThickness = new Thickness(0);
content.Margin = new Thickness((SystemParameters.MaximizedPrimaryScreenWidth - SystemParameters.WorkArea.Width) / 2);
} else {
if (IsMaximized) IsMaximized = false;
BorderThickness = new Thickness(1);
content.Margin = new Thickness(0);
}
};

View file

@ -9,7 +9,7 @@
xmlns:models="clr-namespace:SourceGit.Models"
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
mc:Ignorable="d"
Title="{StaticResource Text.FileHistory}"
Title="{DynamicResource Text.FileHistory}"
WindowStartupLocation="CenterOwner"
MinHeight="600" MinWidth="800">
<Grid>
@ -20,7 +20,7 @@
</Grid.RowDefinitions>
<!-- Title Bar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@ -32,7 +32,7 @@
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Histories}"/>
<!-- Title -->
<TextBlock Grid.Column="1" Text="{StaticResource Text.FileHistory}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.FileHistory}"/>
<!-- Window Commands -->
<StackPanel Grid.Column="3" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
@ -46,7 +46,7 @@
Grid.Row="1"
Height="1"
HorizontalAlignment="Stretch"
Fill="{StaticResource Brush.Border0}"/>
Fill="{DynamicResource Brush.Border0}"/>
<!-- Body -->
<Grid Grid.Row="2">
@ -60,8 +60,8 @@
<DataGrid
x:Name="commitList"
Grid.Column="0"
Background="{StaticResource Brush.Contents}"
BorderBrush="{StaticResource Brush.Border0}"
Background="{DynamicResource Brush.Contents}"
BorderBrush="{DynamicResource Brush.Border0}"
BorderThickness="0,0,1,0"
SelectionMode="Single"
SelectionUnit="FullRow"
@ -70,7 +70,7 @@
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type models:Commit}">
<Border BorderBrush="{StaticResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4">
<Border BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="36"/>
@ -107,7 +107,7 @@
Grid.Column="1"
Text="{Binding Author.Time}"
FontSize="9pt" FontFamily="Consolas"
Foreground="{StaticResource Brush.FG2}"
Foreground="{DynamicResource Brush.FG2}"
Margin="4,0,0,0"
HorizontalAlignment="Right"/>
</Grid>

View file

@ -7,7 +7,7 @@
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
mc:Ignorable="d"
SizeToContent="Height" Width="400"
Title="{StaticResource Text.Hotkeys}"
Title="{DynamicResource Text.Hotkeys}"
WindowStartupLocation="CenterOwner"
ResizeMode="NoResize">
<Grid>
@ -18,7 +18,7 @@
</Grid.RowDefinitions>
<!-- Title bar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@ -30,7 +30,7 @@
<Path Grid.Column="0" Margin="6,0" Width="16" Height="16" Data="{StaticResource Icon.Hotkeys}"/>
<!-- Title -->
<TextBlock Grid.Column="1" Text="{StaticResource Text.Hotkeys}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.Hotkeys}"/>
<!-- Close -->
<controls:IconButton
@ -47,27 +47,27 @@
Grid.Row="1"
Height="1"
HorizontalAlignment="Stretch"
Fill="{StaticResource Brush.Border0}"/>
Fill="{DynamicResource Brush.Border0}"/>
<DataGrid
x:Name="container"
Grid.Row="2"
Margin="8"
Background="{StaticResource Brush.Contents}"
Background="{DynamicResource Brush.Contents}"
GridLinesVisibility="All"
HorizontalGridLinesBrush="{StaticResource Brush.Border0}"
VerticalGridLinesBrush="{StaticResource Brush.Border0}"
HorizontalGridLinesBrush="{DynamicResource Brush.Border0}"
VerticalGridLinesBrush="{DynamicResource Brush.Border0}"
HeadersVisibility="Column"
RowHeight="24"
ColumnHeaderHeight="24"
BorderThickness="1,1,0,0"
BorderBrush="{StaticResource Brush.Border0}">
BorderBrush="{DynamicResource Brush.Border0}">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Border BorderThickness="0,0,1,1" BorderBrush="{StaticResource Brush.Border0}" Background="{StaticResource Brush.Window}">
<Border BorderThickness="0,0,1,1" BorderBrush="{DynamicResource Brush.Border0}" Background="{DynamicResource Brush.Window}">
<TextBlock
Text="{TemplateBinding Content}"
HorizontalAlignment="Center"
@ -80,8 +80,8 @@
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<DataGridTextColumn Width="100" Header="{StaticResource Text.Hotkeys.Col.Key}" Binding="{Binding .Key}" ElementStyle="{StaticResource Style.TextBlock.LineContent}"/>
<DataGridTextColumn Width="*" Header="{StaticResource Text.Hotkeys.Col.Desc}" Binding="{Binding .Desc}" ElementStyle="{StaticResource Style.TextBlock.LineContent}"/>
<DataGridTextColumn Width="100" Header="{DynamicResource Text.Hotkeys.Col.Key}" Binding="{Binding .Key}" ElementStyle="{StaticResource Style.TextBlock.LineContent}"/>
<DataGridTextColumn Width="*" Header="{DynamicResource Text.Hotkeys.Col.Desc}" Binding="{Binding .Desc}" ElementStyle="{StaticResource Style.TextBlock.LineContent}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>

View file

@ -11,7 +11,7 @@
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
MinWidth="1280" MinHeight="720"
Title="{StaticResource Text.About.Title}"
Title="{DynamicResource Text.About.Title}"
Width="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Width, Mode=TwoWay}"
Height="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Height, Mode=TwoWay}"
Closing="OnClosing">
@ -22,14 +22,14 @@
</Grid.RowDefinitions>
<!-- Titlebar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="250"/>
</Grid.ColumnDefinitions>
<!-- Bottom border -->
<Rectangle Grid.Column="0" Grid.ColumnSpan="2" Fill="{StaticResource Brush.Border0}" Height="1" VerticalAlignment="Bottom"/>
<Rectangle Grid.Column="0" Grid.ColumnSpan="2" Fill="{DynamicResource Brush.Border0}" Height="1" VerticalAlignment="Bottom"/>
<!-- Tabs -->
<widgets:PageTabBar
@ -41,9 +41,10 @@
<!-- Right controls -->
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="27" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:IconButton Click="OpenPreference" Width="28" Padding="6" Icon="{StaticResource Icon.Preference}" ToolTip="{StaticResource Text.Launcher.Preference}"/>
<controls:IconButton Click="OpenHotkeys" Width="28" Padding="6" Icon="{StaticResource Icon.Hotkeys}" ToolTip="{StaticResource Text.Hotkeys}"/>
<controls:IconButton Click="OpenAbout" Width="28" Padding="6" Icon="{StaticResource Icon.Help}" ToolTip="{StaticResource Text.Launcher.About}"/>
<controls:IconButton Click="OpenPreference" Width="28" Padding="6" Icon="{StaticResource Icon.Preference}" ToolTip="{DynamicResource Text.Launcher.Preference}"/>
<ToggleButton Style="{StaticResource Style.ToggleButton.Theme}" Width="28" IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseDarkTheme, Mode=TwoWay}" Checked="ChangeTheme" Unchecked="ChangeTheme" ToolTip="{DynamicResource Text.ThemeSwitcher}"/>
<controls:IconButton Click="OpenHotkeys" Width="28" Padding="6" Icon="{StaticResource Icon.Hotkeys}" ToolTip="{DynamicResource Text.Hotkeys}"/>
<controls:IconButton Click="OpenAbout" Width="28" Padding="6" Icon="{StaticResource Icon.Help}" ToolTip="{DynamicResource Text.Launcher.About}"/>
<controls:IconButton Click="Minimize" Width="28" Padding="8" Icon="{StaticResource Icon.Minimize}" HoverBackground="#40000000" Opacity="1"/>
<ToggleButton Style="{StaticResource Style.ToggleButton.MaxOrRestore}" Width="28" IsChecked="{Binding ElementName=me, Path=IsMaximized}"/>
<controls:IconButton Click="Quit" Width="28" Padding="8" Icon="{StaticResource Icon.Close}" HoverBackground="Red" Opacity="1"/>

View file

@ -69,6 +69,10 @@ namespace SourceGit.Views {
#endregion
#region RIGHT_COMMANDS
private void ChangeTheme(object sender, RoutedEventArgs e) {
Models.Theme.Change();
}
private void OpenPreference(object sender, RoutedEventArgs e) {
var dialog = new Preference() { Owner = this };
dialog.ShowDialog();

View file

@ -25,7 +25,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.AddSubTree.Source}"
Text="{DynamicResource Text.AddSubTree.Source}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
@ -43,7 +43,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.AddSubTree.Branch}"
Text="{DynamicResource Text.AddSubTree.Branch}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
@ -61,7 +61,7 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.AddSubTree.Prefix}"
Text="{DynamicResource Text.AddSubTree.Prefix}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="2" Grid.Column="1"
@ -81,6 +81,6 @@
Margin="0,4,0,0"
x:Name="chkSquash"
IsChecked="True"
Content="{StaticResource Text.AddSubTree.Squash}"/>
Content="{DynamicResource Text.AddSubTree.Squash}"/>
</Grid>
</controls:PopupWidget>

View file

@ -24,13 +24,13 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.URL}"
Text="{DynamicResource Text.URL}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
x:Name="txtURL"
Height="24"
Placeholder="{StaticResource Text.RepositoryURL}">
Placeholder="{DynamicResource Text.RepositoryURL}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="URL" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -43,13 +43,13 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.ParentFolder}"
Text="{DynamicResource Text.ParentFolder}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
x:Name="txtPath"
Height="24"
Placeholder="{StaticResource Text.ParentFolder.Placeholder}">
Placeholder="{DynamicResource Text.ParentFolder.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="Path" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -64,6 +64,6 @@
Margin="0,4,0,0"
x:Name="chkNested"
IsChecked="True"
Content="{StaticResource Text.Submodule.FetchNested}"/>
Content="{DynamicResource Text.Submodule.FetchNested}"/>
</Grid>
</controls:PopupWidget>

View file

@ -30,7 +30,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Apply.File}"
Text="{DynamicResource Text.Apply.File}"
HorizontalAlignment="Right"/>
<Grid
Grid.Row="0" Grid.Column="1">
@ -43,7 +43,7 @@
Grid.Column="0"
x:Name="txtPath"
Height="24"
Placeholder="{StaticResource Text.Apply.File.Placeholder}">
Placeholder="{DynamicResource Text.Apply.File.Placeholder}">
<controls:TextEdit.Text>
<Binding Path="File" ElementName="me" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -64,7 +64,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Apply.WS}"
Text="{DynamicResource Text.Apply.WS}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="1" Grid.Column="1"
@ -78,7 +78,7 @@
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Name}" Margin="4,0"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
@ -89,6 +89,6 @@
Margin="0,4,0,0"
x:Name="chkIngoreWS"
IsChecked="True"
Content="{StaticResource Text.Apply.IgnoreWS}"/>
Content="{DynamicResource Text.Apply.IgnoreWS}"/>
</Grid>
</controls:PopupWidget>

View file

@ -23,7 +23,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Archive.Revision}"
Text="{DynamicResource Text.Archive.Revision}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,7 +36,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Archive.File}"
Text="{DynamicResource Text.Archive.File}"
HorizontalAlignment="Right"/>
<Grid Grid.Row="1" Grid.Column="1">
<Grid.ColumnDefinitions>
@ -48,7 +48,7 @@
Grid.Column="0"
x:Name="txtSaveTo"
Height="24"
Placeholder="{StaticResource Text.Archive.File.Placeholder}">
Placeholder="{DynamicResource Text.Archive.File.Placeholder}">
<controls:TextEdit.Text>
<Binding Path="SaveTo" ElementName="me" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>

View file

@ -21,7 +21,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.CherryPick.Commit}"
Text="{DynamicResource Text.CherryPick.Commit}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,6 +36,6 @@
Margin="0,4,0,0"
x:Name="chkCommit"
IsChecked="True"
Content="{StaticResource Text.CherryPick.CommitChanges}"/>
Content="{DynamicResource Text.CherryPick.CommitChanges}"/>
</Grid>
</controls:PopupWidget>

View file

@ -24,14 +24,14 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Text="{StaticResource Text.Clone.RemoteURL}"
Text="{DynamicResource Text.Clone.RemoteURL}"
Margin="0,0,4,0"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
x:Name="txtUrl"
Height="24"
Placeholder="{StaticResource Text.Clone.RemoteURL.Placeholder}">
Placeholder="{DynamicResource Text.Clone.RemoteURL.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="Uri" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -43,7 +43,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Text="{StaticResource Text.Clone.Folder}"
Text="{DynamicResource Text.Clone.Folder}"
Margin="0,0,4,0"
HorizontalAlignment="Right"/>
<Grid Grid.Row="1" Grid.Column="1">
@ -56,7 +56,7 @@
Grid.Column="0"
x:Name="txtFolder"
Height="24"
Placeholder="{StaticResource Text.Clone.Folder.Placeholder}">
Placeholder="{DynamicResource Text.Clone.Folder.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="Folder" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -71,21 +71,21 @@
Click="OnFolderSelectorClick"
Width="24" Height="24"
Margin="2,0,0,0" Padding="4"
BorderBrush="{StaticResource Brush.Border1}"
BorderBrush="{DynamicResource Brush.Border1}"
BorderThickness="1"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<TextBlock
Grid.Row="2" Grid.Column="0"
Text="{StaticResource Text.Clone.LocalName}"
Text="{DynamicResource Text.Clone.LocalName}"
Margin="0,0,4,0"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="2" Grid.Column="1"
Height="24"
x:Name="txtLocal"
Placeholder="{StaticResource Text.Clone.LocalName.Placeholder}">
Placeholder="{DynamicResource Text.Clone.LocalName.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="LocalName" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -97,14 +97,14 @@
<TextBlock
Grid.Row="3" Grid.Column="0"
Text="{StaticResource Text.Clone.RemoteName}"
Text="{DynamicResource Text.Clone.RemoteName}"
Margin="0,0,4,0"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="3" Grid.Column="1"
x:Name="txtRemote"
Height="24"
Placeholder="{StaticResource Text.Clone.RemoteName.Placeholder}">
Placeholder="{DynamicResource Text.Clone.RemoteName.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="RemoteName" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -116,13 +116,13 @@
<TextBlock
Grid.Row="4" Grid.Column="0"
Text="{StaticResource Text.Clone.AdditionalParam}"
Text="{DynamicResource Text.Clone.AdditionalParam}"
Margin="0,0,4,0"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="4" Grid.Column="1"
Height="24"
Placeholder="{StaticResource Text.Clone.AdditionalParam.Placeholder}"
Placeholder="{DynamicResource Text.Clone.AdditionalParam.Placeholder}"
Text="{Binding ElementName=me, Path=ExtraArgs, Mode=TwoWay}"/>
</Grid>
</controls:PopupWidget>

View file

@ -23,34 +23,34 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Configure.User}"
Text="{DynamicResource Text.Configure.User}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
Text="{Binding ElementName=me, Path=UserName, Mode=TwoWay}"
Height="24"
Placeholder="{StaticResource Text.Configure.User.Placeholder}"/>
Placeholder="{DynamicResource Text.Configure.User.Placeholder}"/>
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Configure.Email}"
Text="{DynamicResource Text.Configure.Email}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
Text="{Binding ElementName=me, Path=UserEmail, Mode=TwoWay}"
Height="24"
Placeholder="{StaticResource Text.Configure.Email.Placeholder}"/>
Placeholder="{DynamicResource Text.Configure.Email.Placeholder}"/>
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Configure.Proxy}"
Text="{DynamicResource Text.Configure.Proxy}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="2" Grid.Column="1"
Text="{Binding ElementName=me, Path=Proxy, Mode=TwoWay}"
Height="24"
Placeholder="{StaticResource Text.Configure.Proxy.Placeholder}"/>
Placeholder="{DynamicResource Text.Configure.Proxy.Placeholder}"/>
</Grid>
</controls:PopupWidget>

View file

@ -30,7 +30,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.CreateBranch.BasedOn}"
Text="{DynamicResource Text.CreateBranch.BasedOn}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -43,13 +43,13 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.CreateBranch.Name}"
Text="{DynamicResource Text.CreateBranch.Name}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
x:Name="txtBranchName"
Height="24"
Placeholder="{StaticResource Text.CreateBranch.Name.Placeholder}">
Placeholder="{DynamicResource Text.CreateBranch.Name.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="BranchName" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -62,17 +62,17 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.CreateBranch.LocalChanges}"
Text="{DynamicResource Text.CreateBranch.LocalChanges}"
HorizontalAlignment="Right"/>
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
<RadioButton Content="{StaticResource Text.CreateBranch.LocalChanges.StashAndReply}" GroupName="LocalChanges" IsChecked="{Binding AutoStash, ElementName=me}"/>
<RadioButton Content="{StaticResource Text.CreateBranch.LocalChanges.Discard}" Margin="8,0,0,0" GroupName="LocalChanges" IsChecked="{Binding AutoStash, ElementName=me, Mode=OneWay, Converter={StaticResource InverseBool}}"/>
<RadioButton Content="{DynamicResource Text.CreateBranch.LocalChanges.StashAndReply}" GroupName="LocalChanges" IsChecked="{Binding AutoStash, ElementName=me}"/>
<RadioButton Content="{DynamicResource Text.CreateBranch.LocalChanges.Discard}" Margin="8,0,0,0" GroupName="LocalChanges" IsChecked="{Binding AutoStash, ElementName=me, Mode=OneWay, Converter={StaticResource InverseBool}}"/>
</StackPanel>
<CheckBox
Grid.Row="3" Grid.Column="1"
x:Name="chkCheckout"
IsChecked="True"
Content="{StaticResource Text.CreateBranch.Checkout}"/>
Content="{DynamicResource Text.CreateBranch.Checkout}"/>
</Grid>
</controls:PopupWidget>

View file

@ -24,7 +24,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.CreateTag.BasedOn}"
Text="{DynamicResource Text.CreateTag.BasedOn}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -37,13 +37,13 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.CreateTag.Name}"
Text="{DynamicResource Text.CreateTag.Name}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
x:Name="txtTagName"
Height="24"
Placeholder="{StaticResource Text.CreateTag.Name.Placeholder}">
Placeholder="{DynamicResource Text.CreateTag.Name.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="TagName" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -56,14 +56,14 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,6,8,0"
Text="{StaticResource Text.CreateTag.Message}"
Text="{DynamicResource Text.CreateTag.Message}"
HorizontalAlignment="Right" VerticalAlignment="Top"/>
<controls:TextEdit
Grid.Row="2" Grid.Column="1"
Text="{Binding ElementName=me, Path=Message, Mode=TwoWay}"
Height="56" Padding="0,2"
AcceptsReturn="True"
Placeholder="{StaticResource Text.CreateTag.Message.Placeholder}"
Placeholder="{DynamicResource Text.CreateTag.Message.Placeholder}"
PlaceholderBaseline="Top"/>
</Grid>
</controls:PopupWidget>

View file

@ -20,7 +20,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.DeleteBranch.Branch}"
Text="{DynamicResource Text.DeleteBranch.Branch}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"

View file

@ -20,7 +20,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.DeleteRemote.Remote}"
Text="{DynamicResource Text.DeleteRemote.Remote}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"

View file

@ -20,7 +20,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.DeleteSubmodule.Path}"
Text="{DynamicResource Text.DeleteSubmodule.Path}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"

View file

@ -21,7 +21,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.DeleteTag.Tag}"
Text="{DynamicResource Text.DeleteTag.Tag}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,6 +36,6 @@
Margin="0,4,0,0"
x:Name="chkPush"
IsChecked="True"
Content="{StaticResource Text.DeleteTag.WithRemote}"/>
Content="{DynamicResource Text.DeleteTag.WithRemote}"/>
</Grid>
</controls:PopupWidget>

View file

@ -21,7 +21,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Discard.Changes}"
Text="{DynamicResource Text.Discard.Changes}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -33,7 +33,7 @@
<TextBlock
Grid.Row="1" Grid.Column="1"
Margin="0,4,0,0"
Text="{StaticResource Text.Discard.Warning}"
Foreground="{StaticResource Brush.FG2}"/>
Text="{DynamicResource Text.Discard.Warning}"
Foreground="{DynamicResource Brush.FG2}"/>
</Grid>
</controls:PopupWidget>

View file

@ -23,7 +23,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.EditSubTree.Prefix}"
Text="{DynamicResource Text.EditSubTree.Prefix}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,7 +36,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.EditSubTree.Source}"
Text="{DynamicResource Text.EditSubTree.Source}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"

View file

@ -26,7 +26,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Fetch.Remote}"
Text="{DynamicResource Text.Fetch.Remote}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="0" Grid.Column="1"
@ -47,11 +47,11 @@
Margin="0,4,0,0"
x:Name="chkFetchAll"
IsChecked="True"
Content="{StaticResource Text.Fetch.AllRemotes}"/>
Content="{DynamicResource Text.Fetch.AllRemotes}"/>
<CheckBox Grid.Row="2" Grid.Column="1"
x:Name="chkPrune"
IsChecked="True"
Content="{StaticResource Text.Fetch.Prune}"/>
Content="{DynamicResource Text.Fetch.Prune}"/>
</Grid>
</controls:PopupWidget>

View file

@ -36,6 +36,6 @@
Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
x:Name="chkKeep"
IsChecked="False"
Content="{StaticResource Text.GitFlow.KeepBranchAfterFinish}"/>
Content="{DynamicResource Text.GitFlow.KeepBranchAfterFinish}"/>
</Grid>
</controls:PopupWidget>

View file

@ -28,7 +28,7 @@
Grid.Row="0" Grid.Column="1"
x:Name="txtBranchName"
Height="24"
Placeholder="{StaticResource Text.GitFlow.StartPlaceholder}">
Placeholder="{DynamicResource Text.GitFlow.StartPlaceholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="BranchName" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>

View file

@ -21,7 +21,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Text="{StaticResource Text.Init.Path}"
Text="{DynamicResource Text.Init.Path}"
HorizontalAlignment="Right"/>
<Path
@ -37,7 +37,7 @@
<TextBlock
Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
Text="{StaticResource Text.Init.Tip}"
Foreground="{StaticResource Brush.FG2}"/>
Text="{DynamicResource Text.Init.Tip}"
Foreground="{DynamicResource Brush.FG2}"/>
</Grid>
</controls:PopupWidget>

View file

@ -26,7 +26,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.GitFlow.ProductionBranch}"
Text="{DynamicResource Text.GitFlow.ProductionBranch}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
@ -38,7 +38,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.GitFlow.DevelopBranch}"
Text="{DynamicResource Text.GitFlow.DevelopBranch}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
@ -50,12 +50,12 @@
<Rectangle
Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
Height="1"
Fill="{StaticResource Brush.Border2}"/>
Fill="{DynamicResource Brush.Border2}"/>
<TextBlock
Grid.Row="3" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.GitFlow.FeaturePrefix}"
Text="{DynamicResource Text.GitFlow.FeaturePrefix}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="3" Grid.Column="1"
@ -67,7 +67,7 @@
<TextBlock
Grid.Row="4" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.GitFlow.ReleasePrefix}"
Text="{DynamicResource Text.GitFlow.ReleasePrefix}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="4" Grid.Column="1"
@ -79,7 +79,7 @@
<TextBlock
Grid.Row="5" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.GitFlow.HotfixPrefix}"
Text="{DynamicResource Text.GitFlow.HotfixPrefix}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="5" Grid.Column="1"
@ -91,12 +91,12 @@
<TextBlock
Grid.Row="6" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.GitFlow.TagPrefix}"
Text="{DynamicResource Text.GitFlow.TagPrefix}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="6" Grid.Column="1"
x:Name="txtTag"
Height="24"
Placeholder="{StaticResource Text.Optional}"/>
Placeholder="{DynamicResource Text.Optional}"/>
</Grid>
</controls:PopupWidget>

View file

@ -23,7 +23,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Merge.Source}"
Text="{DynamicResource Text.Merge.Source}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,7 +36,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Merge.Into}"
Text="{DynamicResource Text.Merge.Into}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="1" Grid.Column="1"
@ -49,7 +49,7 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Merge.Mode}"
Text="{DynamicResource Text.Merge.Mode}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="2" Grid.Column="1"
@ -62,7 +62,7 @@
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Name}" Margin="4,0"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>

View file

@ -28,7 +28,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Pull.Remote}"
Text="{DynamicResource Text.Pull.Remote}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="0" Grid.Column="1"
@ -49,7 +49,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Pull.Branch}"
Text="{DynamicResource Text.Pull.Branch}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="1" Grid.Column="1"
@ -69,7 +69,7 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Pull.Into}"
Text="{DynamicResource Text.Pull.Into}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="2" Grid.Column="1"
@ -83,11 +83,11 @@
Margin="0,4,0,0"
x:Name="chkUseRebase"
IsChecked="True"
Content="{StaticResource Text.Pull.UseRebase}"/>
Content="{DynamicResource Text.Pull.UseRebase}"/>
<CheckBox Grid.Row="4" Grid.Column="1"
x:Name="chkAutoStash"
IsChecked="True"
Content="{StaticResource Text.Pull.AutoStash}"/>
Content="{DynamicResource Text.Pull.AutoStash}"/>
</Grid>
</controls:PopupWidget>

View file

@ -27,7 +27,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Push.Local}"
Text="{DynamicResource Text.Push.Local}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="0" Grid.Column="1"
@ -48,7 +48,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Push.Remote}"
Text="{DynamicResource Text.Push.Remote}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="1" Grid.Column="1"
@ -69,7 +69,7 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Push.To}"
Text="{DynamicResource Text.Push.To}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="2" Grid.Column="1"
@ -90,11 +90,11 @@
Margin="0,4,0,0"
x:Name="chkAllTags"
IsChecked="False"
Content="{StaticResource Text.Push.WithAllTags}"/>
Content="{DynamicResource Text.Push.WithAllTags}"/>
<CheckBox Grid.Row="4" Grid.Column="1"
x:Name="chkForce"
IsChecked="False"
Content="{StaticResource Text.Push.Force}"/>
Content="{DynamicResource Text.Push.Force}"/>
</Grid>
</controls:PopupWidget>

View file

@ -21,7 +21,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.PushTag.Tag}"
Text="{DynamicResource Text.PushTag.Tag}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -34,7 +34,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.PushTag.Remote}"
Text="{DynamicResource Text.PushTag.Remote}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="1" Grid.Column="1"

View file

@ -22,7 +22,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Rebase.Target}"
Text="{DynamicResource Text.Rebase.Target}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -35,7 +35,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Rebase.On}"
Text="{DynamicResource Text.Rebase.On}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="1" Grid.Column="1"
@ -49,6 +49,6 @@
Grid.Row="2" Grid.Column="1"
x:Name="chkAutoStash"
IsChecked="True"
Content="{StaticResource Text.Rebase.AutoStash}"/>
Content="{DynamicResource Text.Rebase.AutoStash}"/>
</Grid>
</controls:PopupWidget>

View file

@ -23,13 +23,13 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Remote.Name}"
Text="{DynamicResource Text.Remote.Name}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
x:Name="txtName"
Height="24"
Placeholder="{StaticResource Text.Remote.Name.Placeholder}">
Placeholder="{DynamicResource Text.Remote.Name.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="RemoteName" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>
@ -42,13 +42,13 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Remote.URL}"
Text="{DynamicResource Text.Remote.URL}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
x:Name="txtUrl"
Height="24"
Placeholder="{StaticResource Text.Remote.URL.Placeholder}">
Placeholder="{DynamicResource Text.Remote.URL.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="RemoteURL" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>

View file

@ -23,7 +23,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.RenameBranch.Target}"
Text="{DynamicResource Text.RenameBranch.Target}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,13 +36,13 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.RenameBranch.Name}"
Text="{DynamicResource Text.RenameBranch.Name}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="1" Grid.Column="1"
x:Name="txtNewName"
Height="24"
Placeholder="{StaticResource Text.RenameBranch.Name.Placeholder}">
Placeholder="{DynamicResource Text.RenameBranch.Name.Placeholder}">
<controls:TextEdit.Text>
<Binding ElementName="me" Path="NewName" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">
<Binding.ValidationRules>

View file

@ -23,7 +23,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Reset.Target}"
Text="{DynamicResource Text.Reset.Target}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,7 +36,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Reset.MoveTo}"
Text="{DynamicResource Text.Reset.MoveTo}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="1" Grid.Column="1"
@ -49,7 +49,7 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Reset.Mode}"
Text="{DynamicResource Text.Reset.Mode}"
HorizontalAlignment="Right"/>
<ComboBox
Grid.Row="2" Grid.Column="1"
@ -63,7 +63,7 @@
<StackPanel Orientation="Horizontal" Height="20">
<Path Width="12" Height="12" Margin="4,0,0,0" Fill="{Binding Color}" Data="M 0,0 A 180,180 180 1 1 1,1 Z"/>
<TextBlock Text="{Binding Name}" Margin="4,0"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Text="{Binding Desc}" Margin="4,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>

View file

@ -21,7 +21,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Revert.Commit}"
Text="{DynamicResource Text.Revert.Commit}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -36,6 +36,6 @@
Margin="0,4,0,0"
x:Name="chkCommit"
IsChecked="True"
Content="{StaticResource Text.Revert.CommitChanges}"/>
Content="{DynamicResource Text.Revert.CommitChanges}"/>
</Grid>
</controls:PopupWidget>

View file

@ -21,18 +21,18 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.Stash.Message}"
Text="{DynamicResource Text.Stash.Message}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
x:Name="txtMessage"
Height="24"
Placeholder="{StaticResource Text.Stash.Message.Placeholder}"/>
Placeholder="{DynamicResource Text.Stash.Message.Placeholder}"/>
<CheckBox
Grid.Row="1" Grid.Column="1"
Margin="0,4,0,0"
x:Name="chkIncludeUntracked"
IsChecked="True"
Content="{StaticResource Text.Stash.IncludeUntracked}"/>
Content="{DynamicResource Text.Stash.IncludeUntracked}"/>
</Grid>
</controls:PopupWidget>

View file

@ -25,7 +25,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.SubTreePullOrPush.Prefix}"
Text="{DynamicResource Text.SubTreePullOrPush.Prefix}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -38,7 +38,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.SubTreePullOrPush.Source}"
Text="{DynamicResource Text.SubTreePullOrPush.Source}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="1" Grid.Column="1"
@ -51,7 +51,7 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.SubTreePullOrPush.Branch}"
Text="{DynamicResource Text.SubTreePullOrPush.Branch}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="2" Grid.Column="1"
@ -71,6 +71,6 @@
Margin="0,4,0,0"
x:Name="chkSquash"
IsChecked="True"
Content="{StaticResource Text.SubTreePullOrPush.Squash}"/>
Content="{DynamicResource Text.SubTreePullOrPush.Squash}"/>
</Grid>
</controls:PopupWidget>

View file

@ -24,7 +24,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.SubTreePullOrPush.Prefix}"
Text="{DynamicResource Text.SubTreePullOrPush.Prefix}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -37,7 +37,7 @@
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.SubTreePullOrPush.Source}"
Text="{DynamicResource Text.SubTreePullOrPush.Source}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="1" Grid.Column="1"
@ -50,7 +50,7 @@
<TextBlock
Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.SubTreePullOrPush.Branch}"
Text="{DynamicResource Text.SubTreePullOrPush.Branch}"
HorizontalAlignment="Right"/>
<controls:TextEdit
Grid.Row="2" Grid.Column="1"

View file

@ -21,7 +21,7 @@
<TextBlock
Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0"
Text="{StaticResource Text.UnlinkSubTree.Prefix}"
Text="{DynamicResource Text.UnlinkSubTree.Prefix}"
HorizontalAlignment="Right"/>
<StackPanel
Grid.Row="0" Grid.Column="1"
@ -34,7 +34,7 @@
<TextBlock
Grid.Row="1" Grid.Column="1"
Margin="0,0,8,0"
Text="{StaticResource Text.UnlinkSubTree.Tips}"
Text="{DynamicResource Text.UnlinkSubTree.Tips}"
HorizontalAlignment="Left"/>
</Grid>
</controls:PopupWidget>

View file

@ -10,7 +10,7 @@
mc:Ignorable="d"
WindowStartupLocation="CenterOwner"
ResizeMode="NoResize"
Title="{StaticResource Text.Preference}"
Title="{DynamicResource Text.Preference}"
Width="500" SizeToContent="Height">
<Grid>
<Grid.RowDefinitions>
@ -20,7 +20,7 @@
</Grid.RowDefinitions>
<!-- Title bar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@ -32,7 +32,7 @@
<Path Grid.Column="0" Width="14" Height="14" Margin="6,0" Data="{StaticResource Icon.Preference}"/>
<!-- Title -->
<TextBlock Grid.Column="1" Text="{StaticResource Text.Preference}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.Preference}"/>
<!-- Close -->
<controls:IconButton
@ -47,7 +47,7 @@
<Rectangle
Grid.Row="1"
HorizontalAlignment="Stretch"
Fill="{StaticResource Brush.Border0}"/>
Fill="{DynamicResource Brush.Border0}"/>
<!-- Body -->
<Grid Grid.Row="2" Margin="16,8">
@ -58,7 +58,6 @@
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="8"/>
<RowDefinition Height="36"/>
<RowDefinition Height="28"/>
@ -80,21 +79,16 @@
</Grid.ColumnDefinitions>
<!-- General Group -->
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
<TextBlock
Text="{StaticResource Text.Preference.General}"
FontSize="16" FontWeight="DemiBold"
Foreground="{StaticResource Brush.FG2}"/>
<TextBlock
Text="{StaticResource Text.Preference.RestartRequired}"
Foreground="{StaticResource Brush.FG2}"
Margin="16,0"/>
</StackPanel>
<TextBlock
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Text="{DynamicResource Text.Preference.General}"
FontSize="16" FontWeight="DemiBold"
Foreground="{DynamicResource Brush.FG2}"/>
<!-- Language -->
<TextBlock
Grid.Row="1" Grid.Column="0"
Text="{StaticResource Text.Preference.Locale}"
Text="{DynamicResource Text.Preference.Locale}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<ComboBox
@ -103,12 +97,13 @@
ItemsSource="{Binding Source={x:Static models:Locale.Supported}}"
DisplayMemberPath="Name"
SelectedValuePath="Resource"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}"/>
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.Locale, Mode=TwoWay}"
SelectionChanged="LocaleChanged"/>
<!-- Avatar -->
<TextBlock
Grid.Row="2" Grid.Column="0"
Text="{StaticResource Text.Preference.AvatarServer}"
Text="{DynamicResource Text.Preference.AvatarServer}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<ComboBox
@ -118,45 +113,39 @@
DisplayMemberPath="Name"
SelectedValuePath="Url"
SelectedValue="{Binding Source={x:Static models:Preference.Instance}, Path=General.AvatarServer, Mode=TwoWay}"/>
<!-- Use Dark Theme -->
<CheckBox
Grid.Row="3" Grid.Column="1"
Content="{StaticResource Text.Preference.UseDark}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.UseDarkTheme, Mode=TwoWay}"/>
<!-- Enable Check For Update -->
<CheckBox
Grid.Row="4" Grid.Column="1"
Content="{StaticResource Text.Preference.CheckUpdate}"
Grid.Row="3" Grid.Column="1"
Content="{DynamicResource Text.Preference.CheckUpdate}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.CheckForUpdate, Mode=TwoWay}"/>
<!-- Auto Fetch -->
<CheckBox
Grid.Row="5" Grid.Column="1"
Content="{StaticResource Text.Preference.AutoFetch}"
Grid.Row="4" Grid.Column="1"
Content="{DynamicResource Text.Preference.AutoFetch}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=General.AutoFetchRemotes, Mode=TwoWay}"/>
<!-- Restore Windows -->
<CheckBox
Grid.Row="6" Grid.Column="1"
Content="{StaticResource Text.Preference.RestoreTabs}"
Grid.Row="5" Grid.Column="1"
Content="{DynamicResource Text.Preference.RestoreTabs}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Restore.IsEnabled, Mode=TwoWay}"/>
<!-- Git Group -->
<TextBlock
Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2"
Text="{StaticResource Text.Preference.Git}"
Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2"
Text="{DynamicResource Text.Preference.Git}"
FontSize="16" FontWeight="DemiBold"
Foreground="{StaticResource Brush.FG2}"/>
Foreground="{DynamicResource Brush.FG2}"/>
<!-- Git Executable Path -->
<TextBlock
Grid.Row="9" Grid.Column="0"
Text="{StaticResource Text.Preference.Git.Path}"
Grid.Row="8" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Path}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<Grid Grid.Row="9" Grid.Column="1">
<Grid Grid.Row="8" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
@ -167,23 +156,23 @@
x:Name="editGitPath"
Height="24"
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.Path, Mode=TwoWay}"
Placeholder="{StaticResource Text.Preference.Git.Path.Placeholder}"/>
Placeholder="{DynamicResource Text.Preference.Git.Path.Placeholder}"/>
<controls:IconButton
Grid.Column="1"
Click="SelectGitPath"
Width="24" Height="24"
Margin="4,0,0,0" Padding="4"
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<!-- Default Clone Dir -->
<TextBlock
Grid.Row="10" Grid.Column="0"
Text="{StaticResource Text.Preference.Git.Dir}"
Grid.Row="9" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Dir}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<Grid Grid.Row="10" Grid.Column="1">
<Grid Grid.Row="9" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
@ -193,49 +182,49 @@
Grid.Column="0"
x:Name="txtGitCloneDir"
Height="24"
Placeholder="{StaticResource Text.Preference.Git.Dir.Placeholder}"
Placeholder="{DynamicResource Text.Preference.Git.Dir.Placeholder}"
Text="{Binding Source={x:Static models:Preference.Instance}, Path=Git.DefaultCloneDir, Mode=TwoWay}"/>
<controls:IconButton
Grid.Column="1"
Click="SelectGitCloneDir"
Width="24" Height="24"
Margin="4,0,0,0" Padding="4"
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<!-- User -->
<TextBlock
Grid.Row="10" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.User}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<controls:TextEdit
Grid.Row="10" Grid.Column="1"
Height="24"
Text="{Binding ElementName=me, Path=User, Mode=TwoWay}"
Placeholder="{DynamicResource Text.Preference.Git.User.Placeholder}"/>
<!-- Email -->
<TextBlock
Grid.Row="11" Grid.Column="0"
Text="{StaticResource Text.Preference.Git.User}"
Text="{DynamicResource Text.Preference.Git.Email}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<controls:TextEdit
Grid.Row="11" Grid.Column="1"
Height="24"
Text="{Binding ElementName=me, Path=User, Mode=TwoWay}"
Placeholder="{StaticResource Text.Preference.Git.User.Placeholder}"/>
<!-- Email -->
<TextBlock
Grid.Row="12" Grid.Column="0"
Text="{StaticResource Text.Preference.Git.Email}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<controls:TextEdit
Grid.Row="12" Grid.Column="1"
Height="24"
Text="{Binding ElementName=me, Path=Email, Mode=TwoWay}"
Placeholder="{StaticResource Text.Preference.Git.Email.Placeholder}"/>
Placeholder="{DynamicResource Text.Preference.Git.Email.Placeholder}"/>
<!-- CRLF -->
<TextBlock
Grid.Row="13" Grid.Column="0"
Text="{StaticResource Text.Preference.Git.CRLF}"
Grid.Row="12" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.CRLF}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<ComboBox
Grid.Row="13" Grid.Column="1"
Grid.Row="12" Grid.Column="1"
Height="24"
ItemsSource="{Binding Source={x:Static models:CRLFOption.Supported}}"
SelectedValuePath="Value"
@ -244,7 +233,7 @@
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="20">
<TextBlock Text="{Binding Display}" Margin="2,0"/>
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="10" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="10" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
@ -252,19 +241,19 @@
<!-- Merge Tool Group -->
<TextBlock
Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="2"
Text="{StaticResource Text.Preference.Merger}"
Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2"
Text="{DynamicResource Text.Preference.Merger}"
FontSize="16" FontWeight="DemiBold"
Foreground="{StaticResource Brush.FG2}"/>
Foreground="{DynamicResource Brush.FG2}"/>
<!-- Merge Tool Type -->
<TextBlock
Grid.Row="16" Grid.Column="0"
Text="{StaticResource Text.Preference.Merger.Type}"
Grid.Row="15" Grid.Column="0"
Text="{DynamicResource Text.Preference.Merger.Type}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<ComboBox
Grid.Row="16" Grid.Column="1"
Grid.Row="15" Grid.Column="1"
Height="24"
ItemsSource="{Binding Source={x:Static models:MergeTool.Supported}}"
DisplayMemberPath="Name"
@ -274,11 +263,11 @@
<!-- Merge Tool Executable Path -->
<TextBlock
Grid.Row="17" Grid.Column="0"
Text="{StaticResource Text.Preference.Merger.Path}"
Grid.Row="16" Grid.Column="0"
Text="{DynamicResource Text.Preference.Merger.Path}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<Grid Grid.Row="17" Grid.Column="1">
<Grid Grid.Row="16" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
@ -288,28 +277,28 @@
Grid.Column="0"
Height="24"
x:Name="txtMergeExec"
Placeholder="{StaticResource Text.Preference.Merger.Path.Placeholder}"
Placeholder="{DynamicResource Text.Preference.Merger.Path.Placeholder}"
Text="{Binding Source={x:Static models:Preference.Instance}, Path=MergeTool.Path, Mode=TwoWay}"/>
<controls:IconButton
Grid.Column="1"
Click="SelectMergeTool"
Width="24" Height="24"
Margin="4,0,0,0" Padding="4"
BorderThickness="1" BorderBrush="{StaticResource Brush.Border1}"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
Icon="{StaticResource Icon.Folder.Open}"/>
</Grid>
<!-- Merge Tool Command -->
<TextBlock
Grid.Row="18" Grid.Column="0"
Text="{StaticResource Text.Preference.Merger.Cmd}"
Grid.Row="17" Grid.Column="0"
Text="{DynamicResource Text.Preference.Merger.Cmd}"
HorizontalAlignment="Right"
Margin="0,0,6,0"/>
<TextBlock
Grid.Row="18" Grid.Column="1"
Grid.Row="17" Grid.Column="1"
x:Name="txtMergeCmd"
Text="{Binding ElementName=me, Path=MergeCmd}"
Foreground="{StaticResource Brush.FG2}"/>
Foreground="{DynamicResource Brush.FG2}"/>
</Grid>
</Grid>
</controls:Window>

View file

@ -15,12 +15,6 @@ namespace SourceGit.Views {
public string CRLF { get; set; }
public string MergeCmd { get; set; }
private string locale;
private string avatarServer;
private bool useDarkTheme;
private bool checkUpdate;
private bool autoFetch;
public Preference() {
if (Models.Preference.Instance.IsReady) {
User = new Commands.Config().Get("user.name");
@ -36,16 +30,15 @@ namespace SourceGit.Views {
var merger = Models.MergeTool.Supported.Find(x => x.Type == Models.Preference.Instance.MergeTool.Type);
if (merger != null) MergeCmd = merger.Cmd;
locale = Models.Preference.Instance.General.Locale;
avatarServer = Models.Preference.Instance.General.AvatarServer;
useDarkTheme = Models.Preference.Instance.General.UseDarkTheme;
checkUpdate = Models.Preference.Instance.General.CheckForUpdate;
autoFetch = Models.Preference.Instance.General.AutoFetchRemotes;
InitializeComponent();
}
#region EVENTS
private void LocaleChanged(object sender, SelectionChangedEventArgs e) {
Models.Locale.Change();
e.Handled = true;
}
private void SelectGitPath(object sender, RoutedEventArgs e) {
var dialog = new OpenFileDialog();
dialog.Filter = "Git Executable|git.exe";
@ -116,28 +109,7 @@ namespace SourceGit.Views {
}
Models.Preference.Save();
var general = Models.Preference.Instance.General;
if (locale != general.Locale ||
avatarServer != general.AvatarServer ||
useDarkTheme != general.UseDarkTheme ||
checkUpdate != general.CheckForUpdate ||
autoFetch != general.AutoFetchRemotes) {
var result = MessageBox.Show(
this,
App.Text("Restart.Content"),
App.Text("Restart.Title"),
MessageBoxButton.OKCancel,
MessageBoxImage.Question,
MessageBoxResult.Cancel);
if (result == MessageBoxResult.OK) {
App.Restart();
} else {
Close();
}
} else {
Close();
}
Close();
}
#endregion
}

View file

@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
mc:Ignorable="d"
Title="{StaticResource Text.UpdateAvailable}"
Title="{DynamicResource Text.UpdateAvailable}"
WindowStartupLocation="CenterOwner"
Height="400" Width="500"
ResizeMode="NoResize">
@ -21,7 +21,7 @@
</Grid.RowDefinitions>
<!-- Title Bar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}">
<Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@ -33,7 +33,7 @@
<Path Grid.Column="0" Width="16" Height="16" Margin="6,0" Data="{StaticResource Icon.Fetch}"/>
<!-- Title -->
<TextBlock Grid.Column="1" Text="{StaticResource Text.UpdateAvailable}"/>
<TextBlock Grid.Column="1" Text="{DynamicResource Text.UpdateAvailable}"/>
<!-- Close -->
<controls:IconButton
@ -45,13 +45,13 @@
WindowChrome.IsHitTestVisibleInChrome="True"/>
</Grid>
<Rectangle Grid.Row="1" Fill="{StaticResource Brush.Border0}" HorizontalAlignment="Stretch" Height="1"/>
<Rectangle Grid.Row="1" Fill="{DynamicResource Brush.Border0}" HorizontalAlignment="Stretch" Height="1"/>
<!-- Body -->
<StackPanel Grid.Row="2" Orientation="Vertical" Margin="8,16,8,0">
<!-- Title -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Path Width="20" Height="20" Data="{StaticResource Icon.Git}" Fill="{StaticResource Brush.Logo}"/>
<Path Width="20" Height="20" Data="{StaticResource Icon.Git}" Fill="{DynamicResource Brush.Logo}"/>
<TextBlock x:Name="txtRelease" Margin="8,0,0,0" FontSize="18" FontWeight="Bold" Text="Release 1.0 Is Out!!!"/>
</StackPanel>
@ -68,26 +68,26 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.Time}" FontWeight="Bold"/>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Text.UpdateAvailable.Time}" FontWeight="Bold"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.PublishTime}"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.Based}" FontWeight="Bold"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Text.UpdateAvailable.Based}" FontWeight="Bold"/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.CommitSHA}"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="{StaticResource Text.UpdateAvailable.IsPreRelease}" FontWeight="Bold"/>
<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource Text.UpdateAvailable.IsPreRelease}" FontWeight="Bold"/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding ElementName=me, Path=Version.IsPrerelease}"/>
</Grid>
</StackPanel>
<!-- CHANGELOG -->
<Border Grid.Row="3" Margin="8" Background="{StaticResource Brush.Contents}" BorderBrush="{StaticResource Brush.Border1}" BorderThickness="1">
<Border Grid.Row="3" Margin="8" Background="{DynamicResource Brush.Contents}" BorderBrush="{DynamicResource Brush.Border1}" BorderThickness="1">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBlock
FontSize="10pt"
FontFamily="Consolas"
Padding="8"
VerticalAlignment="Top"
Foreground="{StaticResource Brush.FG2}"
Foreground="{DynamicResource Brush.FG2}"
Text="{Binding ElementName=me, Path=Version.Body}"/>
</ScrollViewer>
</Border>
@ -97,16 +97,16 @@
<Button
Click="Download"
Width="100" Height="24"
Content="{StaticResource Text.UpdateAvailable.Download}"
Background="{StaticResource Brush.Accent1}"
BorderBrush="{StaticResource Brush.FG1}"
Content="{DynamicResource Text.UpdateAvailable.Download}"
Background="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.FG1}"
BorderThickness="1"/>
<Button
Click="Quit"
Width="100" Height="24"
Margin="8,0,0,0"
Content="{StaticResource Text.Cancel}"/>
Content="{DynamicResource Text.Cancel}"/>
</StackPanel>
</Grid>
</controls:Window>

View file

@ -14,11 +14,6 @@ namespace SourceGit.Views {
txtRelease.Text = App.Text("UpdateAvailable.Title", ver.Name);
}
public static void Open(Window owner, Models.Version ver) {
var dialog = new Upgrade(ver) { Owner = owner };
dialog.ShowDialog();
}
private void Download(object sender, RoutedEventArgs e) {
var info = new ProcessStartInfo("cmd", $"/c start https://gitee.com/sourcegit/SourceGit/releases/{Version.TagName}");
info.CreateNoWindow = true;

View file

@ -41,19 +41,19 @@
<Border
Grid.Column="0" Grid.ColumnSpan="2"
BorderBrush="{StaticResource Brush.Border2}"
BorderBrush="{DynamicResource Brush.Border2}"
BorderThickness="1"/>
<Path
Grid.Column="0"
Width="14" Height="14"
Fill="{StaticResource Brush.FG2}"
Fill="{DynamicResource Brush.FG2}"
Data="{StaticResource Icon.Search}"
IsHitTestVisible="False"/>
<controls:TextEdit
Grid.Column="1"
Height="24"
Margin="0"
Placeholder="{StaticResource Text.CommitViewer.Changes.Search}"
Placeholder="{DynamicResource Text.CommitViewer.Changes.Search}"
BorderThickness="0"
TextChanged="SearchFilterChanged"/>
@ -67,9 +67,9 @@
<Border
Grid.Row="1"
BorderBrush="{StaticResource Brush.Border2}"
BorderBrush="{DynamicResource Brush.Border2}"
BorderThickness="1"
Background="{StaticResource Brush.Contents}">
Background="{DynamicResource Brush.Contents}">
<Grid x:Name="layerChanges">
<controls:Tree
x:Name="modeTree"
@ -174,7 +174,7 @@
<DataGridTemplateColumn IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock FontFamily="Consolas" Margin="4,0,0,0" Text="{Binding Path, Converter={StaticResource PureFolderName}}" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock FontFamily="Consolas" Margin="4,0,0,0" Text="{Binding Path, Converter={StaticResource PureFolderName}}" Foreground="{DynamicResource Brush.FG2}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

View file

@ -9,7 +9,7 @@
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<TabControl x:Name="body">
<TabItem Header="{StaticResource Text.CommitViewer.Info}">
<TabItem Header="{DynamicResource Text.CommitViewer.Info}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@ -37,12 +37,12 @@
<!-- Author Info -->
<StackPanel Grid.Column="1" Margin="16,0,8,0" Orientation="Vertical">
<TextBlock FontWeight="Bold" Text="{StaticResource Text.CommitViewer.Info.Author}" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock FontWeight="Bold" Text="{DynamicResource Text.CommitViewer.Info.Author}" Foreground="{DynamicResource Brush.FG2}"/>
<StackPanel Orientation="Horizontal" Margin="0,12,0,8">
<controls:TextEdit x:Name="txtAuthorName" FontFamily="Consolas,Microsoft YaHei UI" FontSize="10pt" IsReadOnly="True" BorderThickness="0"/>
<controls:TextEdit x:Name="txtAuthorEmail" FontFamily="Consolas,Microsoft YaHei UI" FontSize="10pt" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}" Margin="4,0,0,0"/>
<controls:TextEdit x:Name="txtAuthorEmail" FontFamily="Consolas,Microsoft YaHei UI" FontSize="10pt" IsReadOnly="True" BorderThickness="0" Foreground="{DynamicResource Brush.FG2}" Margin="4,0,0,0"/>
</StackPanel>
<controls:TextEdit x:Name="txtAuthorTime" FontFamily="Consolas" FontSize="9pt" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}"/>
<controls:TextEdit x:Name="txtAuthorTime" FontFamily="Consolas" FontSize="9pt" IsReadOnly="True" BorderThickness="0" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
<!-- Committer Avatar -->
@ -54,17 +54,17 @@
<!-- Committer Info -->
<StackPanel x:Name="committerInfoPanel" Grid.Column="3" Margin="16,0,8,0" Orientation="Vertical">
<TextBlock FontWeight="Bold" Text="{StaticResource Text.CommitViewer.Info.Committer}" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock FontWeight="Bold" Text="{DynamicResource Text.CommitViewer.Info.Committer}" Foreground="{DynamicResource Brush.FG2}"/>
<StackPanel Orientation="Horizontal" Margin="0,12,0,8">
<controls:TextEdit x:Name="txtCommitterName" FontFamily="Consolas,Microsoft YaHei UI" FontSize="10pt" IsReadOnly="True" BorderThickness="0"/>
<controls:TextEdit x:Name="txtCommitterEmail" FontFamily="Consolas,Microsoft YaHei UI" FontSize="10pt" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}" Margin="4,0,0,0"/>
<controls:TextEdit x:Name="txtCommitterEmail" FontFamily="Consolas,Microsoft YaHei UI" FontSize="10pt" IsReadOnly="True" BorderThickness="0" Foreground="{DynamicResource Brush.FG2}" Margin="4,0,0,0"/>
</StackPanel>
<controls:TextEdit x:Name="txtCommitterTime" FontFamily="Consolas" FontSize="9pt" IsReadOnly="True" BorderThickness="0" Foreground="{StaticResource Brush.FG2}"/>
<controls:TextEdit x:Name="txtCommitterTime" FontFamily="Consolas" FontSize="9pt" IsReadOnly="True" BorderThickness="0" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</Grid>
<!-- Line -->
<Rectangle Grid.Row="1" Height="1" Margin="8" Fill="{StaticResource Brush.Border2}" VerticalAlignment="Center"/>
<Rectangle Grid.Row="1" Height="1" Margin="8" Fill="{DynamicResource Brush.Border2}" VerticalAlignment="Center"/>
<!-- Base Information -->
<Grid Grid.Row="2">
@ -85,8 +85,8 @@
Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Right"
FontWeight="Bold"
Text="{StaticResource Text.CommitViewer.Info.SHA}"
Foreground="{StaticResource Brush.FG2}"/>
Text="{DynamicResource Text.CommitViewer.Info.SHA}"
Foreground="{DynamicResource Brush.FG2}"/>
<controls:TextEdit
Grid.Row="0" Grid.Column="1"
Height="24"
@ -101,8 +101,8 @@
Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Right"
FontWeight="Bold"
Text="{StaticResource Text.CommitViewer.Info.Parents}"
Foreground="{StaticResource Brush.FG2}"/>
Text="{DynamicResource Text.CommitViewer.Info.Parents}"
Foreground="{DynamicResource Brush.FG2}"/>
<ItemsControl Grid.Row="1" Grid.Column="1" x:Name="listParents" Height="24" Margin="13,0,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -113,7 +113,7 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Margin="0,0,8,0" FontFamily="Consolas">
<Hyperlink RequestNavigate="OnNavigateParent" NavigateUri="{Binding .}" ToolTip="{StaticResource Text.Goto}">
<Hyperlink RequestNavigate="OnNavigateParent" NavigateUri="{Binding .}" ToolTip="{DynamicResource Text.Goto}">
<Run Text="{Binding .}"/>
</Hyperlink>
</TextBlock>
@ -126,8 +126,8 @@
Grid.Row="2" Grid.Column="0"
HorizontalAlignment="Right"
FontWeight="Bold"
Text="{StaticResource Text.CommitViewer.Info.Refs}"
Foreground="{StaticResource Brush.FG2}"/>
Text="{DynamicResource Text.CommitViewer.Info.Refs}"
Foreground="{DynamicResource Brush.FG2}"/>
<ItemsControl Grid.Row="2" Grid.Column="1" x:Name="listRefs" Height="24" Margin="11,0,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -138,8 +138,8 @@
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type models:Decorator}">
<StackPanel Orientation="Horizontal" Height="16" Margin="2,0">
<Border Background="{StaticResource Brush.Decorator}">
<Path x:Name="Icon" Margin="4,0" Width="8" Height="8" Data="{StaticResource Icon.Branch}" Fill="{StaticResource Brush.DecoratorIcon}"/>
<Border Background="{DynamicResource Brush.Decorator}">
<Path x:Name="Icon" Margin="4,0" Width="8" Height="8" Data="{StaticResource Icon.Branch}" Fill="{DynamicResource Brush.DecoratorIcon}"/>
</Border>
<Border x:Name="Color" Background="#FFFFB835">
@ -169,8 +169,8 @@
Margin="0,4,0,0"
HorizontalAlignment="Right" VerticalAlignment="Top"
FontWeight="Bold"
Text="{StaticResource Text.CommitViewer.Info.Message}"
Foreground="{StaticResource Brush.FG2}"/>
Text="{DynamicResource Text.CommitViewer.Info.Message}"
Foreground="{DynamicResource Brush.FG2}"/>
<controls:TextEdit
Grid.Row="3" Grid.Column="1"
x:Name="txtMessage"
@ -184,7 +184,7 @@
</Grid>
<!-- Line -->
<Rectangle Grid.Row="3" Height="1" Margin="8" Fill="{StaticResource Brush.Border2}" VerticalAlignment="Center"/>
<Rectangle Grid.Row="3" Height="1" Margin="8" Fill="{DynamicResource Brush.Border2}" VerticalAlignment="Center"/>
<!-- Change List -->
<Grid Grid.Row="4">
@ -198,8 +198,8 @@
Margin="0,4,0,0"
HorizontalAlignment="Right" VerticalAlignment="Top"
FontWeight="Bold"
Text="{StaticResource Text.CommitViewer.Info.Changed}"
Foreground="{StaticResource Brush.FG2}"/>
Text="{DynamicResource Text.CommitViewer.Info.Changed}"
Foreground="{DynamicResource Brush.FG2}"/>
<DataGrid
Grid.Column="1"
@ -234,12 +234,12 @@
</TabItem>
<!-- Change Details -->
<TabItem Header="{StaticResource Text.CommitViewer.Changes}">
<TabItem Header="{DynamicResource Text.CommitViewer.Changes}">
<widgets:CommitChanges x:Name="changeContainer"/>
</TabItem>
<!-- Revision Files -->
<TabItem Header="{StaticResource Text.CommitViewer.Files}">
<TabItem Header="{DynamicResource Text.CommitViewer.Files}">
<widgets:RevisionFiles x:Name="revisionFiles"/>
</TabItem>
</TabControl>

View file

@ -15,7 +15,7 @@
</Grid.RowDefinitions>
<!-- Toolbar -->
<Border Grid.Row="0" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,0,0,1">
<Border Grid.Row="0" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,0,1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -24,16 +24,16 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="6,0">
<Button Click="Explore" Margin="6,0" ToolTip="{StaticResource Text.Dashboard.Explore.Tip}" BorderThickness="0">
<Button Click="Explore" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Explore.Tip}" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Folder.Open}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Dashboard.Explore}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Explore}"/>
</StackPanel>
</Button>
<Button Click="Terminal" Margin="6,0" ToolTip="{StaticResource Text.Dashboard.Terminal.Tip}" BorderThickness="0">
<Button Click="Terminal" Margin="6,0" ToolTip="{DynamicResource Text.Dashboard.Terminal.Tip}" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Path Width="13" Height="13" Data="{StaticResource Icon.Terminal}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Dashboard.Terminal}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Terminal}"/>
</StackPanel>
</Button>
</StackPanel>
@ -42,46 +42,46 @@
<Button Click="OpenFetch" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Fetch}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Fetch}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Fetch}"/>
</StackPanel>
</Button>
<Button Click="OpenPull" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Pull}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Pull}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Pull}"/>
</StackPanel>
</Button>
<Button Click="OpenPush" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Push}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Push}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Push}"/>
</StackPanel>
</Button>
<Button Click="OpenStash" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.SaveStash}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Stash}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Stash}"/>
</StackPanel>
</Button>
<Button Click="OpenApply" Margin="8,0" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Apply}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Apply}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Apply}"/>
</StackPanel>
</Button>
</StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Click="OpenSearch" Margin="6,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Search.Tip}">
<Button Click="OpenSearch" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Search.Tip}">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Search}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Dashboard.Search}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Dashboard.Search}"/>
</StackPanel>
</Button>
<Button Click="OpenConfigure" Margin="6,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Configure.Tip}">
<Button Click="OpenConfigure" Margin="6,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Configure.Tip}">
<StackPanel Orientation="Horizontal">
<Path Width="14" Height="14" Data="{StaticResource Icon.Setting}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Configure}"/>
<TextBlock Margin="4,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Configure}"/>
</StackPanel>
</Button>
</StackPanel>
@ -118,12 +118,12 @@
</Grid.Resources>
<!-- Workspace -->
<TextBlock Grid.Row="0" Margin="8,0,0,0" Text="{StaticResource Text.Dashboard.Workspace}" FontWeight="DemiBold" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Grid.Row="0" Margin="8,0,0,0" Text="{DynamicResource Text.Dashboard.Workspace}" FontWeight="DemiBold" Foreground="{DynamicResource Brush.FG2}"/>
<ListView Grid.Row="1" x:Name="workspace" SelectionMode="Single" SelectionChanged="OnPageSelectionChanged">
<ListViewItem IsSelected="True">
<StackPanel Margin="16,0,0,0" Height="28" Orientation="Horizontal">
<Path Width="16" Height="16" Data="{StaticResource Icon.Histories}"/>
<TextBlock Margin="8,0,0,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Histories}"/>
<TextBlock Margin="8,0,0,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Histories}"/>
</StackPanel>
</ListViewItem>
<ListViewItem>
@ -134,7 +134,7 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Path Grid.Column="0" Width="16" Height="16" Data="{StaticResource Icon.Send}"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.WorkingCopy}"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy}"/>
<controls:Badge Grid.Column="2" Margin="4,0" x:Name="badgeLocalChanges"/>
</Grid>
</ListViewItem>
@ -146,7 +146,7 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Path Grid.Column="0" Width="16" Height="16" Data="{StaticResource Icon.Stashes}"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{StaticResource Text.Stashes}"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" FontFamily="Consolas,Microsoft YaHei UI" FontWeight="Bold" Text="{DynamicResource Text.Stashes}"/>
<controls:Badge Grid.Column="2" Margin="4,0" x:Name="badgeStashes"/>
</Grid>
</ListViewItem>
@ -160,9 +160,9 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{StaticResource Text.Dashboard.LocalBranches}" FontWeight="DemiBold" Foreground="{StaticResource Brush.FG2}"/>
<controls:IconButton Grid.Column="1" Click="OpenGitFlowPanel" Width="14" Height="14" Margin="8,0" Icon="{StaticResource Icon.Flow}" ToolTip="{StaticResource Text.GitFlow}"/>
<controls:IconButton Grid.Column="2" Click="OpenNewBranch" Width="14" Height="14" Margin="0,0,2,0" Icon="{StaticResource Icon.Branch.Add}" ToolTip="{StaticResource Text.Dashboard.NewBranch}"/>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{DynamicResource Text.Dashboard.LocalBranches}" FontWeight="DemiBold" Foreground="{DynamicResource Brush.FG2}"/>
<controls:IconButton Grid.Column="1" Click="OpenGitFlowPanel" Width="14" Height="14" Margin="8,0" Icon="{StaticResource Icon.Flow}" ToolTip="{DynamicResource Text.GitFlow}"/>
<controls:IconButton Grid.Column="2" Click="OpenNewBranch" Width="14" Height="14" Margin="0,0,2,0" Icon="{StaticResource Icon.Branch.Add}" ToolTip="{DynamicResource Text.Dashboard.NewBranch}"/>
</Grid>
<controls:Tree
Grid.Row="3"
@ -199,7 +199,7 @@
Margin="4,0"
IsChecked="{Binding IsFiltered}"
Style="{StaticResource Style.ToggleButton.Filter}"
ToolTip="{StaticResource Text.Filter}"
ToolTip="{DynamicResource Text.Filter}"
Checked="OnFilterChanged" Unchecked="OnFilterChanged"/>
</Grid>
@ -237,8 +237,8 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{StaticResource Text.Dashboard.Remotes}" FontWeight="DemiBold" Foreground="{StaticResource Brush.FG2}"/>
<controls:IconButton Grid.Column="1" Click="OpenAddRemote" Width="14" Height="14" Margin="0,0,4,0" Icon="{StaticResource Icon.Remote.Add}" ToolTip="{StaticResource Text.Dashboard.Remotes.Add}"/>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{DynamicResource Text.Dashboard.Remotes}" FontWeight="DemiBold" Foreground="{DynamicResource Brush.FG2}"/>
<controls:IconButton Grid.Column="1" Click="OpenAddRemote" Width="14" Height="14" Margin="0,0,4,0" Icon="{StaticResource Icon.Remote.Add}" ToolTip="{DynamicResource Text.Dashboard.Remotes.Add}"/>
</Grid>
<controls:Tree
Grid.Row="5"
@ -272,7 +272,7 @@
Margin="4,0"
IsChecked="{Binding IsFiltered}"
Style="{StaticResource Style.ToggleButton.Filter}"
ToolTip="{StaticResource Text.Filter}"
ToolTip="{DynamicResource Text.Filter}"
Checked="OnFilterChanged" Unchecked="OnFilterChanged"/>
</Grid>
@ -319,9 +319,9 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{StaticResource Text.Dashboard.Tags}" FontWeight="DemiBold" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Grid.Column="1" x:Name="txtTagCount" FontWeight="DemiBold" Margin="4,0,0,0" Foreground="{StaticResource Brush.FG2}"/>
<controls:IconButton Grid.Column="2" Click="OpenNewTag" Width="14" Height="14" Margin="0,0,4,0" Icon="{StaticResource Icon.Tag.Add}" ToolTip="{StaticResource Text.Dashboard.Tags.Add}"/>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{DynamicResource Text.Dashboard.Tags}" FontWeight="DemiBold" Foreground="{DynamicResource Brush.FG2}"/>
<TextBlock Grid.Column="1" x:Name="txtTagCount" FontWeight="DemiBold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.FG2}"/>
<controls:IconButton Grid.Column="2" Click="OpenNewTag" Width="14" Height="14" Margin="0,0,4,0" Icon="{StaticResource Icon.Tag.Add}" ToolTip="{DynamicResource Text.Dashboard.Tags.Add}"/>
</Grid>
</ToggleButton>
<DataGrid
@ -354,7 +354,7 @@
IsChecked="{Binding IsFiltered, Mode=TwoWay}"
Margin="0,0,4,0"
Style="{StaticResource Style.ToggleButton.Filter}"
ToolTip="{StaticResource Text.Filter}"
ToolTip="{DynamicResource Text.Filter}"
Checked="OnFilterChanged" Unchecked="OnFilterChanged"/>
</Grid>
</DataTemplate>
@ -376,10 +376,10 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{StaticResource Text.Dashboard.Submodules}" FontWeight="DemiBold" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Grid.Column="1" x:Name="txtSubmoduleCount" FontWeight="DemiBold" Margin="4,0,0,0" Foreground="{StaticResource Brush.FG2}"/>
<controls:IconButton Grid.Column="2" Click="OpenAddSubmodule" Width="14" Height="14" Margin="8,0" Icon="{StaticResource Icon.Submodule}" ToolTip="{StaticResource Text.Dashboard.Remotes.Add}"/>
<Button Grid.Column="3" Click="UpdateSubmodules" Background="Transparent" Margin="0,0,4,0" BorderThickness="0" ToolTip="{StaticResource Text.Dashboard.Submodules.Update}">
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{DynamicResource Text.Dashboard.Submodules}" FontWeight="DemiBold" Foreground="{DynamicResource Brush.FG2}"/>
<TextBlock Grid.Column="1" x:Name="txtSubmoduleCount" FontWeight="DemiBold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.FG2}"/>
<controls:IconButton Grid.Column="2" Click="OpenAddSubmodule" Width="14" Height="14" Margin="8,0" Icon="{StaticResource Icon.Submodule}" ToolTip="{DynamicResource Text.Dashboard.Remotes.Add}"/>
<Button Grid.Column="3" Click="UpdateSubmodules" Background="Transparent" Margin="0,0,4,0" BorderThickness="0" ToolTip="{DynamicResource Text.Dashboard.Submodules.Update}">
<controls:Loading x:Name="iconUpdateSubmodule" Width="14" Height="14" />
</Button>
</Grid>
@ -426,9 +426,9 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{StaticResource Text.Dashboard.SubTrees}" FontWeight="DemiBold" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock Grid.Column="1" x:Name="txtSubTreeCount" FontWeight="DemiBold" Margin="4,0,0,0" Foreground="{StaticResource Brush.FG2}"/>
<controls:IconButton Grid.Column="2" Click="OpenAddSubTree" Width="14" Height="14" Margin="0,0,4,0" Icon="{StaticResource Icon.TreeAddNode}" ToolTip="{StaticResource Text.Dashboard.SubTrees.Add}"/>
<TextBlock Grid.Column="0" Margin="8,0,0,0" Text="{DynamicResource Text.Dashboard.SubTrees}" FontWeight="DemiBold" Foreground="{DynamicResource Brush.FG2}"/>
<TextBlock Grid.Column="1" x:Name="txtSubTreeCount" FontWeight="DemiBold" Margin="4,0,0,0" Foreground="{DynamicResource Brush.FG2}"/>
<controls:IconButton Grid.Column="2" Click="OpenAddSubTree" Width="14" Height="14" Margin="0,0,4,0" Icon="{StaticResource Icon.TreeAddNode}" ToolTip="{DynamicResource Text.Dashboard.SubTrees.Add}"/>
</Grid>
</ToggleButton>
<DataGrid
@ -466,7 +466,7 @@
Grid.Column="1"
Width="1"
HorizontalAlignment="Center" VerticalAlignment="Stretch"
Background="{StaticResource Brush.Border0}"/>
Background="{DynamicResource Brush.Border0}"/>
<!-- Right -->
<Grid Grid.Column="2">
@ -475,7 +475,7 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" x:Name="mergeNavigator" Height="24" Background="{StaticResource Brush.Conflict}" Visibility="Collapsed">
<Grid Grid.Row="0" x:Name="mergeNavigator" Height="24" Background="{DynamicResource Brush.Conflict}" Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
@ -488,33 +488,33 @@
x:Name="txtConflictTip"
Margin="4,0"
FontWeight="DemiBold"
Foreground="{StaticResource Brush.FG3}"/>
Foreground="{DynamicResource Brush.FG3}"/>
<Button
Grid.Column="1"
x:Name="btnResolve"
Click="GotoResolve"
Width="80"
Margin="2"
Content="{StaticResource Text.Dashboard.Resolve}"
Background="{StaticResource Brush.Window}"
BorderBrush="{StaticResource Brush.FG1}"/>
Content="{DynamicResource Text.Dashboard.Resolve}"
Background="{DynamicResource Brush.Window}"
BorderBrush="{DynamicResource Brush.FG1}"/>
<Button
Grid.Column="2"
x:Name="btnContinue"
Click="ContinueMerge"
Width="80"
Margin="2"
Content="{StaticResource Text.Dashboard.Continue}"
Background="{StaticResource Brush.Accent1}"
BorderBrush="{StaticResource Brush.FG1}"/>
Content="{DynamicResource Text.Dashboard.Continue}"
Background="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.FG1}"/>
<Button
Grid.Column="3"
Click="AbortMerge"
Width="80"
Margin="2,2,4,2"
Content="{StaticResource Text.Dashboard.Abort}"
Background="{StaticResource Brush.Window}"
BorderBrush="{StaticResource Brush.FG1}"/>
Content="{DynamicResource Text.Dashboard.Abort}"
Background="{DynamicResource Brush.Window}"
BorderBrush="{DynamicResource Brush.FG1}"/>
</Grid>
<controls:PageContainer Grid.Row="1" x:Name="pages"/>

View file

@ -13,7 +13,7 @@
</Style>
</UserControl.Resources>
<Border BorderBrush="{StaticResource Brush.Border2}" BorderThickness="1">
<Border BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="26"/>
@ -21,7 +21,7 @@
</Grid.RowDefinitions>
<!-- Tool Bar -->
<Border x:Name="toolbar" Grid.Row="0" BorderBrush="{StaticResource Brush.Border2}" BorderThickness="0,0,0,1">
<Border x:Name="toolbar" Grid.Row="0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,0,0,1">
<Grid Margin="8,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@ -46,22 +46,22 @@
Width="14" Height="14"
Margin="4,0"
Icon="{StaticResource Icon.Down}"
ToolTip="{StaticResource Text.Diff.Next}"
ToolTip="{DynamicResource Text.Diff.Next}"
Click="GotoNextChange"/>
<controls:IconButton
Width="14" Height="14"
Margin="4,0"
Icon="{StaticResource Icon.Up}"
ToolTip="{StaticResource Text.Diff.Prev}"
ToolTip="{DynamicResource Text.Diff.Prev}"
Click="GotoPrevChange"/>
<ToggleButton
Width="14" Height="14"
Margin="4,0"
Style="{StaticResource Style.ToggleButton.SplitDirection}"
Foreground="{StaticResource Brush.FG1}"
ToolTip="{StaticResource Text.Diff.Mode}"
Foreground="{DynamicResource Brush.FG1}"
ToolTip="{DynamicResource Text.Diff.Mode}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Window.UseCombinedDiff, Mode=TwoWay}"
Checked="OnDiffViewModeChanged" Unchecked="OnDiffViewModeChanged"/>
@ -69,7 +69,7 @@
Width="14" Height="14"
Margin="4,0,0,0"
Icon="{StaticResource Icon.DiffWith}"
ToolTip="{StaticResource Text.Diff.UseMerger}"
ToolTip="{DynamicResource Text.Diff.UseMerger}"
Click="OpenWithMerger"/>
</StackPanel>
</Grid>
@ -82,21 +82,21 @@
</Grid.ColumnDefinitions>
</Grid>
<Border x:Name="sizeChange" Grid.Row="1" Background="{StaticResource Brush.Window}">
<Border x:Name="sizeChange" Grid.Row="1" Background="{DynamicResource Brush.Window}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" TextElement.FontFamily="Consolas">
<TextBlock
x:Name="txtSizeChangeTitle"
Text="{StaticResource Text.Diff.Binary}"
Text="{DynamicResource Text.Diff.Binary}"
Margin="0,0,0,32"
FontSize="18" FontWeight="UltraBold"
Foreground="{StaticResource Brush.FG2}"
Foreground="{DynamicResource Brush.FG2}"
HorizontalAlignment="Center"/>
<Path
x:Name="iconSizeChange"
Width="64" Height="64"
Data="{StaticResource Icon.Binary}"
Fill="{StaticResource Brush.FG2}"/>
Fill="{DynamicResource Brush.FG2}"/>
<Grid Margin="0,16,0,0" HorizontalAlignment="Center">
<Grid.RowDefinitions>
@ -110,34 +110,34 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource Text.Diff.Binary.Old}" Foreground="{StaticResource Brush.FG2}" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
<TextBlock Grid.Row="0" Grid.Column="2" x:Name="txtOldSize" Foreground="{StaticResource Brush.FG2}" HorizontalAlignment="Right" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="{StaticResource Text.Diff.Binary.New}" Foreground="{StaticResource Brush.FG2}" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
<TextBlock Grid.Row="1" Grid.Column="2" x:Name="txtNewSize" Foreground="{StaticResource Brush.FG2}" HorizontalAlignment="Right" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Text.Diff.Binary.Old}" Foreground="{DynamicResource Brush.FG2}" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
<TextBlock Grid.Row="0" Grid.Column="2" x:Name="txtOldSize" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Text.Diff.Binary.New}" Foreground="{DynamicResource Brush.FG2}" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
<TextBlock Grid.Row="1" Grid.Column="2" x:Name="txtNewSize" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right" TextElement.FontSize="18" TextElement.FontWeight="UltraBold"/>
</Grid>
</StackPanel>
</Border>
<Border x:Name="noChange" Grid.Row="1" Background="{StaticResource Brush.Window}">
<Border x:Name="noChange" Grid.Row="1" Background="{DynamicResource Brush.Window}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<Path Width="64" Height="64" Data="{StaticResource Icon.Check}" Fill="{StaticResource Brush.FG2}"/>
<Path Width="64" Height="64" Data="{StaticResource Icon.Check}" Fill="{DynamicResource Brush.FG2}"/>
<TextBlock
Margin="0,16,0,0"
Text="{StaticResource Text.Diff.NoChange}"
Text="{DynamicResource Text.Diff.NoChange}"
FontSize="18" FontWeight="UltraBold"
Foreground="{StaticResource Brush.FG2}"
Foreground="{DynamicResource Brush.FG2}"
HorizontalAlignment="Center"/>
</StackPanel>
</Border>
<Border x:Name="mask" Grid.Row="0" Grid.RowSpan="2" Background="{StaticResource Brush.Window}">
<Border x:Name="mask" Grid.Row="0" Grid.RowSpan="2" Background="{DynamicResource Brush.Window}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<Path Width="64" Height="64" Data="{StaticResource Icon.Diff}" Fill="{StaticResource Brush.FG2}"/>
<Path Width="64" Height="64" Data="{StaticResource Icon.Diff}" Fill="{DynamicResource Brush.FG2}"/>
<TextBlock
Margin="0,16,0,0"
Text="{StaticResource Text.Diff.Welcome}"
Text="{DynamicResource Text.Diff.Welcome}"
FontSize="18" FontWeight="UltraBold" TextOptions.TextFormattingMode="Ideal"
Foreground="{StaticResource Brush.FG2}"
Foreground="{DynamicResource Brush.FG2}"
HorizontalAlignment="Center"/>
</StackPanel>
</Border>

View file

@ -62,6 +62,7 @@ namespace SourceGit.Views.Widgets {
private List<Rectangle> splitters = new List<Rectangle>();
public DiffViewer() {
Models.Theme.AddListener(this, Reload);
InitializeComponent();
Reset();
}
@ -223,6 +224,7 @@ namespace SourceGit.Views.Widgets {
block.OldLine = line.OldLine;
block.NewLine = line.NewLine;
if (line.OldLine.Length > 0) lastOldLine = line.OldLine;
if (line.NewLine.Length > 0) lastNewLine = line.NewLine;
@ -402,10 +404,10 @@ namespace SourceGit.Views.Widgets {
private void AddSplitter(int column, double offset) {
var split = new Rectangle();
split.Width = 1;
split.Fill = FindResource("Brush.Border2") as Brush;
split.HorizontalAlignment = HorizontalAlignment.Left;
split.Margin = new Thickness(offset, 0, 0, 0);
split.SetValue(Grid.ColumnProperty, column);
split.SetResourceReference(Rectangle.FillProperty, "Brush.Border2");
textDiff.Children.Add(split);
splitters.Add(split);

View file

@ -12,7 +12,7 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Height="Auto" Width="300" Margin="8">
<Border Background="{StaticResource Brush.Window}" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="1">
<Border Background="{DynamicResource Brush.Window}" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="1">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" Opacity=".5"/>
</Border.Effect>
@ -25,7 +25,7 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{StaticResource Text.Launcher.Error}" FontWeight="Bold"/>
<TextBlock Grid.Row="0" Text="{DynamicResource Text.Launcher.Error}" FontWeight="Bold"/>
<controls:TextEdit
Grid.Row="1"
Text="{Binding Path=., Mode=OneWay}"
@ -41,9 +41,9 @@
Height="25"
Margin="4,0" Padding="8,0"
Click="Dismiss"
Content="{StaticResource Text.Close}"
Background="{StaticResource Brush.Accent1}"
BorderBrush="{StaticResource Brush.FG1}"
Content="{DynamicResource Text.Close}"
Background="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.FG1}"
BorderThickness="1"
HorizontalAlignment="Right"/>
</Grid>

View file

@ -15,7 +15,7 @@
<converters:InverseBool x:Key="InverseBool"/>
</Grid.Resources>
<Border x:Name="commitListPanel" Background="{StaticResource Brush.Contents}">
<Border x:Name="commitListPanel" Background="{DynamicResource Brush.Contents}">
<Grid ClipToBounds="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@ -28,21 +28,21 @@
x:Name="txtSearch"
Margin="4" Padding="0,0,22,0"
Height="24"
Placeholder="{StaticResource Text.Histories.Search}"
Placeholder="{DynamicResource Text.Histories.Search}"
PreviewKeyDown="OnSearchPreviewKeyDown"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="8,0">
<controls:IconButton
Click="ClearSearch"
Width="14" Height="14"
Icon="{StaticResource Icon.Clear}"
Foreground="{StaticResource Brush.FG2}"
ToolTip="{StaticResource Text.Histories.SearchClear}"/>
Foreground="{DynamicResource Brush.FG2}"
ToolTip="{DynamicResource Text.Histories.SearchClear}"/>
<controls:IconButton
Click="HideSearch"
Width="14" Height="14" Margin="6,0,0,0"
Icon="{StaticResource Icon.Up}"
Foreground="{StaticResource Brush.FG2}"
ToolTip="{StaticResource Text.Close}"/>
Foreground="{DynamicResource Brush.FG2}"
ToolTip="{DynamicResource Text.Close}"/>
</StackPanel>
</Grid>
@ -72,8 +72,8 @@
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type models:Decorator}">
<StackPanel Orientation="Horizontal" Height="16" Margin="2,0">
<Border Background="{StaticResource Brush.Decorator}">
<Path x:Name="Icon" Margin="4,0" Width="8" Height="8" Data="{StaticResource Icon.Branch}" Fill="{StaticResource Brush.DecoratorIcon}"/>
<Border Background="{DynamicResource Brush.Decorator}">
<Path x:Name="Icon" Margin="4,0" Width="8" Height="8" Data="{StaticResource Icon.Branch}" Fill="{DynamicResource Brush.DecoratorIcon}"/>
</Border>
<Border x:Name="Color" Background="#FFFFB835">
@ -160,7 +160,7 @@
</Grid>
</Border>
<GridSplitter x:Name="splitter" Background="{StaticResource Brush.Border0}"/>
<GridSplitter x:Name="splitter" Background="{DynamicResource Brush.Border0}"/>
<Grid x:Name="inspector">
@ -171,7 +171,7 @@
<widgets:RevisionCompare x:Name="revisionCompare"/>
<!-- Mask -->
<Border x:Name="mask" Background="{StaticResource Brush.Window}">
<Border x:Name="mask" Background="{DynamicResource Brush.Window}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Opacity=".25">
<Path Width="128" Height="128" Data="{StaticResource Icon.Detail}"/>
@ -181,13 +181,13 @@
FontFamily="Consolas" FontSize="24" FontWeight="UltraBold"
HorizontalAlignment="Center"
TextOptions.TextFormattingMode="Ideal"
Text="{StaticResource Text.Histories.Guide}"/>
Text="{DynamicResource Text.Histories.Guide}"/>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" TextBlock.FontFamily="Consolas,Microsoft YaHei UI">
<TextBlock Text="{StaticResource Text.Histories.Guide_1}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{StaticResource Text.Histories.Guide_2}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{StaticResource Text.Histories.Guide_3}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{StaticResource Text.Histories.Guide_4}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{DynamicResource Text.Histories.Guide_1}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{DynamicResource Text.Histories.Guide_2}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{DynamicResource Text.Histories.Guide_3}" FontSize="14" Margin="0,2"/>
<TextBlock Text="{DynamicResource Text.Histories.Guide_4}" FontSize="14" Margin="0,2"/>
</StackPanel>
</StackPanel>
</Border>
@ -196,18 +196,18 @@
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,6,8,0" Orientation="Horizontal">
<ToggleButton
Style="{StaticResource Style.ToggleButton.CommitGraphMode}"
Foreground="{StaticResource Brush.FG2}"
Foreground="{DynamicResource Brush.FG2}"
Width="16" Height="16"
ToolTip="{StaticResource Text.Histories.GraphMode}"
ToolTip="{DynamicResource Text.Histories.GraphMode}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Window.UsePolylineInGraph, Mode=TwoWay}"
Checked="ChangeGraphMode" Unchecked="ChangeGraphMode"/>
<ToggleButton
Style="{StaticResource Style.ToggleButton.SplitDirection}"
Foreground="{StaticResource Brush.FG2}"
Foreground="{DynamicResource Brush.FG2}"
Width="16" Height="16"
Margin="8,0,0,0"
ToolTip="{StaticResource Text.Histories.DisplayMode}"
ToolTip="{DynamicResource Text.Histories.DisplayMode}"
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Window.MoveCommitInfoRight, Mode=TwoWay, Converter={StaticResource InverseBool}}"
Checked="ChangeOrientation" Unchecked="ChangeOrientation"/>
</StackPanel>

View file

@ -20,8 +20,8 @@
x:Name="leftScroller"
Click="ScrollLeft"
Width="18" Padding="5"
HoverBackground="{StaticResource Brush.Accent1}"
BorderBrush="{StaticResource Brush.Border0}"
HoverBackground="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.Border0}"
BorderThickness="0,0,1,0"
Icon="{StaticResource Icon.ScrollLeft}"
WindowChrome.IsHitTestVisibleInChrome="True"
@ -53,7 +53,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Border" Background="Transparent" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,0,1,0">
<Border x:Name="Border" Background="Transparent" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,1,0">
<StackPanel Margin="8,0" x:Name="Contents" Orientation="Horizontal" VerticalAlignment="Center" Opacity=".5" ToolTip="{Binding Tooltip}">
<controls:Bookmark
Width="14" Height="14"
@ -72,15 +72,15 @@
Click="CloseTab"
Width="16" Height="16"
Margin="4,0,0,0" Padding="4"
ToolTip="{StaticResource Text.Close}"
ToolTip="{DynamicResource Text.Close}"
Icon="{StaticResource Icon.Close}"
HoverBackground="{StaticResource Brush.NewPageHover}"/>
HoverBackground="{DynamicResource Brush.NewPageHover}"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush.Window}"/>
<Setter TargetName="Border" Property="Background" Value="{DynamicResource Brush.Window}"/>
<Setter TargetName="Contents" Property="Opacity" Value="1"/>
</Trigger>
<MultiTrigger>
@ -105,8 +105,8 @@
Width="20" Height="20"
Margin="4,0" Padding="4"
Icon="{StaticResource Icon.NewTab}"
HoverBackground="{StaticResource Brush.NewPageHover}"
ToolTip="{StaticResource Text.PageSwitcher.New}"
HoverBackground="{DynamicResource Brush.NewPageHover}"
ToolTip="{DynamicResource Text.PageSwitcher.New}"
Click="NewTab"
WindowChrome.IsHitTestVisibleInChrome="True"/>
</StackPanel>
@ -118,8 +118,8 @@
x:Name="rightScroller"
Click="ScrollRight"
Width="18" Padding="5"
HoverBackground="{StaticResource Brush.Accent1}"
BorderBrush="{StaticResource Brush.Border0}"
HoverBackground="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.Border0}"
BorderThickness="1,0"
Icon="{StaticResource Icon.ScrollRight}"
WindowChrome.IsHitTestVisibleInChrome="True"

View file

@ -11,7 +11,7 @@
<!-- Popup panel -->
<Border
Background="{StaticResource Brush.Window}"
Background="{DynamicResource Brush.Window}"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Width="500"
@ -27,15 +27,15 @@
<TextBlock Margin="8,8,0,18" x:Name="txtTitle" FontSize="18" FontWeight="DemiBold" TextOptions.TextFormattingMode="Ideal"/>
<ContentControl x:Name="container"/>
<StackPanel Margin="0,16,0,0" Height="32" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Click="Sure" Width="80" Content="{StaticResource Text.Sure}" BorderBrush="{StaticResource Brush.FG1}" Background="{StaticResource Brush.Accent1}"/>
<Button Click="Cancel" Width="80" Margin="8,0,0,0" Content="{StaticResource Text.Cancel}"/>
<Button Click="Sure" Width="80" Content="{DynamicResource Text.Sure}" BorderBrush="{DynamicResource Brush.FG1}" Background="{DynamicResource Brush.Accent1}"/>
<Button Click="Cancel" Width="80" Margin="8,0,0,0" Content="{DynamicResource Text.Cancel}"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Progress mask -->
<Border x:Name="mask" Visibility="Collapsed" Background="{StaticResource Brush.Popup}" Opacity=".9">
<Border x:Name="mask" Visibility="Collapsed" Background="{DynamicResource Brush.Popup}" Opacity=".9">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<controls:Loading x:Name="processing" Width="48" Height="48"/>
<TextBlock x:Name="txtMsg" Margin="0,16,0,0"/>

View file

@ -24,9 +24,9 @@
<Border
Grid.Column="1"
BorderBrush="{StaticResource Brush.Border2}"
BorderBrush="{DynamicResource Brush.Border2}"
BorderThickness="1"
Background="{StaticResource Brush.Contents}"
Background="{DynamicResource Brush.Contents}"
CornerRadius="4">
<Grid Margin="4">
<Grid.ColumnDefinitions>
@ -49,7 +49,7 @@
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="txtStartSHA" Foreground="DarkOrange"/>
<TextBlock Grid.Column="1" x:Name="txtStartTime" Foreground="{StaticResource Brush.FG2}" HorizontalAlignment="Right"/>
<TextBlock Grid.Column="1" x:Name="txtStartTime" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right"/>
</Grid>
<TextBlock Grid.Row="1" x:Name="txtStartSubject" FontSize="10pt" FontFamily="Consolas,Microsoft YaHei UI" VerticalAlignment="Bottom"/>
@ -60,7 +60,7 @@
<Path
Grid.Column="2"
Width="16" Height="16"
Fill="{StaticResource Brush.FG2}"
Fill="{DynamicResource Brush.FG2}"
Data="{StaticResource Icon.Down}"
RenderTransformOrigin=".5,.5">
<Path.RenderTransform>
@ -70,9 +70,9 @@
<Border
Grid.Column="3"
BorderBrush="{StaticResource Brush.Border2}"
BorderBrush="{DynamicResource Brush.Border2}"
BorderThickness="1"
Background="{StaticResource Brush.Contents}"
Background="{DynamicResource Brush.Contents}"
CornerRadius="4">
<Grid Margin="4">
<Grid.ColumnDefinitions>
@ -95,7 +95,7 @@
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="txtEndSHA" Foreground="DarkOrange"/>
<TextBlock Grid.Column="1" x:Name="txtEndTime" Foreground="{StaticResource Brush.FG2}" HorizontalAlignment="Right"/>
<TextBlock Grid.Column="1" x:Name="txtEndTime" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right"/>
</Grid>
<TextBlock Grid.Row="1" x:Name="txtEndSubject" FontSize="10pt" FontFamily="Consolas,Microsoft YaHei UI" VerticalAlignment="Bottom"/>

View file

@ -21,7 +21,7 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" Background="{StaticResource Brush.Contents}" BorderBrush="{StaticResource Brush.Border2}" BorderThickness="1">
<Border Grid.Column="0" Background="{DynamicResource Brush.Contents}" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1">
<controls:Tree
x:Name="treeFiles"
FontFamily="Consolas"
@ -61,7 +61,7 @@
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="Transparent"/>
<Border Grid.Column="2" BorderBrush="{StaticResource Brush.Border2}" BorderThickness="1" Margin="2,0">
<Border Grid.Column="2" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Margin="2,0">
<Grid>
<Grid x:Name="layerTextPreview" Visibility="Collapsed" SizeChanged="OnTextPreviewSizeChanged">
<DataGrid
@ -79,7 +79,7 @@
</DataGrid.Columns>
</DataGrid>
<Rectangle x:Name="txtPreviewSplitter" Width="1" Fill="{StaticResource Brush.Border2}" HorizontalAlignment="Left"/>
<Rectangle x:Name="txtPreviewSplitter" Width="1" Fill="{DynamicResource Brush.Border2}" HorizontalAlignment="Left"/>
</Grid>
<ScrollViewer
@ -97,8 +97,8 @@
Orientation="Vertical"
VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="Collapsed">
<Path x:Name="iconRevisionPreview" Width="64" Height="64" Data="{StaticResource Icon.Submodule}" Fill="{StaticResource Brush.FG2}"/>
<TextBlock x:Name="txtRevisionPreview" Margin="0,16,0,0" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{StaticResource Brush.FG2}"/>
<Path x:Name="iconRevisionPreview" Width="64" Height="64" Data="{StaticResource Icon.Submodule}" Fill="{DynamicResource Brush.FG2}"/>
<TextBlock x:Name="txtRevisionPreview" Margin="0,16,0,0" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
<StackPanel
@ -106,8 +106,8 @@
Orientation="Vertical"
VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="Collapsed">
<Path Width="64" Height="64" Data="{StaticResource Icon.Error}" Fill="{StaticResource Brush.FG2}"/>
<TextBlock Margin="0,16,0,0" Text="{StaticResource Text.BinaryNotSupported}" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{StaticResource Brush.FG2}"/>
<Path Width="64" Height="64" Data="{StaticResource Icon.Error}" Fill="{DynamicResource Brush.FG2}"/>
<TextBlock Margin="0,16,0,0" Text="{DynamicResource Text.BinaryNotSupported}" FontFamily="Consolas" FontSize="18" FontWeight="UltraBold" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
</Grid>
</Border>

View file

@ -25,18 +25,18 @@
</Grid.RowDefinitions>
<!-- Stashes List Group -->
<Border Grid.Row="0" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,0,0,1">
<Border Grid.Row="0" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,0,1">
<StackPanel Orientation="Horizontal">
<Path
Margin="4,0"
Width="12" Height="12"
Fill="{StaticResource Brush.FG2}"
Fill="{DynamicResource Brush.FG2}"
Data="{StaticResource Icon.Stashes}"/>
<TextBlock
Margin="4,0,0,0"
Text="{StaticResource Text.Stashes.Stashes}"
Foreground="{StaticResource Brush.FG2}"
Text="{DynamicResource Text.Stashes.Stashes}"
Foreground="{DynamicResource Brush.FG2}"
FontWeight="Bold"/>
<controls:Loading
@ -51,22 +51,22 @@
<ListView
Grid.Row="1"
x:Name="stashList"
Background="{StaticResource Brush.Contents}"
Background="{DynamicResource Brush.Contents}"
BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectionChanged="OnStashSelectionChanged">
<ListView.ItemTemplate>
<DataTemplate DataType="{x:Type models:Stash}">
<Border BorderBrush="{StaticResource Brush.Border3}" BorderThickness="0,0,0,1" Background="Transparent" Padding="6" ContextMenuOpening="OnStashContextMenuOpening">
<Border BorderBrush="{DynamicResource Brush.Border3}" BorderThickness="0,0,0,1" Background="Transparent" Padding="6" ContextMenuOpening="OnStashContextMenuOpening">
<StackPanel Orientation="Vertical" TextElement.FontFamily="Consolas">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding SHA}" Foreground="{StaticResource Brush.FG2}" FontSize="11"/>
<TextBlock Grid.Column="1" Text="{Binding Author.Time}" Foreground="{StaticResource Brush.FG2}" FontSize="11"/>
<TextBlock Grid.Column="0" Text="{Binding SHA}" Foreground="{DynamicResource Brush.FG2}" FontSize="11"/>
<TextBlock Grid.Column="1" Text="{Binding Author.Time}" Foreground="{DynamicResource Brush.FG2}" FontSize="11"/>
</Grid>
<TextBlock Text="{Binding Message}" Margin="0,8,0,0"/>
</StackPanel>
@ -76,18 +76,18 @@
</ListView>
<!-- Change List Group -->
<Border Grid.Row="2" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,1">
<Border Grid.Row="2" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,1">
<StackPanel Orientation="Horizontal">
<Path
Margin="4,0"
Width="12" Height="12"
Fill="{StaticResource Brush.FG2}"
Fill="{DynamicResource Brush.FG2}"
Data="{StaticResource Icon.File}"/>
<TextBlock
Margin="4,0,0,0"
Text="{StaticResource Text.Stashes.Changes}"
Foreground="{StaticResource Brush.FG2}"
Text="{DynamicResource Text.Stashes.Changes}"
Foreground="{DynamicResource Brush.FG2}"
FontWeight="Bold"/>
</StackPanel>
</Border>
@ -96,7 +96,7 @@
<DataGrid
Grid.Row="3"
x:Name="changeList"
Background="{StaticResource Brush.Contents}"
Background="{DynamicResource Brush.Contents}"
RowHeight="24"
SelectionMode="Single"
SelectionUnit="FullRow"
@ -121,7 +121,7 @@
</Grid>
<!-- Splitter -->
<GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="1" Background="{StaticResource Brush.Border0}"/>
<GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="1" Background="{DynamicResource Brush.Border0}"/>
<!-- Right -->
<widgets:DiffViewer Grid.Column="2" x:Name="diffViewer" Margin="4"/>

View file

@ -20,18 +20,18 @@
Margin="0,48,0,0"
Width="100" Height="100"
Data="{StaticResource Icon.Git}"
Fill="{StaticResource Brush.Logo}"/>
Fill="{DynamicResource Brush.Logo}"/>
<!-- Welcome -->
<TextBlock
Margin="0,16"
HorizontalAlignment="Center"
Text="{StaticResource Text.Welcome.Title}"
Text="{DynamicResource Text.Welcome.Title}"
FontSize="24pt"
FontWeight="ExtraBold"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="ClearType"
Foreground="{StaticResource Brush.FG2}"/>
Foreground="{DynamicResource Brush.FG2}"/>
<!-- Options -->
<Grid>
@ -44,20 +44,20 @@
<Button Grid.Column="0" Click="OnOpenClicked" Height="28">
<StackPanel Orientation="Horizontal">
<Path Width="16" Height="16" Data="{StaticResource Icon.Folder.Open}"/>
<TextBlock Margin="12,0,0,0" Text="{StaticResource Text.Welcome.OpenOrInit}"/>
<TextBlock Margin="12,0,0,0" Text="{DynamicResource Text.Welcome.OpenOrInit}"/>
</StackPanel>
</Button>
<Button Grid.Column="2" Click="OnCloneClicked" Height="28">
<StackPanel Orientation="Horizontal">
<Path Width="16" Height="16" Data="{StaticResource Icon.Pull}"/>
<TextBlock Margin="12,0,0,0" Text="{StaticResource Text.Welcome.Clone}"/>
<TextBlock Margin="12,0,0,0" Text="{DynamicResource Text.Welcome.Clone}"/>
</StackPanel>
</Button>
</Grid>
<!-- Horizontal line -->
<Rectangle Height="1" Margin="0,36,0,8" Fill="{StaticResource Brush.Border1}"/>
<Rectangle Height="1" Margin="0,36,0,8" Fill="{DynamicResource Brush.Border1}"/>
<!-- Labels -->
<Grid>
@ -69,15 +69,15 @@
<TextBlock
Grid.Column="0"
Text="{StaticResource Text.Welcome.Repositories}"
Text="{DynamicResource Text.Welcome.Repositories}"
FontSize="13pt" FontWeight="ExtraBold" FontFamily="Consolas,Microsoft YaHei UI"
Foreground="{StaticResource Brush.FG2}"/>
Foreground="{DynamicResource Brush.FG2}"/>
<TextBlock
Grid.Column="2"
Text="{StaticResource Text.Welcome.DragDrop}"
Text="{DynamicResource Text.Welcome.DragDrop}"
FontSize="10pt" FontFamily="Consolas,Microsoft YaHei UI"
Foreground="{StaticResource Brush.FG2}"/>
Foreground="{DynamicResource Brush.FG2}"/>
</Grid>
</StackPanel>
@ -86,7 +86,7 @@
Grid.Row="1"
x:Name="dropArea"
Margin="0,2"
Stroke="{StaticResource Brush.Border1}"
Stroke="{DynamicResource Brush.Border1}"
StrokeThickness="2"
StrokeDashArray="4,4"
SnapsToDevicePixels="True"
@ -129,7 +129,7 @@
<StackPanel Grid.Column="1" x:Name="Contents" Orientation="Horizontal">
<TextBlock Margin="8,0" FontSize="9pt" FontFamily="Consolas,Microsoft YaHei UI" Text="{Binding Name}"/>
<TextBlock x:Name="Path" Text="{Binding Id}" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock x:Name="Path" Text="{Binding Id}" Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
<controls:TextEdit

View file

@ -31,7 +31,7 @@
</Grid.RowDefinitions>
<!-- Unstaged Toolbar -->
<Border Grid.Row="0" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,0,0,1">
<Border Grid.Row="0" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,0,1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@ -51,8 +51,8 @@
<TextBlock
Grid.Column="1"
Margin="6,0"
Text="{StaticResource Text.WorkingCopy.Unstaged}"
Foreground="{StaticResource Brush.FG2}"
Text="{DynamicResource Text.WorkingCopy.Unstaged}"
Foreground="{DynamicResource Brush.FG2}"
FontWeight="Bold"/>
<controls:Loading
Grid.Column="2"
@ -66,19 +66,19 @@
Width="14" Height="14"
Margin="4,0"
Icon="{StaticResource Icon.Down}"
ToolTip="{StaticResource Text.WorkingCopy.Unstaged.Stage}"/>
ToolTip="{DynamicResource Text.WorkingCopy.Unstaged.Stage}"/>
<controls:IconButton
Grid.Column="5"
Click="StageAll"
Width="14" Height="14"
Margin="4,0"
Icon="{StaticResource Icon.DoubleDown}"
ToolTip="{StaticResource Text.WorkingCopy.Unstaged.StageAll}"/>
ToolTip="{DynamicResource Text.WorkingCopy.Unstaged.StageAll}"/>
</Grid>
</Border>
<!-- Unstaged Changes -->
<Border Grid.Row="1" Background="{StaticResource Brush.Contents}">
<Border Grid.Row="1" Background="{DynamicResource Brush.Contents}">
<widgets:WorkingCopyChanges
x:Name="unstagedContainer"
IsUnstaged="True"
@ -87,7 +87,7 @@
</Border>
<!-- Staged Toolbar -->
<Border Grid.Row="2" BorderBrush="{StaticResource Brush.Border0}" BorderThickness="0,1">
<Border Grid.Row="2" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@ -105,8 +105,8 @@
<TextBlock
Grid.Column="1"
Margin="6,0"
Text="{StaticResource Text.WorkingCopy.Staged}"
Foreground="{StaticResource Brush.FG2}"
Text="{DynamicResource Text.WorkingCopy.Staged}"
Foreground="{DynamicResource Brush.FG2}"
FontWeight="Bold"/>
<controls:IconButton
@ -115,19 +115,19 @@
Width="14" Height="14"
Margin="4,0"
Icon="{StaticResource Icon.Up}"
ToolTip="{StaticResource Text.WorkingCopy.Staged.Unstage}"/>
ToolTip="{DynamicResource Text.WorkingCopy.Staged.Unstage}"/>
<controls:IconButton
Grid.Column="3"
Click="UnstageAll"
Width="14" Height="14"
Margin="4,0"
Icon="{StaticResource Icon.DoubleUp}"
ToolTip="{StaticResource Text.WorkingCopy.Staged.UnstageAll}"/>
ToolTip="{DynamicResource Text.WorkingCopy.Staged.UnstageAll}"/>
</Grid>
</Border>
<!-- Staged Changes -->
<Border Grid.Row="3" Background="{StaticResource Brush.Contents}">
<Border Grid.Row="3" Background="{DynamicResource Brush.Contents}">
<widgets:WorkingCopyChanges
x:Name="stagedContainer"
IsUnstaged="False"
@ -136,7 +136,7 @@
</Border>
</Grid>
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="{StaticResource Brush.Border0}"/>
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="{DynamicResource Brush.Border0}"/>
<!-- Right -->
<Grid Grid.Column="2" Margin="4">
@ -150,22 +150,22 @@
<widgets:DiffViewer Grid.Row="0" x:Name="diffViewer"/>
<!-- Merge Option Panel -->
<Grid Grid.Row="0" x:Name="mergePanel" Background="{StaticResource Brush.Window}" Visibility="Collapsed">
<Grid Grid.Row="0" x:Name="mergePanel" Background="{DynamicResource Brush.Window}" Visibility="Collapsed">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<Path
Width="64" Height="64"
Data="{StaticResource Icon.Conflict}"
Fill="{StaticResource Brush.FG2}"/>
Fill="{DynamicResource Brush.FG2}"/>
<TextBlock
Margin="0,16,0,28"
FontSize="20" FontWeight="DemiBold"
Text="{StaticResource Text.WorkingCopy.Conflicts}"
Foreground="{StaticResource Brush.FG2}"
Text="{DynamicResource Text.WorkingCopy.Conflicts}"
Foreground="{DynamicResource Brush.FG2}"
HorizontalAlignment="Center"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Click="UseTheirs" Content="{StaticResource Text.WorkingCopy.UseTheirs}" Height="24" Padding="8,0"/>
<Button Click="UseMine" Content="{StaticResource Text.WorkingCopy.UseMine}" Height="24" Margin="8,0" Padding="8,0"/>
<Button Click="UseMergeTool" Content="{StaticResource Text.WorkingCopy.OpenMerger}" Height="24" Padding="8,0"/>
<Button Click="UseTheirs" Content="{DynamicResource Text.WorkingCopy.UseTheirs}" Height="24" Padding="8,0"/>
<Button Click="UseMine" Content="{DynamicResource Text.WorkingCopy.UseMine}" Height="24" Margin="8,0" Padding="8,0"/>
<Button Click="UseMergeTool" Content="{DynamicResource Text.WorkingCopy.OpenMerger}" Height="24" Padding="8,0"/>
</StackPanel>
</StackPanel>
</Grid>
@ -181,7 +181,7 @@
TextWrapping="Wrap"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Placeholder="{StaticResource Text.WorkingCopy.CommitMessageTip}"
Placeholder="{DynamicResource Text.WorkingCopy.CommitMessageTip}"
PlaceholderBaseline="Top">
<TextBox.Text>
<Binding ElementName="me" Path="CommitMessage" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
@ -207,7 +207,7 @@
Grid.Column="0"
Width="14" Height="14"
Click="OpenCommitMessageRecorder"
ToolTip="{StaticResource Text.WorkingCopy.MessageHistories}"
ToolTip="{DynamicResource Text.WorkingCopy.MessageHistories}"
Icon="{StaticResource Icon.List}"
Opacity=".5"/>
@ -216,7 +216,7 @@
x:Name="chkAmend"
Margin="8,0,0,0"
HorizontalAlignment="Left"
Content="{StaticResource Text.WorkingCopy.Amend}"
Content="{DynamicResource Text.WorkingCopy.Amend}"
Checked="StartAmend" Unchecked="EndAmend"/>
<controls:Loading
@ -231,9 +231,9 @@
Height="26"
Padding="8,0"
Click="Commit"
Background="{StaticResource Brush.Accent1}"
BorderBrush="{StaticResource Brush.FG1}"
Content="{StaticResource Text.WorkingCopy.Commit}"/>
Background="{DynamicResource Brush.Accent1}"
BorderBrush="{DynamicResource Brush.FG1}"
Content="{DynamicResource Text.WorkingCopy.Commit}"/>
<Button
Grid.Column="5"
@ -241,7 +241,7 @@
Height="26"
Padding="8,0"
Click="CommitAndPush"
Content="{StaticResource Text.WorkingCopy.CommitAndPush}"
Content="{DynamicResource Text.WorkingCopy.CommitAndPush}"
Margin="8,0,0,0"/>
</Grid>
</Grid>

View file

@ -132,7 +132,7 @@
<DataGridTemplateColumn IsReadOnly="True" Width="SizeToCells">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock FontFamily="Consolas" Margin="8,0,0,0" Text="{Binding Path, Converter={StaticResource PureFolderName}}" Foreground="{StaticResource Brush.FG2}"/>
<TextBlock FontFamily="Consolas" Margin="8,0,0,0" Text="{Binding Path, Converter={StaticResource PureFolderName}}" Foreground="{DynamicResource Brush.FG2}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>