From 60aecaf0b85c22f516e00b12f1e8ced46ce8d54d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 8 May 2020 10:20:59 +0200 Subject: [PATCH] [calamares] Fix height of the navigation bar in QML - If the QML navigation panel sets a height, use that - If it doesn't, use 48px (which *may* make sense, but like many screen dimensions in Calamares doesn't take HiDPI into account) - Give the demo QML an explicit height of 48 --- src/calamares/CalamaresWindow.cpp | 9 ++++++++- src/calamares/calamares-navigation.qml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index 84dd35e55..06a31a0e9 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -221,7 +222,13 @@ CalamaresWindow::getQmlNavigation( QWidget* parent ) w->setResizeMode( QQuickWidget::SizeRootObjectToView ); w->setSource( QUrl( CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-navigation" ) ) ) ); - w->setMinimumHeight( 30 ); // matchine the default widgets version + + // If the QML itself sets a height, use that, otherwise go to 48 pixels + // which seems to match what the widget navigation would use for height + // (with *my* specific screen, style, etc. so YMMV). + qreal minimumHeight = qBound( qreal( 16 ), w->rootObject() ? w->rootObject()->height() : 48, qreal( 64 ) ); + w->setMinimumHeight( int( minimumHeight ) ); + return w; } diff --git a/src/calamares/calamares-navigation.qml b/src/calamares/calamares-navigation.qml index c7cd91835..6b356218d 100644 --- a/src/calamares/calamares-navigation.qml +++ b/src/calamares/calamares-navigation.qml @@ -8,10 +8,10 @@ import QtQuick.Layouts 1.3 Rectangle { id: navigationBar; color: Branding.styleString( Branding.SidebarBackground ); + height: 48; RowLayout { id: buttonBar - height: 64; anchors.fill: parent; Item