mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 06:19:52 +08:00
small fixes about panel
1. Focus to the input when activating the Search panel; 2. Expand content area won't activate all the panels.
This commit is contained in:
parent
c8f2ba00ed
commit
8955afae66
@ -18,6 +18,7 @@
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QWindowStateChangeEvent>
|
||||
#include <QTimer>
|
||||
#include <QBitArray>
|
||||
|
||||
#include "toolbox.h"
|
||||
#include "notebookexplorer.h"
|
||||
@ -478,9 +479,27 @@ void MainWindow::resetStateAndGeometry()
|
||||
|
||||
void MainWindow::setContentAreaExpanded(bool p_expanded)
|
||||
{
|
||||
for (auto dock : m_docks) {
|
||||
if (!dock->isFloating()) {
|
||||
dock->setVisible(!p_expanded);
|
||||
static QBitArray dockStateCache(m_docks.size(), false);
|
||||
|
||||
if (p_expanded) {
|
||||
// Store the state and hide.
|
||||
for (int i = 0; i < m_docks.size(); ++i) {
|
||||
if (m_docks[i]->isFloating()) {
|
||||
dockStateCache[i] = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
dockStateCache[i] = m_docks[i]->isVisible();
|
||||
m_docks[i]->setVisible(false);
|
||||
}
|
||||
} else {
|
||||
// Restore the state.
|
||||
for (int i = 0; i < m_docks.size(); ++i) {
|
||||
if (m_docks[i]->isFloating()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
m_docks[i]->setVisible(dockStateCache[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ void SearchPanel::setupUI()
|
||||
m_keywordComboBox->setLineEdit(WidgetsFactory::createLineEdit(mainWidget));
|
||||
m_keywordComboBox->lineEdit()->setProperty(PropertyDefs::c_embeddedLineEdit, true);
|
||||
m_keywordComboBox->completer()->setCaseSensitivity(Qt::CaseSensitive);
|
||||
setFocusProxy(m_keywordComboBox);
|
||||
connect(m_keywordComboBox->lineEdit(), &QLineEdit::returnPressed,
|
||||
this, [this]() {
|
||||
m_searchBtn->animateClick();
|
||||
|
Loading…
x
Reference in New Issue
Block a user