Skip to content

Commit 4663310

Browse files
committed
[GUI] Min window size
1 parent 5c76d51 commit 4663310

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/qt/pivx/pivxgui.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#define BASE_WINDOW_WIDTH 1200
3333
#define BASE_WINDOW_HEIGHT 740
3434
#define BASE_WINDOW_MIN_HEIGHT 620
35+
#define BASE_WINDOW_MIN_WIDTH 1100
3536

3637

3738
const QString PIVXGUI::DEFAULT_WALLET = "~Default";
@@ -42,15 +43,16 @@ PIVXGUI::PIVXGUI(const NetworkStyle* networkStyle, QWidget* parent) :
4243

4344
/* Open CSS when configured */
4445
this->setStyleSheet(GUIUtil::loadStyleSheet());
45-
this->setMinimumSize(BASE_WINDOW_WIDTH, BASE_WINDOW_MIN_HEIGHT);
46+
this->setMinimumSize(BASE_WINDOW_MIN_WIDTH, BASE_WINDOW_MIN_HEIGHT);
4647

4748

4849
// Adapt screen size
4950
QRect rec = QApplication::desktop()->screenGeometry();
5051
int adaptedHeight = (rec.height() < BASE_WINDOW_HEIGHT) ? BASE_WINDOW_MIN_HEIGHT : BASE_WINDOW_HEIGHT;
52+
int adaptedWidth = (rec.width() < BASE_WINDOW_WIDTH) ? BASE_WINDOW_MIN_WIDTH : BASE_WINDOW_WIDTH;
5153
GUIUtil::restoreWindowGeometry(
5254
"nWindow",
53-
QSize(BASE_WINDOW_WIDTH, adaptedHeight),
55+
QSize(adaptedWidth, adaptedHeight),
5456
this
5557
);
5658

@@ -81,7 +83,7 @@ PIVXGUI::PIVXGUI(const NetworkStyle* networkStyle, QWidget* parent) :
8183
if(enableWallet){
8284

8385
QFrame* centralWidget = new QFrame(this);
84-
this->setMinimumWidth(BASE_WINDOW_WIDTH);
86+
this->setMinimumWidth(BASE_WINDOW_MIN_WIDTH);
8587
this->setMinimumHeight(BASE_WINDOW_MIN_HEIGHT);
8688
QHBoxLayout* centralWidgetLayouot = new QHBoxLayout();
8789
centralWidget->setLayout(centralWidgetLayouot);

0 commit comments

Comments
 (0)