[calamares] Prefer to expand main panel
- Don't let the navigation items grow if they are QML (the Widget ones don't either) so the main panel takes most of the space.
This commit is contained in:
parent
ab7f6abf02
commit
a8463a8763
@ -184,10 +184,11 @@ CalamaresWindow::getWidgetNavigation( QWidget* parent )
|
|||||||
|
|
||||||
#ifdef WITH_QML
|
#ifdef WITH_QML
|
||||||
QWidget*
|
QWidget*
|
||||||
CalamaresWindow::getQmlSidebar( QWidget* parent, int )
|
CalamaresWindow::getQmlSidebar( QWidget* parent, int desiredWidth )
|
||||||
{
|
{
|
||||||
CalamaresUtils::registerQmlModels();
|
CalamaresUtils::registerQmlModels();
|
||||||
QQuickWidget* w = new QQuickWidget( parent );
|
QQuickWidget* w = new QQuickWidget( parent );
|
||||||
|
w->setFixedWidth( desiredWidth );
|
||||||
w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
||||||
w->setResizeMode( QQuickWidget::SizeRootObjectToView );
|
w->setResizeMode( QQuickWidget::SizeRootObjectToView );
|
||||||
w->setSource( QUrl(
|
w->setSource( QUrl(
|
||||||
@ -200,7 +201,7 @@ CalamaresWindow::getQmlNavigation( QWidget* parent )
|
|||||||
{
|
{
|
||||||
CalamaresUtils::registerQmlModels();
|
CalamaresUtils::registerQmlModels();
|
||||||
QQuickWidget* w = new QQuickWidget( parent );
|
QQuickWidget* w = new QQuickWidget( parent );
|
||||||
w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::MinimumExpanding );
|
||||||
w->setResizeMode( QQuickWidget::SizeRootObjectToView );
|
w->setResizeMode( QQuickWidget::SizeRootObjectToView );
|
||||||
w->setSource( QUrl(
|
w->setSource( QUrl(
|
||||||
CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-navigation" ) ) ) );
|
CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-navigation" ) ) ) );
|
||||||
@ -208,8 +209,11 @@ CalamaresWindow::getQmlNavigation( QWidget* parent )
|
|||||||
// If the QML itself sets a height, use that, otherwise go to 48 pixels
|
// 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
|
// which seems to match what the widget navigation would use for height
|
||||||
// (with *my* specific screen, style, etc. so YMMV).
|
// (with *my* specific screen, style, etc. so YMMV).
|
||||||
|
//
|
||||||
|
// Bound between (16, 64) with a default of 48.
|
||||||
qreal minimumHeight = qBound( qreal( 16 ), w->rootObject() ? w->rootObject()->height() : 48, qreal( 64 ) );
|
qreal minimumHeight = qBound( qreal( 16 ), w->rootObject() ? w->rootObject()->height() : 48, qreal( 64 ) );
|
||||||
w->setMinimumHeight( int( minimumHeight ) );
|
w->setMinimumHeight( int( minimumHeight ) );
|
||||||
|
w->setFixedHeight( int( minimumHeight ) );
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user