From 6c7fa9a91941f52bcf2922c0741902329a07495e Mon Sep 17 00:00:00 2001 From: katesalazar Date: Sun, 3 Oct 2021 15:15:06 +0200 Subject: [PATCH 1/2] Fixed width for BlockCounter Without this, BlockCounter is continuously changing width unnecessarily. With a fixed width BlockCounter, visual output doesn't change more than strictly necessary. At current window min size, this width fits up to 9 digits, which is enough to fit all of main, test and signature networks. You can spot the difference these changes add by creating two dummy data directories and bootstrapping one with this change and bootstrapping the other one without this change. --- src/qml/pages/stub.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qml/pages/stub.qml b/src/qml/pages/stub.qml index ee30cb735f..ddd1ce6218 100644 --- a/src/qml/pages/stub.qml +++ b/src/qml/pages/stub.qml @@ -20,6 +20,7 @@ ApplicationWindow { id: blockCounter anchors.centerIn: parent height: parent.height / 3 + width: parent.width / 2.67 blockHeight: nodeModel.blockTipHeight } } From 46d499a3cb5c280c87e4489a590f4754be373caf Mon Sep 17 00:00:00 2001 From: katesalazar Date: Sun, 3 Oct 2021 15:48:41 +0200 Subject: [PATCH 2/2] Prevent BlockCounter label from overflowing Prevent BlockCounter label from spilling out of BlockCounter inner "black" content. This change was written on a laptop using a 1280x776 configuration (as reported by `xrandr`). To see this change in and out of action, it might be necessary not to simply rebuild, but also explicitly removing src/qml/qrc_bitcoin.cpp and/or src/qt/qrc_bitcoin.cpp. --- src/qml/components/BlockCounter.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/components/BlockCounter.qml b/src/qml/components/BlockCounter.qml index e23ba7b72d..b7abacb6a4 100644 --- a/src/qml/components/BlockCounter.qml +++ b/src/qml/components/BlockCounter.qml @@ -16,6 +16,6 @@ Label { padding: 16 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - font.pixelSize: height / 3 + font.pixelSize: (parent.height / 15 + parent.width / 15) / 2 text: blockHeight }