summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2017-10-28 11:56:44 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2017-12-01 21:55:38 -0500
commitbda088d368bbe2ef05ede650dabb56ee46d008bc (patch)
treed8631d0f4f22cfb8de9214743e46fc3a9f55ca3c
parentc7fba3e3ad8c15230748c4021d21d3c9c1ec3f79 (diff)
squashme - window tweaks
-rw-r--r--src/calamares/CalamaresWindow.cpp22
-rw-r--r--src/calamares/CalamaresWindow.h6
2 files changed, 25 insertions, 3 deletions
diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp
index 25eb69539..9ddcd7739 100644
--- a/src/calamares/CalamaresWindow.cpp
+++ b/src/calamares/CalamaresWindow.cpp
@@ -34,6 +34,14 @@
#include <QLabel>
#include <QTreeView>
+
+const int CalamaresWindow::WindowMinW = 1010;
+const int CalamaresWindow::WindowMinH = 520;
+const int CalamaresWindow::SidebarW = 190;
+const int CalamaresWindow::LogoLabelW = 136;
+const int CalamaresWindow::LogoLabelH = 187;
+
+
CalamaresWindow::CalamaresWindow( QWidget* parent )
: QWidget( parent )
, m_debugWindow( nullptr )
@@ -52,6 +60,14 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
using CalamaresUtils::windowPreferredWidth;
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
+/*
+ setMinimumSize( WindowMinW, WindowMinH );
+ int requestedW = SidebarW + (CalamaresUtils::defaultFontHeight() * 50);
+ int requestedH = LogoLabelH + (CalamaresUtils::defaultFontHeight() * 32);
+ QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
+ int w = qBound( WindowMinW, requestedW, availableSize.width() );
+ int h = qBound( WindowMinH, requestedH, availableSize.height() );
+*/
cDebug() << "Available size" << availableSize;
@@ -76,11 +92,11 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
QBoxLayout* sideLayout = new QVBoxLayout;
sideBox->setLayout( sideLayout );
- sideBox->setFixedWidth( qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) );
+ //sideBox->setFixedWidth( qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) );
+ sideBox->setFixedWidth( SidebarW );
sideBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
QHBoxLayout* logoLayout = new QHBoxLayout;
-// sideLayout->addSpacing( 42 );
sideLayout->addLayout( logoLayout );
logoLayout->addStretch();
QLabel* logoLabel = new QLabel( sideBox );
@@ -95,7 +111,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
logoLabel->setPalette( plt );
}
logoLayout->setAlignment( Qt::AlignCenter );
- logoLabel->setFixedSize( 136, 187 );
+ logoLabel->setFixedSize( LogoLabelW, LogoLabelH );
logoLabel->setSizePolicy( QSizePolicy::Fixed , QSizePolicy::Fixed );
logoLabel->setPixmap( Calamares::Branding::instance()->
image( Calamares::Branding::ProductLogo,
diff --git a/src/calamares/CalamaresWindow.h b/src/calamares/CalamaresWindow.h
index 00f790f5a..29512a1e0 100644
--- a/src/calamares/CalamaresWindow.h
+++ b/src/calamares/CalamaresWindow.h
@@ -47,6 +47,12 @@ public slots:
void enlarge( QSize enlarge );
private:
+ static const int WindowMinW ;
+ static const int WindowMinH ;
+ static const int SidebarW ;
+ static const int LogoLabelW ;
+ static const int LogoLabelH ;
+
QPointer< Calamares::DebugWindow > m_debugWindow;
};