This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Massively overhauled the Engravings UI so that it's testing-ready.
- Loading branch information
1 parent
dfb122b
commit 1385c45
Showing
10 changed files
with
180 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="clr-namespace:LostArkTools.Controls"> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="pack://application:,,,/Controls/HighlightableBorderedText.xaml"/> | ||
</ResourceDictionary.MergedDictionaries> | ||
<Style BasedOn="{StaticResource HighlightableBorderedText}" TargetType="{x:Type controls:HighlightableBorderedText}"/> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Media; | ||
|
||
namespace LostArkTools.Controls; | ||
|
||
[TemplatePart(Name = "PART_Border", Type = typeof(Border))] | ||
[TemplatePart(Name = "PART_TextBox", Type = typeof(TextBox))] | ||
public class HighlightableBorderedText : Control | ||
{ | ||
public static readonly DependencyProperty IsHighlightedProperty = DependencyProperty.Register( | ||
"IsHighlighted", typeof(bool), typeof(HighlightableBorderedText), new PropertyMetadata(default(bool))); | ||
public bool IsHighlighted | ||
{ | ||
get => (bool)GetValue(IsHighlightedProperty); | ||
set => SetValue(IsHighlightedProperty, value); | ||
} | ||
|
||
public static readonly DependencyProperty HighlightBrushProperty = DependencyProperty.Register( | ||
"HighlightBrush", typeof(Brush), typeof(HighlightableBorderedText), new PropertyMetadata(default(Brush))); | ||
public Brush HighlightBrush | ||
{ | ||
get => (Brush)GetValue(HighlightBrushProperty); | ||
set => SetValue(HighlightBrushProperty, value); | ||
} | ||
|
||
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( | ||
"Text", typeof(string), typeof(HighlightableBorderedText), new PropertyMetadata(default(string))); | ||
public string Text | ||
{ | ||
get => (string)GetValue(TextProperty); | ||
set => SetValue(TextProperty, value); | ||
} | ||
|
||
public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register( | ||
"TextAlignment", typeof(TextAlignment), typeof(HighlightableBorderedText), new PropertyMetadata(default(TextAlignment))); | ||
public TextAlignment TextAlignment | ||
{ | ||
get => (TextAlignment)GetValue(TextAlignmentProperty); | ||
set => SetValue(TextAlignmentProperty, value); | ||
} | ||
|
||
static HighlightableBorderedText() | ||
{ | ||
DefaultStyleKeyProperty.OverrideMetadata(typeof(HighlightableBorderedText), new FrameworkPropertyMetadata(typeof(HighlightableBorderedText))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="clr-namespace:LostArkTools.Controls"> | ||
<Style x:Key="HighlightableBorderedText" TargetType="{x:Type controls:HighlightableBorderedText}"> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type controls:HighlightableBorderedText}"> | ||
<Border x:Name="PART_Border" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
Background="{TemplateBinding Background}"> | ||
<TextBlock x:Name="PART_TextBlock" | ||
FontSize="{TemplateBinding FontSize}" | ||
Text="{TemplateBinding Text}" | ||
TextAlignment="{TemplateBinding TextAlignment}" | ||
Foreground="{TemplateBinding Foreground}" /> | ||
</Border> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsHighlighted" Value="True"> | ||
<Setter TargetName="PART_TextBlock" Property="FontWeight" Value="Bold" /> | ||
<Setter TargetName="PART_Border" Property="Background" | ||
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush}" /> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
</ResourceDictionary> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.