GUI: remember and manage maximized state
This commit is contained in:
parent
9a0ea1da06
commit
30d2c0f6c6
@ -79,6 +79,7 @@ void rwSettings(bool writing)
|
|||||||
QSettings settings("Recoll.org", "recoll");
|
QSettings settings("Recoll.org", "recoll");
|
||||||
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Int, 0);
|
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Int, 0);
|
||||||
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Int, 0);
|
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Int, 0);
|
||||||
|
SETTING_RW(prefs.maximized, "/Recoll/geometry/maximized", Bool, 0);
|
||||||
SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Int, 0);
|
SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Int, 0);
|
||||||
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0);
|
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0);
|
||||||
SETTING_RW(prefs.toolArea, "/Recoll/geometry/toolArea", Int, 0);
|
SETTING_RW(prefs.toolArea, "/Recoll/geometry/toolArea", Int, 0);
|
||||||
|
|||||||
@ -68,6 +68,7 @@ class PrefsPack {
|
|||||||
QString queryStemLang;
|
QString queryStemLang;
|
||||||
int mainwidth;
|
int mainwidth;
|
||||||
int mainheight;
|
int mainheight;
|
||||||
|
bool maximized{false};
|
||||||
int pvwidth; // Preview window geom
|
int pvwidth; // Preview window geom
|
||||||
int pvheight;
|
int pvheight;
|
||||||
int toolArea; // Area for "tools" toolbar
|
int toolArea; // Area for "tools" toolbar
|
||||||
|
|||||||
@ -375,7 +375,11 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
maybeOpenDb(reason);
|
maybeOpenDb(reason);
|
||||||
|
|
||||||
mainWindow->show();
|
if (prefs.maximized) {
|
||||||
|
mainWindow->showMaximized();
|
||||||
|
} else {
|
||||||
|
mainWindow->show();
|
||||||
|
}
|
||||||
QTimer::singleShot(0, mainWindow, SLOT(initDbOpen()));
|
QTimer::singleShot(0, mainWindow, SLOT(initDbOpen()));
|
||||||
|
|
||||||
// Connect exit handlers etc.. Beware, apparently this must come
|
// Connect exit handlers etc.. Beware, apparently this must come
|
||||||
|
|||||||
@ -646,10 +646,12 @@ void RclMain::fileExit()
|
|||||||
{
|
{
|
||||||
LOGDEB("RclMain: fileExit\n");
|
LOGDEB("RclMain: fileExit\n");
|
||||||
// Don't save geometry if we're currently fullscreened
|
// Don't save geometry if we're currently fullscreened
|
||||||
if (!isFullScreen()) {
|
if (!isFullScreen() && !isMaximized()) {
|
||||||
prefs.mainwidth = width();
|
prefs.mainwidth = width();
|
||||||
prefs.mainheight = height();
|
prefs.mainheight = height();
|
||||||
}
|
}
|
||||||
|
prefs.maximized = isMaximized();
|
||||||
|
|
||||||
prefs.toolArea = toolBarArea(m_toolsTB);
|
prefs.toolArea = toolBarArea(m_toolsTB);
|
||||||
prefs.resArea = toolBarArea(m_resTB);
|
prefs.resArea = toolBarArea(m_resTB);
|
||||||
restable->saveColState();
|
restable->saveColState();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user