v1.2: Font size menu (10 to 18)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
89586bd706
commit
8c09e56982
+32
-3
@@ -21,7 +21,7 @@ namespace QuickClaude
|
||||
readonly TextBlock status = new TextBlock();
|
||||
readonly TextBlock grip = new TextBlock();
|
||||
WF.NotifyIcon tray;
|
||||
WF.ToolStripMenuItem fontMenu, topItem, blackItem, whiteItem, lookItem, editItem, autoItem, folderItem;
|
||||
WF.ToolStripMenuItem fontMenu, sizeMenu, topItem, blackItem, whiteItem, lookItem, editItem, autoItem, folderItem;
|
||||
bool lastWasTool;
|
||||
bool quitting;
|
||||
|
||||
@@ -30,14 +30,17 @@ namespace QuickClaude
|
||||
// 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;
|
||||
// Picked from the tray's Font size menu, 10 to 18 (same units as wIRC's font size
|
||||
// slider: 10sp = 10 WPF units). ConfirmWindow and DarkMenu read it when they open.
|
||||
internal const double MinTextSize = 10, MaxTextSize = 18;
|
||||
internal static double TextSize = 10;
|
||||
const double ResizeEdge = 6;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
settings = Settings.Load();
|
||||
Mono = Fonts.Find(settings.Font).Family;
|
||||
TextSize = Math.Clamp(Math.Round(settings.FontSize), MinTextSize, MaxTextSize);
|
||||
|
||||
Title = "QuickClaude";
|
||||
WindowStyle = WindowStyle.None;
|
||||
@@ -147,6 +150,24 @@ namespace QuickClaude
|
||||
((Grid)Content).ContextMenu = DarkMenu.Make(null, NewConversation);
|
||||
}
|
||||
|
||||
void SetFontSize(double size)
|
||||
{
|
||||
size = Math.Clamp(size, MinTextSize, MaxTextSize);
|
||||
settings.FontSize = size;
|
||||
settings.Save();
|
||||
TextSize = size;
|
||||
FontSize = size;
|
||||
transcript.FontSize = size;
|
||||
input.FontSize = size;
|
||||
status.FontSize = size;
|
||||
grip.FontSize = size;
|
||||
BuildContextMenus();
|
||||
transcript.ScrollToEnd();
|
||||
if (sizeMenu != null)
|
||||
foreach (WF.ToolStripMenuItem item in sizeMenu.DropDownItems)
|
||||
item.Checked = item.Text == size.ToString();
|
||||
}
|
||||
|
||||
void SetFont(string name)
|
||||
{
|
||||
var choice = Fonts.Find(name);
|
||||
@@ -388,6 +409,14 @@ namespace QuickClaude
|
||||
}
|
||||
menu.Items.Add(fontMenu);
|
||||
|
||||
sizeMenu = new WF.ToolStripMenuItem("Font size");
|
||||
for (int px = (int)MinTextSize; px <= (int)MaxTextSize; px++)
|
||||
{
|
||||
double sz = px;
|
||||
sizeMenu.DropDownItems.Add(new WF.ToolStripMenuItem(px.ToString(), null, (s, e) => SetFontSize(sz)) { Checked = sz == TextSize });
|
||||
}
|
||||
menu.Items.Add(sizeMenu);
|
||||
|
||||
topItem = new WF.ToolStripMenuItem("Always on top", null, (s, e) =>
|
||||
{
|
||||
settings.Topmost = !settings.Topmost; Topmost = settings.Topmost; topItem.Checked = settings.Topmost; settings.Save();
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
<Nullable>disable</Nullable>
|
||||
<AssemblyName>QuickClaude</AssemblyName>
|
||||
<RootNamespace>QuickClaude</RootNamespace>
|
||||
<Version>1.1.0</Version>
|
||||
<Version>1.2.0</Version>
|
||||
<Product>QuickClaude</Product>
|
||||
<ApplicationIcon>app.ico</ApplicationIcon>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace QuickClaude
|
||||
public double Height { get; set; } = 380;
|
||||
public string TextColor { get; set; } = "Black";
|
||||
public string Font { get; set; } = "Consolas";
|
||||
public double FontSize { get; set; } = 10;
|
||||
public bool Topmost { get; set; } = false;
|
||||
public string WorkDir { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
public string Mode { get; set; } = "default";
|
||||
|
||||
Reference in New Issue
Block a user