v1.1: Font picker (Segoe UI, Tahoma, Tw Cen MT, Nunito, Quicksand, Varela Round), solid clod title
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8431323848
commit
89586bd706
+41
-7
@@ -21,13 +21,15 @@ namespace QuickClaude
|
||||
readonly TextBlock status = new TextBlock();
|
||||
readonly TextBlock grip = new TextBlock();
|
||||
WF.NotifyIcon tray;
|
||||
WF.ToolStripMenuItem topItem, blackItem, whiteItem, lookItem, editItem, autoItem, folderItem;
|
||||
WF.ToolStripMenuItem fontMenu, topItem, blackItem, whiteItem, lookItem, editItem, autoItem, folderItem;
|
||||
bool lastWasTool;
|
||||
bool quitting;
|
||||
|
||||
// Nearly invisible fill so the window still catches the mouse (fully clear pixels click through)
|
||||
static readonly Brush HitFill = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||
internal static readonly FontFamily Mono = new FontFamily("Consolas, Courier New");
|
||||
// The current font (picked from the tray's Font menu). Still called Mono since
|
||||
// ConfirmWindow and DarkMenu read it when they open.
|
||||
internal static FontFamily Mono = new FontFamily("Consolas, Courier New");
|
||||
// Matches wIRC at its smallest font slider setting (10sp = 10 WPF units)
|
||||
internal const double TextSize = 10;
|
||||
const double ResizeEdge = 6;
|
||||
@@ -35,6 +37,7 @@ namespace QuickClaude
|
||||
public MainWindow()
|
||||
{
|
||||
settings = Settings.Load();
|
||||
Mono = Fonts.Find(settings.Font).Family;
|
||||
|
||||
Title = "QuickClaude";
|
||||
WindowStyle = WindowStyle.None;
|
||||
@@ -88,7 +91,7 @@ namespace QuickClaude
|
||||
rootGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
|
||||
rootGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
||||
|
||||
// Top row: a faint "clod" label that moves the window, plus a quiet status line
|
||||
// Top row: a solid "clod" label that moves the window, plus a quiet status line
|
||||
grip.Text = "clod";
|
||||
grip.FontSize = TextSize;
|
||||
grip.FontFamily = Mono;
|
||||
@@ -131,12 +134,34 @@ namespace QuickClaude
|
||||
Grid.SetRow(bottom, 2);
|
||||
rootGrid.Children.Add(bottom);
|
||||
|
||||
// Right-click menus: Copy (and Cut/Paste in the input) plus New conversation; blank areas get just the latter
|
||||
Content = rootGrid;
|
||||
BuildContextMenus();
|
||||
}
|
||||
|
||||
// Right-click menus: Copy (and Cut/Paste in the input) plus New conversation; blank areas get just the latter.
|
||||
// Rebuilt when the font changes so they use it too.
|
||||
void BuildContextMenus()
|
||||
{
|
||||
transcript.ContextMenu = DarkMenu.Make(transcript, NewConversation);
|
||||
input.ContextMenu = DarkMenu.Make(input, NewConversation);
|
||||
rootGrid.ContextMenu = DarkMenu.Make(null, NewConversation);
|
||||
((Grid)Content).ContextMenu = DarkMenu.Make(null, NewConversation);
|
||||
}
|
||||
|
||||
Content = rootGrid;
|
||||
void SetFont(string name)
|
||||
{
|
||||
var choice = Fonts.Find(name);
|
||||
settings.Font = choice.Name;
|
||||
settings.Save();
|
||||
Mono = choice.Family;
|
||||
FontFamily = Mono;
|
||||
transcript.FontFamily = Mono;
|
||||
input.FontFamily = Mono;
|
||||
status.FontFamily = Mono;
|
||||
grip.FontFamily = Mono;
|
||||
BuildContextMenus();
|
||||
if (fontMenu != null)
|
||||
foreach (WF.ToolStripMenuItem item in fontMenu.DropDownItems)
|
||||
item.Checked = item.Text == choice.Name;
|
||||
}
|
||||
|
||||
static void StyleBox(TextBox tb)
|
||||
@@ -178,7 +203,7 @@ namespace QuickClaude
|
||||
input.CaretBrush = solid;
|
||||
transcript.CaretBrush = solid;
|
||||
status.Foreground = faint;
|
||||
grip.Foreground = faint;
|
||||
grip.Foreground = solid;
|
||||
if (blackItem != null) { blackItem.Checked = c == Colors.Black; whiteItem.Checked = c == Colors.White; }
|
||||
}
|
||||
|
||||
@@ -354,6 +379,15 @@ namespace QuickClaude
|
||||
color.DropDownItems.Add(whiteItem);
|
||||
menu.Items.Add(color);
|
||||
|
||||
fontMenu = new WF.ToolStripMenuItem("Font");
|
||||
var current = Fonts.Find(settings.Font).Name;
|
||||
foreach (var choice in Fonts.All)
|
||||
{
|
||||
var name = choice.Name;
|
||||
fontMenu.DropDownItems.Add(new WF.ToolStripMenuItem(name, null, (s, e) => SetFont(name)) { Checked = name == current });
|
||||
}
|
||||
menu.Items.Add(fontMenu);
|
||||
|
||||
topItem = new WF.ToolStripMenuItem("Always on top", null, (s, e) =>
|
||||
{
|
||||
settings.Topmost = !settings.Topmost; Topmost = settings.Topmost; topItem.Checked = settings.Topmost; settings.Save();
|
||||
|
||||
Reference in New Issue
Block a user