Qt main window: use save/restoreGeometry() instead of just height/width
This commit is contained in:
parent
25a5f3a7e0
commit
6df64eb9f9
@ -75,9 +75,7 @@ void rwSettings(bool writing)
|
||||
LOGDEB1("rwSettings: write " << writing << "\n");
|
||||
if (writing && !havereadsettings)
|
||||
return;
|
||||
QSettings settings("Recoll.org", "recoll");
|
||||
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Int, 0);
|
||||
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Int, 0);
|
||||
QSettings settings;
|
||||
SETTING_RW(prefs.showmode, "/Recoll/geometry/showmode", Int, 0);
|
||||
SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Int, 0);
|
||||
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0);
|
||||
|
||||
@ -64,8 +64,6 @@ class PrefsPack {
|
||||
QString qssFile;
|
||||
QString snipCssFile;
|
||||
QString queryStemLang;
|
||||
int mainwidth;
|
||||
int mainheight;
|
||||
enum ShowMode {SHOW_NORMAL, SHOW_MAX, SHOW_FULL};
|
||||
int showmode{SHOW_NORMAL};
|
||||
int pvwidth; // Preview window geom
|
||||
|
||||
@ -375,11 +375,6 @@ int main(int argc, char **argv)
|
||||
RclMain w;
|
||||
mainWindow = &w;
|
||||
|
||||
if (prefs.mainwidth > 100) {
|
||||
QSize s(prefs.mainwidth, prefs.mainheight);
|
||||
mainWindow->resize(s);
|
||||
}
|
||||
|
||||
string dbdir = theconfig->getDbDir();
|
||||
if (dbdir.empty()) {
|
||||
QMessageBox::critical(
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
#include <QThread>
|
||||
#include <QProgressDialog>
|
||||
#include <QToolBar>
|
||||
#include <QSettings>
|
||||
|
||||
#include "recoll.h"
|
||||
#include "log.h"
|
||||
@ -435,6 +436,8 @@ void RclMain::init()
|
||||
onSortDataChanged(m_sortspec);
|
||||
emit sortDataChanged(m_sortspec);
|
||||
}
|
||||
QSettings settings;
|
||||
restoreGeometry(settings.value("/Recoll/geometry/maingeom").toByteArray());
|
||||
|
||||
enableTrayIcon(prefs.showTrayIcon);
|
||||
|
||||
@ -660,12 +663,10 @@ void RclMain::fileExit()
|
||||
if (m_trayicon) {
|
||||
m_trayicon->setVisible(false);
|
||||
}
|
||||
// Don't save geometry if we're currently fullscreened
|
||||
if (!isFullScreen() && !isMaximized()) {
|
||||
prefs.mainwidth = width();
|
||||
prefs.mainheight = height();
|
||||
}
|
||||
|
||||
|
||||
QSettings settings;
|
||||
settings.setValue("/Recoll/geometry/maingeom", saveGeometry());
|
||||
|
||||
prefs.toolArea = toolBarArea(m_toolsTB);
|
||||
prefs.resArea = toolBarArea(m_resTB);
|
||||
restable->saveColState();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user