From 02c3277356271bc9f2969cd56ee654e95ef9ce9e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 18 Oct 2026 11:14:08 +0200 Subject: fix(rofi): compact confirm and screenshot cards, centre glyphs The confirm and screenshot menus split the monitor into two half-screen buttons with a glyph sized from the monitor height. They are now a fixed 368px card centred on the scrim, two 150px buttons at 72pt, so the scripts no longer compute a glyph size. Glyphs in all three menus sat right of centre: common.rasi's element spacing still reserved a gap for the hidden icon. Elements now hold element-text only. The power menu's greeting ignored horizontal-align, so spacers either side centre it. Co-Authored-By: Claude Opus 5.5 --- rofi/udt/confirm.rasi | 12 +++++------ rofi/udt/powermenu.rasi | 9 +++++++-- rofi/udt/screenshot.rasi | 52 ++++++++++++++++++++++++++++++++++++------------ 3 files changed, 51 insertions(+), 22 deletions(-) (limited to 'rofi') diff --git a/rofi/udt/confirm.rasi b/rofi/udt/confirm.rasi index 1b288ee..242c86a 100644 --- a/rofi/udt/confirm.rasi +++ b/rofi/udt/confirm.rasi @@ -3,16 +3,14 @@ * Copyright (C) 2026 Danilo M. * Licensed under the GNU General Public License v2 only. * - * Used by the power menu's confirmation step. The screenshot menu's layout, - * two half-monitor buttons on the scrim, with the question above them. The - * glyph size comes from the script with -theme-str, as it does there. + * Used by the power menu's confirmation step. The screenshot menu's card, + * with the question above the two buttons. */ @import "screenshot.rasi" -mainbox { - children: [ dummy, message, listview, dummy ]; - spacing: 48px; +card { + children: [ message, listview ]; } /* The question, "Simu Sicuri?", passed by the script with -mesg. */ @@ -23,7 +21,7 @@ message { } textbox { - font: "Noto Sans Bold 28"; + font: "Noto Sans Bold 18"; text-color: @text; horizontal-align: 0.5; } diff --git a/rofi/udt/powermenu.rasi b/rofi/udt/powermenu.rasi index 92c5b07..93a833e 100644 --- a/rofi/udt/powermenu.rasi +++ b/rofi/udt/powermenu.rasi @@ -66,11 +66,13 @@ inputbar { expand: false; background-color: transparent; padding: 0; - children: [ prompt ]; + children: [ dummy, prompt, dummy ]; } +/* prompt ignores horizontal-align and draws at its own width, so the + * spacers either side centre it. */ prompt { - expand: true; + expand: false; font: "Noto Sans Bold 28"; text-color: @text; horizontal-align: 0.5; @@ -86,7 +88,10 @@ listview { spacing: 24px; } +/* Text only: common.rasi's element spacing still reserves a gap for the + * icon, which pushed the glyph off centre. */ element { + children: [ element-text ]; padding: 24px 0px; border-radius: 12px; horizontal-align: 0.5; diff --git a/rofi/udt/screenshot.rasi b/rofi/udt/screenshot.rasi index 0eff248..8748628 100644 --- a/rofi/udt/screenshot.rasi +++ b/rofi/udt/screenshot.rasi @@ -1,12 +1,10 @@ /* - * udt screenshot layout: two fullscreen buttons, whole screen or area. + * udt screenshot layout: a compact two-button card, whole screen or area. * Copyright (C) 2026 Danilo M. * Licensed under the GNU General Public License v2 only. * - * Each option takes half the monitor, so the choice is one glance and one - * click. Cells fill whatever monitor rofi opens on; the glyph size cannot be - * a percentage in rofi, so the script passes it with -theme-str, derived from - * the focused monitor's height. The font below is only the fallback. + * The window stays fullscreen for the scrim; the buttons sit on a fixed-size + * card centred on it, so they read the same on every monitor. */ @import "common.rasi" @@ -17,13 +15,37 @@ window { background-color: @scrim; border: 0; border-radius: 0; - padding: 6%; + padding: 0; } -/* rofi sizes a row by its text, not by the space left, so spacers above and - * below centre the row instead of leaving it pinned to the top edge. */ +/* rofi has no centring property, so spacers on both axes hold the card in + * the middle: mainbox centres a column horizontally, column centres the card + * vertically. */ mainbox { - children: [ dummy, listview, dummy ]; + orientation: horizontal; + children: [ dummy, column, dummy ]; +} + +/* A horizontal box sizes children by their own width, and listview reports + * none, so the card's width is spelled out: two 150px buttons, 16px apart, + * plus 24px padding and 2px border each side. */ +column { + expand: false; + width: 368px; + orientation: vertical; + children: [ dummy, card, dummy ]; +} + +card { + expand: false; + orientation: vertical; + children: [ listview ]; + spacing: 20px; + padding: 24px; + background-color: @base; + border: 2px; + border-color: @accent; + border-radius: 18px; } dummy { @@ -37,17 +59,21 @@ listview { fixed-height: true; fixed-columns: true; flow: horizontal; - spacing: 4%; + spacing: 16px; } +/* Text only: common.rasi's element spacing still reserves a gap for the + * icon, which pushed the glyph off centre. */ element { - padding: 80px 0px; - border-radius: 24px; + children: [ element-text ]; + width: 150px; + padding: 28px 0px; + border-radius: 12px; background-color: @surface0; } element-text { - font: "Inconsolata Nerd Font Mono 160"; + font: "Inconsolata Nerd Font Mono 72"; horizontal-align: 0.5; vertical-align: 0.5; text-color: inherit; -- cgit v1.2.3