Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions src/TextForge.Core/Fonts/FontRegistry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Collections.Generic;

namespace TextForge.Core.Fonts;

public static class FontRegistry
{
/// <summary>
/// Global collection of fonts available across all document modules.
/// </summary>
public static IReadOnlyList<string> AvailableFonts { get; } =
[
"Segoe UI",
"Inter",
"Arial",
"Calibri",
"Times New Roman",
"Consolas"
];
}
74 changes: 47 additions & 27 deletions src/TextForge.Desktop/Views/Components/PropertiesToolbarView.axaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,64 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cp="using:Avalonia.Controls"
xmlns:fonts="using:TextForge.Core.Fonts"
x:Class="TextForge.Desktop.Views.Components.PropertiesToolbarView">
<Border Background="#F9FAFB"
BorderBrush="#E5E7EB"
BorderThickness="1"
CornerRadius="6"
Padding="8,6"
Margin="0,0,0,10">
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center">
<TextBlock Text="Color:" FontSize="12" Foreground="#4B5563" VerticalAlignment="Center" Margin="0,0,4,0" />
<StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">

<!-- 5 Default Template Swatches -->
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#2563EB" BorderThickness="0" ToolTip.Tip="Primary Blue (#2563EB)" Tag="#2563EB" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#1E40AF" BorderThickness="0" ToolTip.Tip="Deep Navy (#1E40AF)" Tag="#1E40AF" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#0D9488" BorderThickness="0" ToolTip.Tip="Teal Accent (#0D9488)" Tag="#0D9488" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#4B5563" BorderThickness="0" ToolTip.Tip="Slate Gray (#4B5563)" Tag="#4B5563" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#DC2626" BorderThickness="0" ToolTip.Tip="Alert Red (#DC2626)" Tag="#DC2626" />
<!-- Global Font Dropdown (UI Only) -->
<StackPanel Orientation="Horizontal" Spacing="4" VerticalAlignment="Center">
<TextBlock Text="Font:" FontSize="12" Foreground="#4B5563" VerticalAlignment="Center" />
<ComboBox Name="FontSelector"
ItemsSource="{x:Static fonts:FontRegistry.AvailableFonts}"
SelectedIndex="0"
Width="130"
Height="28"
FontSize="12" />
</StackPanel>

<!-- Divider -->
<!-- Section Divider -->
<Border Width="1" Height="16" Background="#E5E7EB" Margin="4,0" />

<!-- Pop-up Color Picker Button -->
<Button Width="24"
Height="24"
CornerRadius="4"
Padding="0"
Background="#FFFFFF"
BorderBrush="#D1D5DB"
BorderThickness="1"
ToolTip.Tip="Choose Custom Color">
<TextBlock Text="🎨" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Button.Flyout>
<Flyout Placement="BottomEdgeAlignedLeft">
<cp:ColorPicker Name="CustomColorPicker"
Color="#2563EB"
IsAlphaEnabled="False" />
</Flyout>
</Button.Flyout>
</Button>
<!-- Template Color Palette & Custom Picker -->
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
<TextBlock Text="Color:" FontSize="12" Foreground="#4B5563" VerticalAlignment="Center" Margin="0,0,2,0" />

<!-- 5 Default Template Swatches -->
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#2563EB" BorderThickness="0" ToolTip.Tip="Primary Blue (#2563EB)" Tag="#2563EB" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#1E40AF" BorderThickness="0" ToolTip.Tip="Deep Navy (#1E40AF)" Tag="#1E40AF" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#0D9488" BorderThickness="0" ToolTip.Tip="Teal Accent (#0D9488)" Tag="#0D9488" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#4B5563" BorderThickness="0" ToolTip.Tip="Slate Gray (#4B5563)" Tag="#4B5563" />
<Button Width="22" Height="22" CornerRadius="4" Padding="0" Background="#DC2626" BorderThickness="0" ToolTip.Tip="Alert Red (#DC2626)" Tag="#DC2626" />

<!-- Color Divider -->
<Border Width="1" Height="14" Background="#E5E7EB" Margin="3,0" />

<!-- Pop-up Color Picker Trigger -->
<Button Width="24"
Height="24"
CornerRadius="4"
Padding="0"
Background="#FFFFFF"
BorderBrush="#D1D5DB"
BorderThickness="1"
ToolTip.Tip="Choose Custom Color">
<TextBlock Text="🎨" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Button.Flyout>
<Flyout Placement="BottomEdgeAlignedLeft">
<cp:ColorPicker Name="CustomColorPicker"
Color="#2563EB"
IsAlphaEnabled="False" />
</Flyout>
</Button.Flyout>
</Button>
</StackPanel>

</StackPanel>
</Border>
</UserControl>
Loading