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;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
namespace SourceGit { namespace SourceGit {
@ -14,7 +8,6 @@ namespace SourceGit {
/// 程序入口. /// 程序入口.
/// </summary> /// </summary>
public partial class App : Application { public partial class App : Application {
private static bool restart = false;
/// <summary> /// <summary>
/// 读取本地化字串 /// 读取本地化字串
@ -28,15 +21,6 @@ namespace SourceGit {
return string.Format(data, args); return string.Format(data, args);
} }
/// <summary>
/// 重启程序
/// </summary>
public static void Restart() {
restart = true;
Process.Start(Process.GetCurrentProcess().MainModule.FileName);
Current.Shutdown();
}
/// <summary> /// <summary>
/// 启动. /// 启动.
/// </summary> /// </summary>
@ -48,31 +32,11 @@ namespace SourceGit {
Directory.CreateDirectory(Views.Controls.Avatar.CACHE_PATH); Directory.CreateDirectory(Views.Controls.Avatar.CACHE_PATH);
} }
// 控制主题 Models.Theme.Change();
if (Models.Preference.Instance.General.UseDarkTheme) { Models.Locale.Change();
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();
// 如果启动命令中指定了路径,打开指定目录的仓库 // 如果启动命令中指定了路径,打开指定目录的仓库
var launcher = new Views.Launcher();
if (e.Args.Length > 0) { if (e.Args.Length > 0) {
var repo = Models.Preference.Instance.FindRepository(e.Args[0]); var repo = Models.Preference.Instance.FindRepository(e.Args[0]);
if (repo == null) { if (repo == null) {
@ -99,33 +63,15 @@ namespace SourceGit {
} }
} }
// 主界面显示
MainWindow = launcher;
MainWindow.Show(); MainWindow.Show();
// 检测更新 // 检测版本更新
if (Models.Preference.Instance.General.CheckForUpdate) { Models.Version.Check(ver => Dispatcher.Invoke(() => {
var curDayOfYear = DateTime.Now.DayOfYear; var dialog = new Views.Upgrade(ver) { Owner = MainWindow };
var lastDayOfYear = Models.Preference.Instance.General.LastCheckDay; dialog.ShowDialog();
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 {}
});
}
}
} }
/// <summary> /// <summary>
@ -135,7 +81,7 @@ namespace SourceGit {
/// <param name="e"></param> /// <param name="e"></param>
private void OnAppDeactivated(object sender, EventArgs e) { private void OnAppDeactivated(object sender, EventArgs e) {
GC.Collect(); GC.Collect();
if (!restart) Models.Preference.Save(); Models.Preference.Save();
} }
} }
} }

