Snap windows to the desktop grid and to whole lines, font size picker (10 to 18), white text in settings dialogs, bump to 0.1.12
- After a move, windows snap to the Windows desktop icon grid; after a resize, the window height is trimmed so the scrollback ends on a whole line. - The font size slider is replaced by square 10 to 18 buttons. Sizes saved by the old slider round to the nearest picker size. - Settings and font dialogs always use white text, so a dark window text color no longer makes their labels invisible. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
026e349db8
commit
5bcd1a7bcd
@@ -10,6 +10,13 @@ import java.nio.file.Files
|
||||
import java.nio.file.StandardCopyOption
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
// Font sizes offered in the settings dialog (whole sizes only, same range as QuickClaude)
|
||||
const val MIN_FONT_SIZE = 10
|
||||
const val MAX_FONT_SIZE = 18
|
||||
|
||||
private fun pickerFontSize(size: Float): Float =
|
||||
Math.round(size).coerceIn(MIN_FONT_SIZE, MAX_FONT_SIZE).toFloat()
|
||||
|
||||
data class WindowDisplaySettings(
|
||||
val backgroundAlpha: Float = 0.85f, // 0f = fully transparent, 1f = fully opaque
|
||||
val textColorMircIndex: Int = 0, // index into the standard mIRC palette; 0 = white
|
||||
@@ -63,7 +70,7 @@ class WindowPrefsRepository(rootDir: File) {
|
||||
|
||||
fun setTextColorMircIndex(bufferKeyId: String, index: Int) = update(bufferKeyId) { it.copy(textColorMircIndex = index) }
|
||||
|
||||
fun setFontSize(bufferKeyId: String, fontSize: Float) = update(bufferKeyId) { it.copy(fontSize = fontSize) }
|
||||
fun setFontSize(bufferKeyId: String, fontSize: Float) = update(bufferKeyId) { it.copy(fontSize = pickerFontSize(fontSize)) }
|
||||
|
||||
fun setFontId(bufferKeyId: String, fontId: String) = update(bufferKeyId) { it.copy(fontId = fontId) }
|
||||
|
||||
@@ -109,7 +116,8 @@ class WindowPrefsRepository(rootDir: File) {
|
||||
stored[key] = WindowDisplaySettings(
|
||||
backgroundAlpha = o.optDouble("backgroundAlpha", 0.85).toFloat(),
|
||||
textColorMircIndex = o.optInt("textColorMircIndex", 0),
|
||||
fontSize = o.optDouble("fontSize", 14.0).toFloat(),
|
||||
// Sizes saved by the old slider (any value from 10 to 24) round to the nearest picker size
|
||||
fontSize = pickerFontSize(o.optDouble("fontSize", 14.0).toFloat()),
|
||||
fontId = o.optString("fontId", "monospace"),
|
||||
showUserList = o.optBoolean("showUserList", true),
|
||||
mentionHighlightColorArgb = o.optLong("mentionHighlightColorArgb", 0x40FFA500L).toInt(),
|
||||
|
||||
Reference in New Issue
Block a user