diff --git a/plagin_tokens/src/config.ts b/plagin_tokens/src/config.ts index 78fa0fb..1042a73 100644 --- a/plagin_tokens/src/config.ts +++ b/plagin_tokens/src/config.ts @@ -50,13 +50,13 @@ const DEFAULT_STYLE: MacOSHudStyle = { fg: "#e8f3ff", accent: "#22c55e", title: "Token Speed", - width: 360, - height: 180, - bigFont: 30, - smallFont: 12, + width: 300, + height: 140, + bigFont: 22, + smallFont: 10, resizable: true, - minWidth: 260, - minHeight: 130, + minWidth: 240, + minHeight: 105, } function parseStyle(raw: string | undefined): MacOSHudStyle { diff --git a/plagin_tokens/src/popup.ts b/plagin_tokens/src/popup.ts index 68dd4b3..01d3211 100644 --- a/plagin_tokens/src/popup.ts +++ b/plagin_tokens/src/popup.ts @@ -13,13 +13,13 @@ const DEFAULT_STYLE: MacOSHudStyle = { fg: "#e8f3ff", accent: "#22c55e", title: "Token Speed", - width: 360, - height: 180, - bigFont: 30, - smallFont: 12, + width: 300, + height: 140, + bigFont: 22, + smallFont: 10, resizable: true, - minWidth: 260, - minHeight: 130, + minWidth: 240, + minHeight: 105, } export interface MacOSPopupOptions { @@ -102,7 +102,7 @@ export function buildHudScript( "var inspectParent = function(pid) {", ' try { osa.doShellScript("ps -p " + pid + " >/dev/null 2>&1"); return true } catch (e) { return false }', "};", - 'var framePath = $.NSHomeDirectory().stringByAppendingPathComponent(".plagin-tokens-hud-frame.json");', + 'var framePath = $.NSHomeDirectory().stringByAppendingPathComponent(".plagin-tokens-hud-frame-v2.json");', 'function decodedStyle(hex) {', ' var clean = String(hex || "").replace("#", "");', ' if (clean.length === 3) {', @@ -160,8 +160,8 @@ export function buildHudScript( "var base = " + JSON.stringify(baseUrl) + ";", "var parentPid = " + parentPid + ";", "var style = " + JSON.stringify(style) + ";", - "var width = Number(style.width) || 360;", - "var height = Number(style.height) || 180;", + "var width = Number(style.width) || 300;", + "var height = Number(style.height) || 140;", "var defaultRect = $.NSMakeRect(0, 0, width, height);", "var saved = savedFrameValue();", "if (validFrame(saved)) {", @@ -178,7 +178,7 @@ export function buildHudScript( "window.level = $.NSFloatingWindowLevel;", "window.title = style.title;", "window.collectionBehavior = (1 << 0) | (1 << 8) | (1 << 4);", - "window.minSize = $.NSMakeSize(Math.max(120, Number(style.minWidth) || 220), Math.max(90, Number(style.minHeight) || 110));", + "window.minSize = $.NSMakeSize(Math.max(110, Number(style.minWidth) || 240), Math.max(80, Number(style.minHeight) || 105));", "if (validFrame(saved)) {", " window.setFrameDisplay(startRect, true);", "}", @@ -187,15 +187,15 @@ export function buildHudScript( "window.titlebarAppearsTransparent = false;", 'var delegate = $.TokenSpeedWindowDelegate.alloc.init;', "window.delegate = delegate;", - 'var big = $.NSTextField.alloc.initWithFrame($.NSMakeRect(14, height - 54, width - 28, 44));', + 'var big = $.NSTextField.alloc.initWithFrame($.NSMakeRect(10, height - 36, width - 20, 32));', "big.editable = false; big.bordered = false; big.drawsBackground = false; big.alignment = 1;", - 'big.font = $.NSFont.boldSystemFontOfSize(Number(style.bigFont) || 30);', + 'big.font = $.NSFont.boldSystemFontOfSize(Number(style.bigFont) || 22);', "big.textColor = decodedStyle(style.accent);", 'var small = $.NSTextField.alloc.initWithFrame(', " $.NSMakeRect(14, 14, Math.max(120, width - 28), Math.max(40, height - 70)),", ");", "small.editable = false; small.bordered = false; small.drawsBackground = false;", - 'small.font = $.NSFont.systemFontOfSize(Number(style.smallFont) || 12);', + 'small.font = $.NSFont.systemFontOfSize(Number(style.smallFont) || 10);', "small.textColor = decodedStyle(style.fg);", "small.lineBreakMode = 0;", "window.contentView.addSubview(big);", @@ -214,8 +214,8 @@ export function buildHudScript( " var size = viewFrame.size;", " var frameWidth = Number(size.width) || width;", " var frameHeight = Number(size.height) || height;", - ' big.frame = $.NSMakeRect(14, Math.max(8, frameHeight - 54), Math.max(10, frameWidth - 28), 44);', - ' small.frame = $.NSMakeRect(14, 14, Math.max(10, frameWidth - 28), Math.max(24, frameHeight - 74));', + ' big.frame = $.NSMakeRect(10, Math.max(8, frameHeight - 36), Math.max(10, frameWidth - 20), 32);', + ' small.frame = $.NSMakeRect(10, 10, Math.max(10, frameWidth - 20), Math.max(24, frameHeight - 46));', "}", "layout();", "while (true) {",