From 19c946c705122506ab6dd50f8a10ed95a774ba15 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Mon, 31 Aug 2026 12:15:11 -0400 Subject: [PATCH] fix(mining): pin the console so Block Height / Sync Progress stay inside it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The metrics kept sliding out of the bottom of the node console. The cause was free height, not margins: the top bar's RowLayout, its right-hand ColumnLayout and the console RowLayout all defaulted to fillHeight, so any slack in the window was absorbed by the console. The 102px bezel graphic stretched with it (topright_middle is a 1px column tiled horizontally), the label/value rows — two fillHeight halves — spread apart with it, and a full block height ended up rendered below the panel. The three `Layout.preferredHeight: parent.height` bindings, which asked a layout child for its own parent layout's height, made the result depend on resolution order. Now the top bar, its column and the console are pinned to their design heights (128 / 128 / 102), the bezel images take the literal 102, and the metrics are a plain anchored Row of two Columns at a fixed offset inside the console's dark interior band (rows 7..94 of the bezel) with the value directly under its label. Verified by headless qml6 render at 1029x{500,597,650,720,800} with a full-width block height ("369918/369918"): the pair sits in the same place at every height and stays inside the panel. --- src/assets/qml/mining.qml | 150 ++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 89 deletions(-) diff --git a/src/assets/qml/mining.qml b/src/assets/qml/mining.qml index f75bcc30..391e0915 100644 --- a/src/assets/qml/mining.qml +++ b/src/assets/qml/mining.qml @@ -92,7 +92,9 @@ Rectangle { RowLayout { spacing: 0 Layout.fillWidth: true + Layout.fillHeight: false Layout.preferredHeight: 128 + Layout.maximumHeight: 128 Image { source: "qrc:/mining/topleft.png" @@ -212,7 +214,9 @@ Rectangle { ColumnLayout { Layout.fillWidth: true + Layout.fillHeight: false Layout.preferredHeight: 128 + Layout.maximumHeight: 128 spacing: 0 Image { @@ -233,130 +237,98 @@ Rectangle { RowLayout { spacing: 0 - Layout.fillHeight: true + // Pinned: with fillHeight the console absorbed any slack in the + // top bar, stretching the bezel and dropping the metrics out of + // the bottom of the panel. + Layout.fillHeight: false Layout.preferredHeight: 102 + Layout.minimumHeight: 102 + Layout.maximumHeight: 102 Image { Layout.preferredWidth: 5 - Layout.preferredHeight: parent.height + Layout.preferredHeight: 102 // console bezel is a fixed 102px tall source: "qrc:/mining/topright_left.png" smooth: false } Image { Layout.fillWidth: true - Layout.preferredHeight: parent.height + Layout.preferredHeight: 102 // console bezel is a fixed 102px tall source: "qrc:/mining/topright_middle.png" fillMode: Image.TileHorizontally smooth: false - RowLayout { + // The node metrics live inside the console's dark interior + // band (rows 7..94 of the 102px topright_middle bezel). + // Anchored at a fixed offset with fixed row heights so a + // long value (a full block height) can never be pushed + // out of the bottom of the console. + Row { anchors.top: parent.top + anchors.topMargin: 16 anchors.left: parent.left - anchors.leftMargin: 6 + anchors.leftMargin: 14 anchors.right: parent.right anchors.rightMargin: 8 - anchors.topMargin: 4 + height: 52 + spacing: 24 - height: 60 - spacing: 16 + Column { + width: Math.min(260, (parent.width - parent.spacing) / 2) + spacing: 2 - ColumnLayout { - Layout.minimumWidth: 200 - Layout.maximumWidth: 260 - Layout.fillHeight: true - - Rectangle { - Layout.fillWidth: true - Layout.fillHeight: true - color: "transparent" - - Text { - text: "Block Height" - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.leftMargin: 8 - font.pointSize: 14 - font.family: comicMonoBold.name; - color: "#41FF00" - antialiasing: false - } + Text { + text: "Block Height" + font.pointSize: 14 + font.family: comicMonoBold.name; + color: "#41FF00" + antialiasing: false } - Rectangle { - Layout.fillWidth: true - Layout.fillHeight: true - color: "transparent" - - Text { - id: heightText - text: "-" - anchors.fill: parent - anchors.leftMargin: 8 - anchors.topMargin: 2 - verticalAlignment: Text.AlignTop - fontSizeMode: Text.HorizontalFit - minimumPointSize: 9 - font.pointSize: 14 - font.family: comicMonoBold.name; - color: "#41FF00" - antialiasing: false - } + Text { + id: heightText + text: "-" + width: parent.width + fontSizeMode: Text.HorizontalFit + minimumPointSize: 9 + font.pointSize: 14 + font.family: comicMonoBold.name; + color: "#41FF00" + antialiasing: false } } - ColumnLayout { - Layout.minimumWidth: 200 - Layout.maximumWidth: 260 - Layout.fillHeight: true + Column { + width: Math.min(260, (parent.width - parent.spacing) / 2) + spacing: 2 - Rectangle { - Layout.fillWidth: true - Layout.fillHeight: true - color: "transparent" - - Text { - text: "Sync Progress" - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.leftMargin: 8 - font.pointSize: 14 - font.family: comicMonoBold.name; - color: "#41FF00" - antialiasing: false - } + Text { + text: "Sync Progress" + font.pointSize: 14 + font.family: comicMonoBold.name; + color: "#41FF00" + antialiasing: false } - Rectangle { - Layout.fillWidth: true - Layout.fillHeight: true - color: "transparent" - - Text { - id: syncPctText - text: "-" - anchors.top: parent.top - anchors.topMargin: 2 - anchors.left: parent.left - anchors.leftMargin: 8 - font.pointSize: 14 - font.family: comicMonoBold.name; - color: "#41FF00" - antialiasing: false - } + Text { + id: syncPctText + text: "-" + width: parent.width + fontSizeMode: Text.HorizontalFit + minimumPointSize: 9 + font.pointSize: 14 + font.family: comicMonoBold.name; + color: "#41FF00" + antialiasing: false } } - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } } } Image { Layout.preferredWidth: 5 - Layout.preferredHeight: parent.height + Layout.preferredHeight: 102 // console bezel is a fixed 102px tall source: "qrc:/mining/topright_right.png" smooth: false }