Libation Runs on Linux!

This commit is contained in:
Michael Bucari-Tovo 2022-07-23 18:07:04 -06:00
parent 17b0da358f
commit 1e4c489983
166 changed files with 10989 additions and 56 deletions

View file

@ -20,10 +20,8 @@
Height="18"
Margin="10,0,10,0"
VerticalAlignment="Center"
FontFamily="avares://Libation/AvaloniaUI/Assets/SEGOEUI.TTF"
FontStyle="Normal"
FontWeight="Normal"
Text="{Binding CharacterToReplace}" />
FontFamily="SEGOEUI_Local"
Text="{Binding Replacement.CharacterToReplace}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@ -31,15 +29,28 @@
<DataGridTemplateColumn IsReadOnly="False" Width="Auto" Header="Replacement Text">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox
GotFocus="Tb_GotFocus"
Height="18"
Margin="10,0,10,0"
VerticalAlignment="Center"
FontFamily="Arial"
FontStyle="Normal"
FontWeight="Normal"
Text="{Binding ReplacementString}" />
<Grid RowDefinitions="*" ColumnDefinitions="*">
<TextBox
Grid.Column="0"
Grid.Row="0"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
FontSize="14"
FontFamily="SEGOEUI_Local"
Foreground="{StaticResource SystemControlTransparentBrush}"
SelectionBrush="{StaticResource SystemControlTransparentBrush}"
BorderBrush="{StaticResource SystemControlTransparentBrush}"
Text="{Binding ReplacementText, Mode=TwoWay}" />
<TextBlock
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
FontSize="14"
FontFamily="SEGOEUI_Local"
Text="{Binding ReplacementText}" />
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

View file

@ -5,13 +5,15 @@ using FileManager;
using LibationFileManager;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using ReactiveUI;
using System.Linq;
namespace LibationWinForms.AvaloniaUI.Views.Dialogs
{
public partial class EditReplacementChars : DialogWindow
{
Configuration config = Configuration.Instance;
public ObservableCollection<Replacement> replacements { get; }
public ObservableCollection<ReplacementsExt> replacements { get; }
public EditReplacementChars()
{
InitializeComponent();
@ -19,13 +21,23 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
if (Design.IsDesignMode)
AudibleUtilities.AudibleApiStorage.EnsureAccountsSettingsFileExists();
replacements = new(config.ReplacementCharacters.Replacements);
replacements = new(config.ReplacementCharacters.Replacements.Select(r => new ReplacementsExt { Replacement = r }));
DataContext = this;
}
public void Tb_GotFocus(object sender, Avalonia.Input.GotFocusEventArgs e)
{
public class ReplacementsExt : ViewModels.ViewModelBase
{
public Replacement Replacement { get; init; }
public string ReplacementText
{
get => Replacement.ReplacementString;
set
{
Replacement.ReplacementString = value;
this.RaisePropertyChanged(nameof(ReplacementText));
}
}
}
private void InitializeComponent()

View file

@ -43,9 +43,6 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
public EditTemplateDialog()
{
InitializeComponent();
#if DEBUG
this.AttachDevTools();
#endif
_viewModel = new(Configuration.Instance, this.Find<WrapPanel>(nameof(wrapPanel)));
}

View file

@ -65,9 +65,13 @@ namespace LibationWinForms.AvaloniaUI.Views
productsDisplay?.CloseImageDisplay();
}
private void MainWindow_Opened(object sender, EventArgs e)
private async void MainWindow_Opened(object sender, EventArgs e)
{
/*
var charReplace = new EditReplacementChars();
await charReplace.ShowDialog(this);
*/
}
public void ProductsDisplay_Initialized1(object sender, EventArgs e)

View file

@ -112,21 +112,6 @@
</ItemGroup>
<ItemGroup>
<Compile Update="AvaloniaUI\Views\Dialogs\DescriptionDisplayDialog.axaml.cs">
<DependentUpon>DescriptionDisplayDialog.axaml</DependentUpon>
</Compile>
<Compile Update="AvaloniaUI\Views\Dialogs\EditQuickFilters.axaml.cs">
<DependentUpon>EditQuickFilters.axaml</DependentUpon>
</Compile>
<Compile Update="AvaloniaUI\Views\Dialogs\BookDetailsDialog.axaml.cs">
<DependentUpon>BookDetailsDialog.axaml</DependentUpon>
</Compile>
<Compile Update="AvaloniaUI\Views\Dialogs\SearchSyntaxDialog.axaml.cs">
<DependentUpon>SearchSyntaxDialog.axaml</DependentUpon>
</Compile>
<Compile Update="AvaloniaUI\Views\Dialogs\ImageDisplayDialog.axaml.cs">
<DependentUpon>ImageDisplayDialog.axaml</DependentUpon>
</Compile>
<Compile Update="AvaloniaUI\Views\ProcessBookControl.axaml.cs">
<DependentUpon>ProcessBookControl.axaml</DependentUpon>
</Compile>