desktop: be smarter about filling splitters

On state change, the splitters were completely emptied and
refilled. Instead try to reuse already existing splitter
slots. This reduces annoying flickering.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-27 22:06:41 +01:00 committed by Dirk Hohndel
parent c584e28f2e
commit aefbde93ce
2 changed files with 53 additions and 29 deletions

View file

@ -184,7 +184,6 @@ private:
void saveSplitterSizes();
void restoreSplitterSizes();
void updateLastUsedDir(const QString &s);
void clearSplitters();
bool filesAsArguments;
UpdateManager *updateManager;
std::unique_ptr<LocationInformationWidget> diveSiteEdit;
@ -220,7 +219,8 @@ private:
Quadrants applicationState[(size_t)ApplicationState::Count];
static void addWidgets(const Quadrant &);
bool userMayChangeAppState() const;
void setQuadrantWidget(const Quadrant &q, QSplitter &splitter);
void setQuadrantWidget(QSplitter &splitter, const Quadrant &q, int pos);
void setQuadrantWidgets(QSplitter &splitter, const Quadrant &left, const Quadrant &right);
void registerApplicationState(ApplicationState state, Quadrants q);
QMenu *connections;