Skip to content

Commit 46fe762

Browse files
committed
Improved PromptCard buttons layout
1 parent fdc786d commit 46fe762

File tree

1 file changed

+40
-30
lines changed

1 file changed

+40
-30
lines changed

StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
xmlns:controls="using:StabilityMatrix.Avalonia.Controls"
88
xmlns:fluent="clr-namespace:FluentIcons.Avalonia.Fluent;assembly=FluentIcons.Avalonia.Fluent"
99
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
10+
xmlns:iconExt="clr-namespace:FluentIcons.Avalonia.Fluent.MarkupExtensions;assembly=FluentIcons.Avalonia.Fluent"
1011
xmlns:icons="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia"
1112
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
1213
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
@@ -48,7 +49,8 @@
4849
Grid.Row="0"
4950
Grid.Column="0"
5051
Grid.ColumnSpan="2"
51-
Margin="4,0,4,8"
52+
Margin="4,0,4,4"
53+
VerticalAlignment="Top"
5254
Orientation="Horizontal">
5355
<TextBlock FontSize="14" Text="Prompt" />
5456
<icons:Icon
@@ -60,35 +62,40 @@
6062
<StackPanel
6163
Grid.Row="0"
6264
Grid.Column="1"
63-
Margin="0,0,0,4"
65+
Margin="0,-2,0,4"
6466
HorizontalAlignment="Right"
65-
Orientation="Horizontal">
66-
67-
<Panel>
68-
<Button
69-
x:Name="PART_HelpButton"
70-
Margin="0,-2,0,0"
71-
Padding="10,4"
72-
VerticalAlignment="Top"
73-
VerticalContentAlignment="Top"
74-
icons:Attached.Icon="fa-solid fa-question"
75-
Classes="transparent-full"
76-
Command="{Binding ShowHelpDialogCommand}" />
77-
78-
<ui:TeachingTip
79-
Title="{x:Static lang:Resources.TeachingTip_InferencePromptHelpButton}"
80-
IsOpen="{Binding IsHelpButtonTeachingTipOpen, Mode=TwoWay}"
81-
Target="{Binding #PART_HelpButton}" />
82-
</Panel>
83-
67+
VerticalAlignment="Top"
68+
Orientation="Horizontal"
69+
Spacing="0">
70+
<StackPanel.Styles>
71+
<!-- Set Button Stuff -->
72+
<Style Selector="StackPanel &gt; Button">
73+
<Setter Property="Padding" Value="6,4" />
74+
<Setter Property="Height" Value="24" />
75+
<Setter Property="VerticalAlignment" Value="Top" />
76+
</Style>
77+
</StackPanel.Styles>
78+
<Button
79+
x:Name="PART_HelpButton"
80+
VerticalAlignment="Top"
81+
VerticalContentAlignment="Top"
82+
icons:Attached.Icon="fa-solid fa-question"
83+
Classes="transparent-full"
84+
Command="{Binding ShowHelpDialogCommand}" />
85+
<ui:TeachingTip
86+
Title="{x:Static lang:Resources.TeachingTip_InferencePromptHelpButton}"
87+
IsOpen="{Binding IsHelpButtonTeachingTipOpen, Mode=TwoWay}"
88+
Target="{Binding #PART_HelpButton}" />
8489
<Button
8590
x:Name="PART_AmplifyButton"
86-
Margin="0,-2,0,0"
87-
Padding="10,4"
91+
Padding="6,2,6,1"
8892
VerticalAlignment="Top"
8993
VerticalContentAlignment="Top"
90-
icons:Attached.Icon="fa-solid fa-wand-magic-sparkles"
91-
Classes="accent"
94+
Classes="transparent-full"
95+
Content="{iconExt:FluentIcon Icon=SlideTextSparkle,
96+
IconVariant=Regular,
97+
IconSize=Size20,
98+
FontSize=19}"
9299
ToolTip.Tip="Prompt Amplifier">
93100
<Button.Flyout>
94101
<controls:BetterFlyout>
@@ -385,11 +392,14 @@
385392
NavigateUri="https://lykos.ai/prompt-amplifier/help" />
386393
</StackPanel>
387394
</ui:TeachingTip>
388-
<Button
389-
Padding="8,4"
390-
Command="{Binding DebugShowTokensCommand}"
391-
Content="Show Tokens"
392-
IsVisible="{Binding SharedState.IsDebugMode}" />
395+
<Button Classes="transparent-full" Content="{iconExt:FluentIcon Icon=MoreVertical, FontSize=16, IconVariant=Regular}">
396+
<Button.Flyout>
397+
<MenuFlyout>
398+
<!-- ReSharper disable once Xaml.RedundantResource -->
399+
<MenuItem Command="{Binding DebugShowTokensCommand}" Header="(Debug) Show Tokens" />
400+
</MenuFlyout>
401+
</Button.Flyout>
402+
</Button>
393403

394404
</StackPanel>
395405

0 commit comments

Comments
 (0)