mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
style<Dashboard>: move histories layout direction button to dashboard toolbar
This commit is contained in:
parent
7c44c0a840
commit
902e28c41c
5 changed files with 27 additions and 47 deletions
|
@ -82,17 +82,18 @@
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="Opacity" Value=".8"/>
|
||||||
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Path
|
<Path
|
||||||
x:Name="Icon"
|
x:Name="Icon"
|
||||||
Style="{DynamicResource Style.Icon}"
|
Style="{DynamicResource Style.Icon}"
|
||||||
Width="{TemplateBinding Width}"
|
Width="{TemplateBinding Width}"
|
||||||
Height="{TemplateBinding Height}"
|
Height="{TemplateBinding Height}"
|
||||||
Fill="{TemplateBinding Foreground}"
|
Fill="{DynamicResource Brush.FG1}"
|
||||||
Data="{DynamicResource Icon.Orientation}"
|
Data="{DynamicResource Icon.Orientation}"
|
||||||
RenderTransformOrigin=".5,.5">
|
RenderTransformOrigin=".5,.5">
|
||||||
<Path.RenderTransform>
|
<Path.RenderTransform>
|
||||||
|
@ -109,33 +110,8 @@
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
</ControlTemplate>
|
<Setter Property="Opacity" Value="1"/>
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style x:Key="Style.ToggleButton.CommitGraphMode" 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="{TemplateBinding Width}"
|
|
||||||
Height="{TemplateBinding Height}"
|
|
||||||
Fill="{TemplateBinding Foreground}"
|
|
||||||
Data="{DynamicResource Icon.Curve}"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<ControlTemplate.Triggers>
|
|
||||||
<Trigger Property="IsChecked" Value="True">
|
|
||||||
<Setter TargetName="Icon" Property="Data" Value="{DynamicResource Icon.Polyline}"/>
|
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||||
|
xmlns:models="clr-namespace:SourceGit.Models"
|
||||||
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
xmlns:widgets="clr-namespace:SourceGit.Views.Widgets"
|
||||||
xmlns:converters="clr-namespace:SourceGit.Views.Converters"
|
xmlns:converters="clr-namespace:SourceGit.Views.Converters"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
@ -13,7 +14,11 @@
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.Resources>
|
||||||
|
<converters:InverseBool x:Key="InverseBool"/>
|
||||||
|
</Grid.Resources>
|
||||||
|
|
||||||
<!-- Toolbar -->
|
<!-- Toolbar -->
|
||||||
<Border Grid.Row="0" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,0,1">
|
<Border Grid.Row="0" BorderBrush="{DynamicResource Brush.Border0}" BorderThickness="0,0,0,1">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
@ -93,8 +98,15 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<ToggleButton
|
||||||
|
Width="16" Height="16"
|
||||||
|
Style="{StaticResource Style.ToggleButton.SplitDirection}"
|
||||||
|
ToolTip="{DynamicResource Text.Histories.DisplayMode}"
|
||||||
|
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Window.MoveCommitInfoRight, Mode=TwoWay, Converter={StaticResource InverseBool}}"
|
||||||
|
Checked="ChangeOrientation" Unchecked="ChangeOrientation"/>
|
||||||
|
|
||||||
<controls:IconButton
|
<controls:IconButton
|
||||||
Margin="8,0"
|
Margin="12,0,8,0"
|
||||||
Padding="0,8"
|
Padding="0,8"
|
||||||
Icon="{DynamicResource Icon.Setting}"
|
Icon="{DynamicResource Icon.Setting}"
|
||||||
ToolTip="{DynamicResource Text.Dashboard.Configure}"
|
ToolTip="{DynamicResource Text.Dashboard.Configure}"
|
||||||
|
|
|
@ -400,6 +400,12 @@ namespace SourceGit.Views.Widgets {
|
||||||
(pages.Get("histories") as Histories).ToggleSearch();
|
(pages.Get("histories") as Histories).ToggleSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ChangeOrientation(object sender, RoutedEventArgs e) {
|
||||||
|
if (!IsLoaded) return;
|
||||||
|
|
||||||
|
(pages.Get("histories") as Histories)?.ChangeOrientation();
|
||||||
|
}
|
||||||
|
|
||||||
private void OpenConfigure(object sender, RoutedEventArgs e) {
|
private void OpenConfigure(object sender, RoutedEventArgs e) {
|
||||||
new Popups.Configure(repo.Path).Show();
|
new Popups.Configure(repo.Path).Show();
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
<Grid x:Name="layout">
|
<Grid x:Name="layout">
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
<converters:BoolToCollapsed x:Key="BoolToCollapsed"/>
|
<converters:BoolToCollapsed x:Key="BoolToCollapsed"/>
|
||||||
<converters:InverseBool x:Key="InverseBool"/>
|
|
||||||
</Grid.Resources>
|
</Grid.Resources>
|
||||||
|
|
||||||
<Border x:Name="commitListPanel" Background="{DynamicResource Brush.Contents}">
|
<Border x:Name="commitListPanel" Background="{DynamicResource Brush.Contents}">
|
||||||
|
@ -163,7 +162,6 @@
|
||||||
<GridSplitter x:Name="splitter" Background="{DynamicResource Brush.Border0}"/>
|
<GridSplitter x:Name="splitter" Background="{DynamicResource Brush.Border0}"/>
|
||||||
|
|
||||||
<Grid x:Name="inspector">
|
<Grid x:Name="inspector">
|
||||||
|
|
||||||
<!-- Commit Detail -->
|
<!-- Commit Detail -->
|
||||||
<widgets:CommitDetail x:Name="commitDetail"/>
|
<widgets:CommitDetail x:Name="commitDetail"/>
|
||||||
|
|
||||||
|
@ -190,18 +188,6 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Right Top Button -->
|
|
||||||
<ToggleButton
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Style="{StaticResource Style.ToggleButton.SplitDirection}"
|
|
||||||
Foreground="{DynamicResource Brush.FG2}"
|
|
||||||
Width="16" Height="16"
|
|
||||||
Margin="0,6,8,0"
|
|
||||||
ToolTip="{DynamicResource Text.Histories.DisplayMode}"
|
|
||||||
IsChecked="{Binding Source={x:Static models:Preference.Instance}, Path=Window.MoveCommitInfoRight, Mode=TwoWay, Converter={StaticResource InverseBool}}"
|
|
||||||
Checked="ChangeOrientation" Unchecked="ChangeOrientation"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace SourceGit.Views.Widgets {
|
||||||
this.repo = repo;
|
this.repo = repo;
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
ChangeOrientation(null, null);
|
ChangeOrientation();
|
||||||
|
|
||||||
Unloaded += (o, e) => {
|
Unloaded += (o, e) => {
|
||||||
cachedCommits.Clear();
|
cachedCommits.Clear();
|
||||||
|
@ -103,7 +103,7 @@ namespace SourceGit.Views.Widgets {
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region LAYOUT
|
#region LAYOUT
|
||||||
private void ChangeOrientation(object sender, RoutedEventArgs e) {
|
public void ChangeOrientation() {
|
||||||
if (layout == null || commitListPanel == null || inspector == null || splitter == null) return;
|
if (layout == null || commitListPanel == null || inspector == null || splitter == null) return;
|
||||||
|
|
||||||
layout.RowDefinitions.Clear();
|
layout.RowDefinitions.Clear();
|
||||||
|
|
Loading…
Reference in a new issue