mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-01 14:22:51 -08:00
Improve related splitter UX
* Prevent group pane from being hidden just by dragging. Introduce new View menu setting to hide the group pane. * Replace the preview panel "close" icon with a "collapse down" icon making the intention clearer. * Better organize the view menu
This commit is contained in:
1 parent
8acc54225d
commit
feafceca57
11 files changed
+52
-3
No files matched your search
@@ -128,6 +128,8 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
|
||||
m_groupSplitter->setStretchFactor(0, 100);
|
||||
m_groupSplitter->setStretchFactor(1, 0);
|
||||
m_groupSplitter->setSizes({1, 1});
|
||||
// Initial visibility based on config value
|
||||
m_groupSplitter->setVisible(!config()->get(Config::GUI_HideGroupPanel).toBool());
|
||||
|
||||
auto rightHandSideWidget = new QWidget(m_mainSplitter);
|
||||
auto rightHandSideVBox = new QVBoxLayout();
|
||||
@@ -140,12 +142,11 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
|
||||
rightHandSideWidget->setLayout(rightHandSideVBox);
|
||||
m_entryView = new EntryView(rightHandSideWidget);
|
||||
|
||||
m_mainSplitter->setChildrenCollapsible(true);
|
||||
m_mainSplitter->setChildrenCollapsible(false);
|
||||
m_mainSplitter->addWidget(m_groupSplitter);
|
||||
m_mainSplitter->addWidget(rightHandSideWidget);
|
||||
m_mainSplitter->setStretchFactor(0, 0);
|
||||
m_mainSplitter->setStretchFactor(1, 100);
|
||||
m_mainSplitter->setCollapsible(1, false);
|
||||
m_mainSplitter->setSizes({1, 1});
|
||||
|
||||
m_previewSplitter->setOrientation(Qt::Vertical);
|
||||
@@ -217,6 +218,7 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
|
||||
connect(m_databaseOpenWidget, SIGNAL(dialogFinished(bool)), SLOT(loadDatabase(bool)));
|
||||
connect(this, SIGNAL(currentChanged(int)), SLOT(emitCurrentModeChanged()));
|
||||
connect(this, SIGNAL(requestGlobalAutoType(const QString&)), parent, SLOT(performGlobalAutoType(const QString&)));
|
||||
connect(config(), &Config::changed, this, &DatabaseWidget::onConfigChanged);
|
||||
// clang-format on
|
||||
|
||||
connectDatabaseSignals();
|
||||
@@ -408,6 +410,15 @@ void DatabaseWidget::setSplitterSizes(const QHash<Config::ConfigKey, QList<int>>
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::onConfigChanged(Config::ConfigKey key)
|
||||
{
|
||||
if (key == Config::GUI_HideGroupPanel) {
|
||||
// Toggle the group splitter visibility and reset the size
|
||||
m_groupSplitter->setVisible(!config()->get(Config::GUI_HideGroupPanel).toBool());
|
||||
setSplitterSizes({{Config::GUI_SplitterState, QList<int>({})}});
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::setSearchStringForAutoType(const QString& search)
|
||||
{
|
||||
m_searchStringForAutoType = search;
|
||||
|
||||
Reference in new issue
Block a user