mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-03 04:15:37 -04:00
Make sure the window doesn't grow out of QScreen bounds.
This commit is contained in:
parent
734b606dee
commit
006f0e3eef
1 changed files with 7 additions and 3 deletions
|
@ -24,7 +24,9 @@
|
||||||
#include "utils/CalamaresStyle.h"
|
#include "utils/CalamaresStyle.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
|
#include <QDesktopWidget>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
|
||||||
|
@ -34,9 +36,11 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
||||||
// Hide close button
|
// Hide close button
|
||||||
setWindowFlags( Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint );
|
setWindowFlags( Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint );
|
||||||
|
|
||||||
setMinimumSize( 1010, 600 );
|
setMinimumSize( 1010, 560 );
|
||||||
int w = qMax( CalamaresUtils::defaultFontHeight() * 60, 1010 );
|
QSize availableSize = qApp->desktop()->screenGeometry( this ).size();
|
||||||
int h = qMax( CalamaresUtils::defaultFontHeight() * 36, 600 );
|
int w = qBound( 1010, CalamaresUtils::defaultFontHeight() * 60, availableSize.width() );
|
||||||
|
int h = qBound( 560, CalamaresUtils::defaultFontHeight() * 36, availableSize.height() );
|
||||||
|
|
||||||
cDebug() << "Proposed window size:" << w << h;
|
cDebug() << "Proposed window size:" << w << h;
|
||||||
resize( w, h );
|
resize( w, h );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue