diff options
author | Jesse Smith <jessefrgsmith@yahoo.ca> | 2014-09-15 19:45:53 -0300 |
---|---|---|
committer | Jesse Smith <jessefrgsmith@yahoo.ca> | 2014-09-15 19:45:53 -0300 |
commit | 7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f (patch) | |
tree | c8163ad1f3458dae66f8e0e905fcd7258d8b898c /lumina-fm/MainUI.cpp | |
parent | Select the first exec entry from a .desktop file rather than the last. (diff) | |
parent | Update the Lumina user button a bit: (diff) | |
download | lumina-7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f.tar.gz lumina-7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f.tar.bz2 lumina-7cd91c78c5219a2391a3c4a9a1c2e446989d4c2f.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r-- | lumina-fm/MainUI.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index ad73b407..5fa0a30d 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -12,6 +12,11 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ //Be careful about the QSettings setup, it must match the lumina-desktop setup QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina"); settings = new QSettings( QSettings::UserScope, "LuminaDE", "lumina-fm", this); + //Reset the UI to the previously used size (if possible) + int height = settings->value("geometry/height",-1).toInt(); + if(height>100 && height <= QApplication::desktop()->availableGeometry(this).height()){ this->resize(this->width(), height); } + int width = settings->value("geometry/width",-1).toInt(); + if(width>100 && width <= QApplication::desktop()->availableGeometry(this).width()){ this->resize(width, this->height() ); } //initialize the non-ui widgets tabBar = new QTabBar(this); tabBar->setTabsClosable(true); @@ -1222,3 +1227,9 @@ void MainUI::PasteItems(){ } } + +void MainUI::resizeEvent(QResizeEvent *event){ + //Save the new size internally + settings->setValue("geometry/height", event->size().height()); + settings->setValue("geometry/width", event->size().width()); +} |