View file

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace SourceGit.Models { namespace SourceGit.Models {
@ -18,5 +19,15 @@ namespace SourceGit.Models {
Name = name; Name = name;
Resource = res; 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;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
#if NET48 #if NET48
using Newtonsoft.Json; using Newtonsoft.Json;
@ -52,12 +57,36 @@ namespace SourceGit.Models {
get { return PreRelease ? "YES" : "NO"; } 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 #if NET48
return JsonConvert.DeserializeObject<Version>(data); var ver = JsonConvert.DeserializeObject<Version>(raw);
#else #else
return JsonSerializer.Deserialize<Version>(data); var ver = JsonSerializer.Deserialize<Version>(raw);
#endif #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/ToggleButton.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources/Styles/Tooltip.xaml"/> <ResourceDictionary Source="pack://application:,,,/Resources/Styles/Tooltip.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources/Styles/Tree.xaml"/> <ResourceDictionary Source="pack://application:,,,/Resources/Styles/Tree.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resources/Styles/Window.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View file

@ -29,6 +29,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.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.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.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> <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>
<Geometry x:Key="Icon.Up">M170 831l343-342L855 831l105-105-448-448L64 726 170 831z</Geometry> <Geometry x:Key="Icon.Up">M170 831l343-342L855 831l105-105-448-448L64 726 170 831z</Geometry>

View file

@ -16,6 +16,7 @@
<sys:String x:Key="Text.Optional">Optional.</sys:String> <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.FakeFolderFilter">‡Directory|*.this.directory</sys:String>
<sys:String x:Key="Text.OpenFolder">SELECT FOLDER</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.URL">URL :</sys:String>
<sys:String x:Key="Text.RepositoryURL">Git Repository URL</sys:String> <sys:String x:Key="Text.RepositoryURL">Git Repository URL</sys:String>
@ -361,10 +362,8 @@
<sys:String x:Key="Text.Preference">Preference</sys:String> <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.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.Locale">Language :</sys:String>
<sys:String x:Key="Text.Preference.AvatarServer">Avatar Server :</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.CheckUpdate">Check for update</sys:String>
<sys:String x:Key="Text.Preference.AutoFetch">Fetch remotes automatically</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> <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.Optional">选填</sys:String>
<sys:String x:Key="Text.FakeFolderFilter">‡路径|*.this.directory</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.OpenFolder">选择文件夹</sys:String>
<sys:String x:Key="Text.ThemeSwitcher">切换主题</sys:String>
<sys:String x:Key="Text.URL">仓库地址 </sys:String> <sys:String x:Key="Text.URL">仓库地址 </sys:String>
<sys:String x:Key="Text.RepositoryURL">远程仓库地址</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">偏好设置</sys:String>
<sys:String x:Key="Text.Preference.General">通用配置</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.Locale">显示语言 </sys:String>
<sys:String x:Key="Text.Preference.AvatarServer">头像服务 </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.CheckUpdate">启用检测更新</sys:String>
<sys:String x:Key="Text.Preference.AutoFetch">启用定时自动拉取远程更新</sys:String> <sys:String x:Key="Text.Preference.AutoFetch">启用定时自动拉取远程更新</sys:String>
<sys:String x:Key="Text.Preference.RestoreTabs">启动时恢复上次打开的仓库</sys:String> <sys:String x:Key="Text.Preference.RestoreTabs">启动时恢复上次打开的仓库</sys:String>

View file

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

View file

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

View file

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

View file

@ -69,14 +69,14 @@ namespace SourceGit.Views.Controls {
if (!mark.IsNewPage) { if (!mark.IsNewPage) {
if (mark.Color == 0) { 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; mark.icon.Data = mark.FindResource("Icon.Git") as Geometry;
} else { } else {
mark.icon.Fill = COLORS[mark.Color % COLORS.Length]; mark.icon.Fill = COLORS[mark.Color % COLORS.Length];
mark.icon.Data = mark.FindResource("Icon.Bookmark") as Geometry; mark.icon.Data = mark.FindResource("Icon.Bookmark") as Geometry;
} }
} else { } 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; mark.icon.Data = mark.FindResource("Icon.WelcomePage") as Geometry;
} }

View file

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

View file

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

View file

@ -1,6 +1,4 @@
using System.Windows; using System.Windows;
using System.Windows.Media;
using System.Windows.Shell;
namespace SourceGit.Views.Controls { namespace SourceGit.Views.Controls {
/// <summary> /// <summary>
@ -20,32 +18,16 @@ namespace SourceGit.Views.Controls {
} }
public Window() { public Window() {
Background = FindResource("Brush.Window") as Brush; Style = FindResource("Style.Window") as Style;
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);
StateChanged += (_, __) => { StateChanged += (_, __) => {
var content = Content as FrameworkElement; var content = Content as FrameworkElement;
if (WindowState == WindowState.Maximized) { if (WindowState == WindowState.Maximized) {
if (!IsMaximized) IsMaximized = true; if (!IsMaximized) IsMaximized = true;
BorderThickness = new Thickness(0);
content.Margin = new Thickness((SystemParameters.MaximizedPrimaryScreenWidth - SystemParameters.WorkArea.Width) / 2); content.Margin = new Thickness((SystemParameters.MaximizedPrimaryScreenWidth - SystemParameters.WorkArea.Width) / 2);
} else { } else {
if (IsMaximized) IsMaximized = false; if (IsMaximized) IsMaximized = false;
BorderThickness = new Thickness(1);
content.Margin = new Thickness(0); content.Margin = new Thickness(0);
} }
}; };

View file

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

View file

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

View file

@ -11,7 +11,7 @@
mc:Ignorable="d" mc:Ignorable="d"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
MinWidth="1280" MinHeight="720" 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}" 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}" Height="{Binding Source={x:Static models:Preference.Instance}, Path=Window.Height, Mode=TwoWay}"
Closing="OnClosing"> Closing="OnClosing">
@ -22,14 +22,14 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Titlebar --> <!-- Titlebar -->
<Grid Grid.Row="0" Background="{StaticResource Brush.TitleBar}"> <Grid Grid.Row="0" Background="{DynamicResource Brush.TitleBar}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="200"/> <ColumnDefinition Width="250"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Bottom border --> <!-- 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 --> <!-- Tabs -->
<widgets:PageTabBar <widgets:PageTabBar
@ -41,9 +41,10 @@
<!-- Right controls --> <!-- Right controls -->
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="27" WindowChrome.IsHitTestVisibleInChrome="True"> <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="OpenPreference" Width="28" Padding="6" Icon="{StaticResource Icon.Preference}" ToolTip="{DynamicResource Text.Launcher.Preference}"/>
<controls:IconButton Click="OpenHotkeys" Width="28" Padding="6" Icon="{StaticResource Icon.Hotkeys}" ToolTip="{StaticResource Text.Hotkeys}"/> <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="OpenAbout" Width="28" Padding="6" Icon="{StaticResource Icon.Help}" ToolTip="{StaticResource Text.Launcher.About}"/> <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"/> <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}"/> <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"/> <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 #endregion
#region RIGHT_COMMANDS #region RIGHT_COMMANDS
private void ChangeTheme(object sender, RoutedEventArgs e) {
Models.Theme.Change();
}
private void OpenPreference(object sender, RoutedEventArgs e) { private void OpenPreference(object sender, RoutedEventArgs e) {
var dialog = new Preference() { Owner = this }; var dialog = new Preference() { Owner = this };
dialog.ShowDialog(); dialog.ShowDialog();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -23,7 +23,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Column="0" Grid.Row="0" Grid.Column="0"
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{StaticResource Text.Reset.Target}" Text="{DynamicResource Text.Reset.Target}"
HorizontalAlignment="Right"/> HorizontalAlignment="Right"/>
<StackPanel <StackPanel
Grid.Row="0" Grid.Column="1" Grid.Row="0" Grid.Column="1"
@ -36,7 +36,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Column="0" Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{StaticResource Text.Reset.MoveTo}" Text="{DynamicResource Text.Reset.MoveTo}"
HorizontalAlignment="Right"/> HorizontalAlignment="Right"/>
<StackPanel <StackPanel
Grid.Row="1" Grid.Column="1" Grid.Row="1" Grid.Column="1"
@ -49,7 +49,7 @@
<TextBlock <TextBlock
Grid.Row="2" Grid.Column="0" Grid.Row="2" Grid.Column="0"
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{StaticResource Text.Reset.Mode}" Text="{DynamicResource Text.Reset.Mode}"
HorizontalAlignment="Right"/> HorizontalAlignment="Right"/>
<ComboBox <ComboBox
Grid.Row="2" Grid.Column="1" Grid.Row="2" Grid.Column="1"
@ -63,7 +63,7 @@
<StackPanel Orientation="Horizontal" Height="20"> <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"/> <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 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> </StackPanel>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -15,12 +15,6 @@ namespace SourceGit.Views {
public string CRLF { get; set; } public string CRLF { get; set; }
public string MergeCmd { get; set; } public string MergeCmd { get; set; }
private string locale;
private string avatarServer;
private bool useDarkTheme;
private bool checkUpdate;
private bool autoFetch;
public Preference() { public Preference() {
if (Models.Preference.Instance.IsReady) { if (Models.Preference.Instance.IsReady) {
User = new Commands.Config().Get("user.name"); 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); var merger = Models.MergeTool.Supported.Find(x => x.Type == Models.Preference.Instance.MergeTool.Type);
if (merger != null) MergeCmd = merger.Cmd; 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(); InitializeComponent();
} }
#region EVENTS #region EVENTS
private void LocaleChanged(object sender, SelectionChangedEventArgs e) {
Models.Locale.Change();
e.Handled = true;
}
private void SelectGitPath(object sender, RoutedEventArgs e) { private void SelectGitPath(object sender, RoutedEventArgs e) {
var dialog = new OpenFileDialog(); var dialog = new OpenFileDialog();
dialog.Filter = "Git Executable|git.exe"; dialog.Filter = "Git Executable|git.exe";
@ -116,28 +109,7 @@ namespace SourceGit.Views {
} }
Models.Preference.Save(); Models.Preference.Save();
Close();
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();
}
} }
#endregion #endregion
} }

View file

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

View file

@ -14,11 +14,6 @@ namespace SourceGit.Views {
txtRelease.Text = App.Text("UpdateAvailable.Title", ver.Name); 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) { private void Download(object sender, RoutedEventArgs e) {
var info = new ProcessStartInfo("cmd", $"/c start https://gitee.com/sourcegit/SourceGit/releases/{Version.TagName}"); var info = new ProcessStartInfo("cmd", $"/c start https://gitee.com/sourcegit/SourceGit/releases/{Version.TagName}");
info.CreateNoWindow = true; info.CreateNoWindow = true;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -132,7 +132,7 @@
<DataGridTemplateColumn IsReadOnly="True" Width="SizeToCells"> <DataGridTemplateColumn IsReadOnly="True" Width="SizeToCells">
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <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> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>