fixes
This commit is contained in:
@@ -1,30 +1,29 @@
|
||||
<Button xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
x:Class="Pilz.UI.AvaloniaUI.Controls.ImageButton">
|
||||
|
||||
<Button
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
x:Class="Pilz.UI.AvaloniaUI.Controls.ImageButton">
|
||||
|
||||
<StackPanel
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
>
|
||||
|
||||
Spacing="6">
|
||||
|
||||
<Image
|
||||
x:Name="ButtonImage"
|
||||
Margin="0, 0, 0, 6"
|
||||
VerticalAlignment="Center"
|
||||
Width="16"
|
||||
Height="16"
|
||||
IsVisible="False"
|
||||
/>
|
||||
|
||||
Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
|
||||
Height="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
|
||||
IsVisible="False"/>
|
||||
|
||||
<TextBlock
|
||||
x:Name="ButtonText"
|
||||
VerticalAlignment="Center"
|
||||
/>
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Button>
|
||||
@@ -41,7 +41,7 @@ public partial class ImageButton : Button
|
||||
set => ButtonImage.Height = value;
|
||||
}
|
||||
|
||||
public double ImageQuadSize
|
||||
public double ImageWeight
|
||||
{
|
||||
get => ButtonImage.Width;
|
||||
set => ButtonImage.Width = ButtonImage.Height = value;
|
||||
|
||||
29
Pilz.UI.AvaloniaUI/Controls/ImageDropDownButton.axaml
Normal file
29
Pilz.UI.AvaloniaUI/Controls/ImageDropDownButton.axaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<DropDownButton
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
x:Class="Pilz.UI.AvaloniaUI.Controls.ImageDropDownButton">
|
||||
|
||||
<StackPanel
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="6">
|
||||
|
||||
<Image
|
||||
x:Name="ButtonImage"
|
||||
VerticalAlignment="Center"
|
||||
Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
|
||||
Height="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
|
||||
IsVisible="False"/>
|
||||
|
||||
<TextBlock
|
||||
x:Name="ButtonText"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DropDownButton>
|
||||
59
Pilz.UI.AvaloniaUI/Controls/ImageDropDownButton.axaml.cs
Normal file
59
Pilz.UI.AvaloniaUI/Controls/ImageDropDownButton.axaml.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Pilz.UI.AvaloniaUI.Controls;
|
||||
|
||||
public partial class ImageDropDownButton : DropDownButton
|
||||
{
|
||||
protected override Type StyleKeyOverride => typeof(SplitButton);
|
||||
|
||||
public ImageDropDownButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string? Text
|
||||
{
|
||||
get => ButtonText.Text;
|
||||
set => ButtonText.Text = value;
|
||||
}
|
||||
|
||||
public IImage? ImageSource
|
||||
{
|
||||
get => ButtonImage.Source;
|
||||
set
|
||||
{
|
||||
ButtonImage.Source = value;
|
||||
ButtonImage.IsVisible = value != null;
|
||||
}
|
||||
}
|
||||
|
||||
public double ImageWidth
|
||||
{
|
||||
get => ButtonImage.Width;
|
||||
set => ButtonImage.Width = value;
|
||||
}
|
||||
|
||||
public double ImageHeight
|
||||
{
|
||||
get => ButtonImage.Height;
|
||||
set => ButtonImage.Height = value;
|
||||
}
|
||||
|
||||
public double ImageWeight
|
||||
{
|
||||
get => ButtonImage.Width;
|
||||
set => ButtonImage.Width = ButtonImage.Height = value;
|
||||
}
|
||||
|
||||
public Size ImageSize
|
||||
{
|
||||
get => new(ButtonImage.Width, ButtonImage.Height);
|
||||
set
|
||||
{
|
||||
ButtonImage.Width = value.Width;
|
||||
ButtonImage.Height = value.Height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,29 @@
|
||||
<SplitButton xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
x:Class="Pilz.UI.AvaloniaUI.Controls.ImageSplitButton">
|
||||
|
||||
<SplitButton
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
x:Class="Pilz.UI.AvaloniaUI.Controls.ImageSplitButton">
|
||||
|
||||
<StackPanel
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
>
|
||||
|
||||
Spacing="6">
|
||||
|
||||
<Image
|
||||
x:Name="ButtonImage"
|
||||
Margin="0, 0, 0, 6"
|
||||
VerticalAlignment="Center"
|
||||
Width="16"
|
||||
Height="16"
|
||||
IsVisible="False"
|
||||
/>
|
||||
|
||||
Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
|
||||
Height="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
|
||||
IsVisible="False"/>
|
||||
|
||||
<TextBlock
|
||||
x:Name="ButtonText"
|
||||
VerticalAlignment="Center"
|
||||
/>
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</SplitButton>
|
||||
</SplitButton>
|
||||
@@ -41,7 +41,7 @@ public partial class ImageSplitButton : SplitButton
|
||||
set => ButtonImage.Height = value;
|
||||
}
|
||||
|
||||
public double ImageQuadSize
|
||||
public double ImageWeight
|
||||
{
|
||||
get => ButtonImage.Width;
|
||||
set => ButtonImage.Width = ButtonImage.Height = value;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
x:Name="ImageTitle"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Width="16"
|
||||
/>
|
||||
|
||||
<TextBlock
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.2.8</Version>
|
||||
<Version>1.2.9</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -24,6 +24,10 @@
|
||||
<Compile Update="Controls\ImageSplitButton.axaml.cs">
|
||||
<DependentUpon>ImageSplitButton.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Controls\ImageDropDownButton.axaml.cs">
|
||||
<DependentUpon>ImageDropDownButton.axaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user