UI improvements
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
<Color x:Key="MarkedSelectedItemBackgroundColor">#b58900</Color>
|
||||
|
||||
<Color x:Key="ForegroundColor">#93a1a1</Color>
|
||||
<Color x:Key="AccentForegroundColor">#268bd2</Color>
|
||||
<Color x:Key="AccentColor">#268bd2</Color>
|
||||
<Color x:Key="AccentComplementColor">#fdf6e3</Color>
|
||||
<Color x:Key="LightForegroundColor">#7793a1a1</Color>
|
||||
<Color x:Key="AlternativeItemForegroundColor">#93a1a1</Color>
|
||||
<Color x:Key="SelectedItemForegroundColor">#073642</Color>
|
||||
@@ -38,6 +39,13 @@
|
||||
<GradientStop Offset="1" Color="#0093a1a1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="ContainerGradientBackgroundBrush">
|
||||
<GradientStop Offset="0" Color="#00b58900" />
|
||||
<GradientStop Offset="0.4" Color="#CCb58900" />
|
||||
<GradientStop Offset="0.6" Color="#CCb58900" />
|
||||
<GradientStop Offset="1" Color="#00b58900" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
|
||||
|
||||
<SolidColorBrush
|
||||
@@ -73,8 +81,11 @@
|
||||
x:Key="ForegroundBrush"
|
||||
Color="{DynamicResource ForegroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="AccentForegroundBrush"
|
||||
Color="{DynamicResource AccentForegroundColor}" />
|
||||
x:Key="AccentBrush"
|
||||
Color="{DynamicResource AccentColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="AccentComplementBrush"
|
||||
Color="{DynamicResource AccentComplementColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="LightForegroundBrush"
|
||||
Color="{DynamicResource LightForegroundColor}" />
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace FileTime.Avalonia.Configuration
|
||||
{
|
||||
var editorPrograms = new List<ProgramConfiguration>()
|
||||
{
|
||||
new ProgramConfiguration(@"c:\Program Files\Notepad++\notepad++1.exe"),
|
||||
new ProgramConfiguration(@"c:\Program Files\Notepad++\notepad++.exe"),
|
||||
new ProgramConfiguration("notepad.exe"),
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
using FileTime.Avalonia.Models;
|
||||
using FileTime.Avalonia.ViewModels;
|
||||
using FileTime.Avalonia.Views;
|
||||
|
||||
namespace FileTime.Avalonia.Converters
|
||||
{
|
||||
@@ -17,11 +16,11 @@ namespace FileTime.Avalonia.Converters
|
||||
{
|
||||
if (values.Count > 0 && values[0] is IList<ItemNamePart> nameParts)
|
||||
{
|
||||
var attributeWidth = values[2] is bool b && b ? 340 : 0;
|
||||
var newNameParts = nameParts;
|
||||
//if (values.Count > 1 && values[1] is ItemView itemView && itemView.ShowAttributes && itemView.Bounds.Width > 0)
|
||||
if (values.Count > 1 && values[1] is double width && width > 0)
|
||||
{
|
||||
newNameParts = GetNamePartsForWidth(nameParts, width - 340);
|
||||
newNameParts = GetNamePartsForWidth(nameParts, width - attributeWidth);
|
||||
}
|
||||
|
||||
return newNameParts.Select(p => new ItemNamePartViewModel(p.Text, p.IsSpecial ? TextDecorations.Underline : null)).ToList();
|
||||
|
||||
@@ -783,6 +783,7 @@ namespace FileTime.Avalonia.Services
|
||||
var getNext = false;
|
||||
while (true)
|
||||
{
|
||||
string? execPath = null;
|
||||
try
|
||||
{
|
||||
var editorProgram = _programsService.GetEditorProgram(getNext);
|
||||
@@ -792,6 +793,7 @@ namespace FileTime.Avalonia.Services
|
||||
}
|
||||
else if (editorProgram.Path is string executablePath)
|
||||
{
|
||||
execPath = executablePath;
|
||||
if (string.IsNullOrWhiteSpace(editorProgram.Arguments))
|
||||
{
|
||||
Process.Start(executablePath, "\"" + filePath + "\"");
|
||||
@@ -808,7 +810,7 @@ namespace FileTime.Avalonia.Services
|
||||
}
|
||||
catch (System.ComponentModel.Win32Exception e)
|
||||
{
|
||||
_logger.LogError(e, "Error while running editor program, possible the executable path does not exists.");
|
||||
_logger.LogError(e, "Error while running editor program, possible the executable path does not exists. {0}", execPath);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
HorizontalContentAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{Binding ViewMode,Converter={StaticResource ItemViewModeToBackgroundConverter}}">
|
||||
<Grid ColumnDefinitions="20,*,300" Margin="3" x:Name="RootGrid">
|
||||
<Grid ColumnDefinitions="20,*,Auto" Margin="3" x:Name="RootGrid">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="Foreground" Value="{Binding DataContext.ViewMode,Converter={StaticResource ItemViewModeToForegroundConverter},ElementName=ItemRoot}"/>
|
||||
@@ -32,6 +32,7 @@
|
||||
<MultiBinding.Bindings>
|
||||
<Binding Path="DisplayName"/>
|
||||
<Binding ElementName="RootGrid" Path="Bounds.Width"/>
|
||||
<Binding ElementName="ItemRoot" Path="ShowAttributes"/>
|
||||
</MultiBinding.Bindings>
|
||||
</MultiBinding>
|
||||
</ItemsControl.Items>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<StackPanel Margin="20,10" Orientation="Horizontal">
|
||||
<local:PathPresenter DataContext="{Binding AppState.SelectedTab.CurrentLocation.Container.FullName}"/>
|
||||
<TextBlock
|
||||
Text="{Binding AppState.SelectedTab.SelectedItem.Item.Name}" Foreground="{StaticResource AccentForegroundBrush}" />
|
||||
Text="{Binding AppState.SelectedTab.SelectedItem.Item.Name}" Foreground="{StaticResource AccentBrush}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
</ListBox>
|
||||
|
||||
<Grid
|
||||
x:CompileBindings="False"
|
||||
x:CompileBindings="False"
|
||||
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Items^.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
|
||||
|
||||
<TextBlock
|
||||
@@ -343,7 +343,7 @@
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<ItemsRepeater Items="{Binding AppState.PopupTexts}" Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Bottom" IsVisible="{Binding AppState.PopupTexts.Count,Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
|
||||
<ItemsRepeater Items="{Binding AppState.PopupTexts}" Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Top" IsVisible="{Binding AppState.PopupTexts.Count,Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
|
||||
<ItemsRepeater.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Style.Animations>
|
||||
@@ -360,7 +360,9 @@
|
||||
</ItemsRepeater.Styles>
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" HorizontalAlignment="Center"/>
|
||||
<Border Background="{DynamicResource ContainerGradientBackgroundBrush}" Margin="5" Padding="5">
|
||||
<TextBlock Text="{Binding}" Foreground="{DynamicResource AccentComplementBrush}" HorizontalAlignment="Center"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
|
||||
Reference in New Issue
Block a user