Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2 new line styles for brushes Edge and EdgeWide #199

Merged
merged 26 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
337 changes: 215 additions & 122 deletions src/Consolonia.Core/Drawing/DrawingContextImpl.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Consolonia.Core/Drawing/LineBrush.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Avalonia;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Media;
using Consolonia.Core.InternalHelpers;
Expand Down
4 changes: 3 additions & 1 deletion src/Consolonia.Core/Drawing/LineStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public enum LineStyle
{
SingleLine = 0,
DoubleLine,
Bold
Bold,
Edge,
EdgeWide
tomlm marked this conversation as resolved.
Show resolved Hide resolved
}
}
11 changes: 11 additions & 0 deletions src/Consolonia.Core/Drawing/RectangleLinePosition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Consolonia.Core.Drawing
{
internal enum RectangleLinePosition
{
Left,
Top,
Right,
Bottom,
Unknown,
}
}
86 changes: 86 additions & 0 deletions src/Consolonia.Gallery/Gallery/GalleryViews/GalleryBorders.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:drawing="clr-namespace:Consolonia.Core.Drawing;assembly=Consolonia.Core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="Consolonia.Gallery.Gallery.GalleryViews.GalleryBorders">
<StackPanel Orientation="Vertical"
Spacing="1">
<WrapPanel>
<Border BorderThickness="1" BorderBrush="Red">
<TextBlock Text="Default" Background="AntiqueWhite" />
</Border>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="SingleLine" Brush="Green"/>
</Border.BorderBrush>
<TextBlock Text="LineStyle=SingleLine" Background="AntiqueWhite" />
</Border>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="DoubleLine" Brush="Blue"/>
</Border.BorderBrush>
<TextBlock Text="LineStyle=DoubleLine" Background="AntiqueWhite" />
</Border>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="Edge" Brush="DarkGreen"/>
</Border.BorderBrush>
<TextBlock Text="LineStyle=Edge" Background="AntiqueWhite" />
</Border>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="EdgeWide" Brush="Purple"/>
</Border.BorderBrush>
<TextBlock Text="LineStyle=EdgeWide" Background="AntiqueWhite"/>
</Border>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="Bold" Brush="DarkGray"/>
</Border.BorderBrush>
<TextBlock Text="LineStyle=Bold" Background="AntiqueWhite"/>
</Border>
</WrapPanel>
<WrapPanel>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="Edge" Brush="Gray"/>
</Border.BorderBrush>
<ComboBox Width="10">
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
<ComboBoxItem>Item 3</ComboBoxItem>
<ComboBoxItem>Item 4</ComboBoxItem>
</ComboBox>
</Border>
</WrapPanel>
<WrapPanel>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="SingleLine" Brush="Gray"/>
</Border.BorderBrush>
<Panel Background="AntiqueWhite">
<Image Source="avares://Consolonia.Gallery/Resources/happy.png" Width="40" Height="20" />
</Panel>
</Border>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="DoubleLine" Brush="Gray"/>
</Border.BorderBrush>
<Panel Background="AntiqueWhite">
<Image Source="avares://Consolonia.Gallery/Resources/happy.png" Width="40" Height="20" />
</Panel>
</Border>
<Border BorderThickness="1" >
<Border.BorderBrush>
<drawing:LineBrush LineStyle="Edge" Brush="Gray"/>
</Border.BorderBrush>
<Panel Background="AntiqueWhite">
<Image Source="avares://Consolonia.Gallery/Resources/happy.png" Width="40" Height="20" />
</Panel>
</Border>

</WrapPanel>
</StackPanel>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Avalonia.Controls;

namespace Consolonia.Gallery.Gallery.GalleryViews
{
public partial class GalleryBorders: UserControl
{
public GalleryBorders()
{
InitializeComponent();
}

}
}
Loading