diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp index b13b3783..30d94b77 100644 --- a/src/qtgui/guiutils.cpp +++ b/src/qtgui/guiutils.cpp @@ -72,6 +72,8 @@ void rwSettings(bool writing) SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Int, 0); SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Int, 0); SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Int, 0); + SETTING_RW(prefs.toolArea, "/Recoll/geometry/toolArea", Int, 0); + SETTING_RW(prefs.resArea, "/Recoll/geometry/resArea", Int, 0); SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Int, 3); SETTING_RW(prefs.startWithAdvSearchOpen, "/Recoll/prefs/startWithAdvSearchOpen", Bool, false); diff --git a/src/qtgui/guiutils.h b/src/qtgui/guiutils.h index 2b232e10..be40c48a 100644 --- a/src/qtgui/guiutils.h +++ b/src/qtgui/guiutils.h @@ -68,6 +68,8 @@ class PrefsPack { int mainheight; int pvwidth; // Preview window geom int pvheight; + int toolArea; // Area for "tools" toolbar + int resArea; // Area for "results" toolbar int ssearchTyp; // Use single app (default: xdg-open), instead of per-mime settings bool useDesktopOpen; diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index 3431b6d5..1baa5a77 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -94,6 +94,18 @@ QString g_stringAllStem, g_stringNoStem; static const QKeySequence quitKeySeq("Ctrl+q"); static const QKeySequence closeKeySeq("Ctrl+w"); +static Qt::ToolBarArea int2area(int in) +{ + switch (in) { + case Qt::LeftToolBarArea: return Qt::LeftToolBarArea; + case Qt::RightToolBarArea: return Qt::RightToolBarArea; + case Qt::BottomToolBarArea: return Qt::BottomToolBarArea; + case Qt::TopToolBarArea: + default: + return Qt::TopToolBarArea; + } +} + void RclMain::init() { // This is just to get the common catg strings into the message file @@ -162,11 +174,11 @@ void RclMain::init() m_toolsTB->addAction(toolsAdvanced_SearchAction); m_toolsTB->addAction(toolsDoc_HistoryAction); m_toolsTB->addAction(toolsSpellAction); - this->addToolBar(Qt::TopToolBarArea, m_toolsTB); + this->addToolBar(int2area(prefs.toolArea), m_toolsTB); m_resTB = new QToolBar(this); m_resTB->setObjectName(QString::fromUtf8("m_resTB")); - this->addToolBar(Qt::TopToolBarArea, m_resTB); + this->addToolBar(int2area(prefs.resArea), m_resTB); // Document filter buttons and combobox // Combobox version of the document filter control @@ -630,6 +642,8 @@ void RclMain::fileExit() prefs.mainwidth = width(); prefs.mainheight = height(); } + prefs.toolArea = toolBarArea(m_toolsTB); + prefs.resArea = toolBarArea(m_resTB); restable->saveColState(); prefs.ssearchTyp = sSearch->searchTypCMB->currentIndex();