Skip to content

Commit

Permalink
#200 fixed - Font type can set now in GlobalHighlight options
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Zönnchen committed Sep 14, 2023
1 parent f99d497 commit e11f521
Show file tree
Hide file tree
Showing 9 changed files with 581 additions and 205 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using log4net;
Expand All @@ -23,6 +24,7 @@
using Org.Vs.TailForWin.Core.Data.Base;
using Org.Vs.TailForWin.Core.Utils;
using Org.Vs.TailForWin.Data.Messages;
using Org.Vs.TailForWin.PlugIns.FontChooserModule;


namespace Org.Vs.TailForWin.PlugIns.OptionModules.EnvironmentOption.ViewModels
Expand Down Expand Up @@ -168,6 +170,13 @@ private set
/// </summary>
public ICommand UndoCommand => _undoCommand ?? (_undoCommand = new RelayCommand(p => CanExecuteUndo(), p => ExecuteUndoCommand()));

private ICommand _fontCommand;

/// <summary>
/// Font command
/// </summary>
public ICommand FontCommand => _fontCommand ?? (_fontCommand = new RelayCommand(p => SelectedItem != null, p => ExecuteFontCommand((ContentControl) p)));

private async Task ExecuteLoadedCommandAsync()
{
SetCancellationTokenSource();
Expand Down Expand Up @@ -311,6 +320,22 @@ private async Task ExecuteSaveCommandAsync()
CommitChanges();
}

private void ExecuteFontCommand(DependencyObject userControl)
{
if ( SelectedItem == null )
return;

var fontManager = new FontChooseDialog
{
Owner = Window.GetWindow(userControl),
SelectedFont = new FontInfo(SelectedItem.FontType.FontFamily, SelectedItem.FontType.FontSize, SelectedItem.FontType.FontStyle,
SelectedItem.FontType.FontWeight, SelectedItem.FontType.FontStretch)
};

if ( fontManager.ShowDialog() == true )
SelectedItem.FontType = fontManager.SelectedFont.FontType;
}

private void CommitChanges()
{
foreach ( var item in _globalHighlightCollection )
Expand Down
4 changes: 2 additions & 2 deletions Tail4Windows/Tail4Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<Product>T4W</Product>
<Description>Professional log reader for Windows®</Description>
<Copyright>Copyright © 2013 - 2023 M. Zoennchen</Copyright>
<AssemblyVersion>2.4.8655</AssemblyVersion>
<FileVersion>2.4.8655</FileVersion>
<AssemblyVersion>2.4.8657</AssemblyVersion>
<FileVersion>2.4.8657</FileVersion>
<UseWPF>true</UseWPF>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
4 changes: 2 additions & 2 deletions Tail4WindowsBusiness/Tail4WindowsBusiness.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<Product>T4WBusiness</Product>
<Description>Professional log reader for Windows® Business</Description>
<Copyright>Copyright © 2018 - 2023 M. Zoennchen</Copyright>
<AssemblyVersion>1.0.265</AssemblyVersion>
<FileVersion>1.0.265</FileVersion>
<AssemblyVersion>1.0.266</AssemblyVersion>
<FileVersion>1.0.266</FileVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,13 @@ ICommand UndoCommand
{
get;
}

/// <summary>
/// Font command
/// </summary>
ICommand FontCommand
{
get;
}
}
}
4 changes: 2 additions & 2 deletions Tail4WindowsControllers/Tail4WindowsControllers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<Product>T4WControllers</Product>
<Description>Professional log reader for Windows® Controllers</Description>
<Copyright>Copyright © 2018 - 2023 M. Zoennchen</Copyright>
<AssemblyVersion>1.0.243</AssemblyVersion>
<FileVersion>1.0.243</FileVersion>
<AssemblyVersion>1.0.246</AssemblyVersion>
<FileVersion>1.0.246</FileVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
Expand Down
4 changes: 2 additions & 2 deletions Tail4WindowsCore/Tail4WindowsCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<Product>T4WCore</Product>
<Description>Professional log reader for Windows® Core</Description>
<Copyright>Copyright © 2018 - 2023 M. Zoennchen</Copyright>
<AssemblyVersion>1.0.243</AssemblyVersion>
<FileVersion>1.0.243</FileVersion>
<AssemblyVersion>1.0.244</AssemblyVersion>
<FileVersion>1.0.244</FileVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
Expand Down
4 changes: 2 additions & 2 deletions Tail4WindowsUi.Plugins/Tail4WindowsUi.Plugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<Product>T4WUI.Plugins</Product>
<Description>Professional log reader for Windows® UI Plugins</Description>
<Copyright>Copyright © 2019 - 2023 M. Zoennchen</Copyright>
<AssemblyVersion>1.0.299</AssemblyVersion>
<FileVersion>1.0.299</FileVersion>
<AssemblyVersion>1.0.305</AssemblyVersion>
<FileVersion>1.0.305</FileVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
Expand Down
4 changes: 2 additions & 2 deletions Tail4WindowsUi.Utils/Tail4WindowsUi.Utils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<Product>T4WUI.Utils</Product>
<Description>Professional log reader for Windows® UI Utils</Description>
<Copyright>Copyright © 2019 - 2023 M. Zoennchen</Copyright>
<AssemblyVersion>1.0.156</AssemblyVersion>
<FileVersion>1.0.156</FileVersion>
<AssemblyVersion>1.0.159</AssemblyVersion>
<FileVersion>1.0.159</FileVersion>
<UseWPF>true</UseWPF>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down

0 comments on commit e11f521

Please sign in to comment.