mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 14:29:54 +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 <QSystemTrayIcon>
|
||||||
#include <QWindowStateChangeEvent>
|
#include <QWindowStateChangeEvent>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QBitArray>
|
||||||
|
|
||||||
#include "toolbox.h"
|
#include "toolbox.h"
|
||||||
#include "notebookexplorer.h"
|
#include "notebookexplorer.h"
|
||||||
@ -478,9 +479,27 @@ void MainWindow::resetStateAndGeometry()
|
|||||||
|
|
||||||
void MainWindow::setContentAreaExpanded(bool p_expanded)
|
void MainWindow::setContentAreaExpanded(bool p_expanded)
|
||||||
{
|
{
|
||||||
for (auto dock : m_docks) {
|
static QBitArray dockStateCache(m_docks.size(), false);
|
||||||
if (!dock->isFloating()) {
|
|
||||||
dock->setVisible(!p_expanded);
|
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->setLineEdit(WidgetsFactory::createLineEdit(mainWidget));
|
||||||
m_keywordComboBox->lineEdit()->setProperty(PropertyDefs::c_embeddedLineEdit, true);
|
m_keywordComboBox->lineEdit()->setProperty(PropertyDefs::c_embeddedLineEdit, true);
|
||||||
m_keywordComboBox->completer()->setCaseSensitivity(Qt::CaseSensitive);
|
m_keywordComboBox->completer()->setCaseSensitivity(Qt::CaseSensitive);
|
||||||
|
setFocusProxy(m_keywordComboBox);
|
||||||
connect(m_keywordComboBox->lineEdit(), &QLineEdit::returnPressed,
|
connect(m_keywordComboBox->lineEdit(), &QLineEdit::returnPressed,
|
||||||
this, [this]() {
|
this, [this]() {
|
||||||
m_searchBtn->animateClick();
|
m_searchBtn->animateClick();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user