Add font picker (Segoe UI, Tahoma, Tw Cen MT, Nunito, Quicksand, Varela Round), bump to 0.1.10

Each channel window's settings panel gets a Font list, and wIRC main gets a Font
button that opens the same list for the server messages box. Every name is drawn
in its own font as a preview. The choice is saved per window in window_prefs.json
(fontId) and applies to the scrollback, user list, input box and title.

- Segoe UI, Tahoma and Tw Cen MT are Microsoft-licensed, so they aren't bundled:
  they load from the Windows font folders at runtime and are only listed when
  present (Tw Cen MT comes with Office).
- Nunito, Quicksand and Varela Round are SIL OFL fonts, bundled in
  resources/fonts with their license files.
- A missing or unloadable font falls back to Monospace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
weishaupt
2026-10-09 19:18:31 -04:00
co-authored by Claude Opus 5.5
parent 3538274805
commit efad80e141
15 changed files with 442 additions and 10 deletions
+28 -1
View File
@@ -43,8 +43,10 @@ fun MainScreen(
displaySettings: WindowDisplaySettings,
onOpenChannel: (serverId: String, channelName: String) -> Unit,
onExitApp: () -> Unit,
onUnreadChange: (Int) -> Unit
onUnreadChange: (Int) -> Unit,
onFontChange: (String) -> Unit
) {
var showFontDialog by remember { mutableStateOf(false) }
var servers by remember { mutableStateOf(repo.loadAll()) }
var showAddDialog by remember { mutableStateOf(false) }
var editingServer by remember { mutableStateOf<ServerConfig?>(null) }
@@ -87,6 +89,12 @@ fun MainScreen(
Text("+ Add Server")
}
Spacer(Modifier.width(8.dp))
// Font for the server messages box (channel windows pick theirs in their own
// settings).
TextButton(onClick = { showFontDialog = true }) {
Text("Font")
}
Spacer(Modifier.width(8.dp))
// Disconnects every server and terminates the process. (A bare "/quit" in a
// channel window only disconnects that window's server.)
TextButton(onClick = onExitApp) {
@@ -187,6 +195,25 @@ fun MainScreen(
)
}
if (showFontDialog) {
DialogWindow(
onCloseRequest = { showFontDialog = false },
title = "wIRC main font",
state = rememberDialogState(size = DpSize(300.dp, 360.dp)),
resizable = true
) {
MaterialTheme(colorScheme = colorScheme) {
Surface {
Column(modifier = Modifier.fillMaxSize().padding(8.dp).verticalScroll(rememberScrollState())) {
Text("Server messages font:", color = textColor, style = MaterialTheme.typography.bodySmall)
Spacer(Modifier.height(4.dp))
FontPickerList(displaySettings.fontId, textColor, onFontChange)
}
}
}
}
}
if (showAddDialog) {
ServerEditDialog(
existing = editingServer,