diff options
author | Simon Rettberg | 2015-02-02 17:15:17 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-02-02 17:15:17 +0100 |
commit | 571c10c49f3b3046bb40245d2d44861706819f16 (patch) | |
tree | dd5fa0b914428946f24df1b3e89b6f98da910eae /src | |
parent | Make window move to z-order bottom at startup (diff) | |
download | vmchooser2-571c10c49f3b3046bb40245d2d44861706819f16.tar.gz vmchooser2-571c10c49f3b3046bb40245d2d44861706819f16.tar.xz vmchooser2-571c10c49f3b3046bb40245d2d44861706819f16.zip |
Resize window on resolution change
Diffstat (limited to 'src')
-rw-r--r-- | src/dialog.cpp | 2 | ||||
-rw-r--r-- | src/globals.cpp | 2 | ||||
-rw-r--r-- | src/globals.h | 2 | ||||
-rw-r--r-- | src/main.cpp | 1 |
4 files changed, 7 insertions, 0 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp index 6104e22..c54dbb5 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -277,6 +277,8 @@ void Dialog::onCenterTimer() { QRect desktopRect = QApplication::desktop()->availableGeometry(this); QPoint center = desktopRect.center(); if (center != oldCenter_) { + if (_fullscreen) + this->resize(desktopRect.width(), desktopRect.height()); this->move(center.x() - this->width() / 2, center.y() - this->height() / 2); oldCenter_ = center; } diff --git a/src/globals.cpp b/src/globals.cpp index c6d3d6d..3fed150 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -32,6 +32,8 @@ const QString news_backup_filename("/tmp/vmchooser2/vmchooser2_news.xml"); QString urlBase; +bool _fullscreen = false; + bool myLessThan(Session* a, Session* b) { return *a < *b; } diff --git a/src/globals.h b/src/globals.h index c0d09d3..b943238 100644 --- a/src/globals.h +++ b/src/globals.h @@ -52,6 +52,8 @@ extern const QString news_backup_filename; extern QString urlBase; +extern bool _fullscreen; + bool myLessThan(Session* a, Session* b); #endif diff --git a/src/main.cpp b/src/main.cpp index bc8d508..b3dbce1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -231,6 +231,7 @@ int main(int argc, char *argv[]) { if (size == "fullscreen") { width = desktopRect.width(); height = desktopRect.height(); + _fullscreen = true; } w.resize(width, height); |