diff --git a/src/data/extra/themes/pure/palette.json b/src/data/extra/themes/pure/palette.json index 1aa6ea22..6265268d 100644 --- a/src/data/extra/themes/pure/palette.json +++ b/src/data/extra/themes/pure/palette.json @@ -13,6 +13,7 @@ "display_name_zh_CN" : "纯净" }, "palette" : { + "bg3_0" : "#bbbbbb", "bg3_1" : "#c0c0c0", "bg3_2" : "#cdcdcd", "bg3_3" : "#d2d2d2", @@ -37,7 +38,7 @@ "fg15_3" : "#b0b0b0", "fg15_4" : "#7a7a7a", "fg15_5" : "#222222", - "bg11" : "#6dafff" + "bg11" : "#1976d2" }, "base" : { "normal" : { @@ -85,7 +86,7 @@ "border" : "@base#master#bg" }, "selection" : { - "fg" : "@palette#fg3_5", + "fg" : "@palette#bg3_6", "bg" : "@palette#bg11" }, "selected" : { @@ -474,12 +475,12 @@ "bg" : "transparent" }, "handle" : { - "bg" : "@palette#bg3_4", + "bg" : "@palette#bg3_2", "hover" : { - "bg" : "@palette#bg3_3" + "bg" : "@palette#bg3_1" }, "pressed" : { - "bg" : "@palette#bg3_2" + "bg" : "@palette#bg3_0" } } }, diff --git a/src/data/extra/themes/pure/web.css b/src/data/extra/themes/pure/web.css index 3e127617..8227e978 100644 --- a/src/data/extra/themes/pure/web.css +++ b/src/data/extra/themes/pure/web.css @@ -201,8 +201,8 @@ div.vx-plantuml-graph { } ::selection { - background-color: #6dafff; - color: #222222; + background-color: #1976d2; + color: #f1f1f1; } ::-webkit-scrollbar { @@ -239,15 +239,15 @@ div.vx-plantuml-graph { ::-webkit-scrollbar-thumb { /* This selector affects the styling of draggable element of the scollbar */ border: none; - background-color: #dadada; + background-color: #cdcdcd; } ::-webkit-scrollbar-thumb:hover { - background-color: #d2d2d2; + background-color: #c0c0c0; } ::-webkit-scrollbar-thumb:active { - background-color: #cdcdcd; + background-color: #bbbbbb; } ::-webkit-scrollbar-button:horizontal:increment { diff --git a/src/widgets/dialogs/nodeinfowidget.cpp b/src/widgets/dialogs/nodeinfowidget.cpp index 1e452342..bfe888e5 100644 --- a/src/widgets/dialogs/nodeinfowidget.cpp +++ b/src/widgets/dialogs/nodeinfowidget.cpp @@ -134,8 +134,11 @@ void NodeInfoWidget::setNode(const Node *p_node) auto createdTime = Utils::dateTimeString(m_node->getCreatedTimeUtc().toLocalTime()); m_createdDateTimeLabel->setText(createdTime); - auto modifiedTime = Utils::dateTimeString(m_node->getModifiedTimeUtc().toLocalTime()); - m_modifiedDateTimeLabel->setText(modifiedTime); + + if (m_modifiedDateTimeLabel) { + auto modifiedTime = Utils::dateTimeString(m_node->getModifiedTimeUtc().toLocalTime()); + m_modifiedDateTimeLabel->setText(modifiedTime); + } } } @@ -167,6 +170,7 @@ void NodeInfoWidget::setupFileTypeComboBox(QWidget *p_parent) if (!newName.isEmpty()) { m_nameLineEdit->setText(newName); + emit inputEdited(); } } diff --git a/src/widgets/viewarea.cpp b/src/widgets/viewarea.cpp index 1013b443..ac4c33d4 100644 --- a/src/widgets/viewarea.cpp +++ b/src/widgets/viewarea.cpp @@ -753,7 +753,7 @@ bool ViewArea::close(bool p_force) return closeIf(p_force, [](ViewWindow *p_win) { Q_UNUSED(p_win); return true; - }); + }, true); } void ViewArea::setupShortcuts() @@ -797,7 +797,7 @@ bool ViewArea::close(Node *p_node, bool p_force) return closeIf(p_force, [p_node](ViewWindow *p_win) { auto buffer = p_win->getBuffer(); return buffer->match(p_node) || buffer->isChildOf(p_node); - }); + }, false); } bool ViewArea::close(const Notebook *p_notebook, bool p_force) @@ -816,7 +816,7 @@ void ViewArea::checkCurrentViewWindowChange() emit currentViewWindowChanged(); } -bool ViewArea::closeIf(bool p_force, const ViewSplit::ViewWindowSelector &p_func) +bool ViewArea::closeIf(bool p_force, const ViewSplit::ViewWindowSelector &p_func, bool p_closeEmptySplit) { // Go through all hidden workspace. Use current split to show the workspace. if (m_workspaces.size() > m_splits.size()) { @@ -851,23 +851,24 @@ bool ViewArea::closeIf(bool p_force, const ViewSplit::ViewWindowSelector &p_func } } - // Remove this workspace. m_currentSplit->setWorkspace(nullptr); - removeWorkspace(ws); + + // Remove this workspace if it is empty. + if (ws->m_viewWindows.isEmpty()) { + removeWorkspace(ws); + } } // Restore. m_currentSplit->setWorkspace(currentWorkspace); } - Q_ASSERT(m_workspaces.size() == m_splits.size()); - // Go through all splits. // Collect the ViewWindows first. Collect empty splits. QVector wins; QVector emptySplits; for (auto split : m_splits) { - if (split->getViewWindowCount() == 0) { + if (p_closeEmptySplit && split->getViewWindowCount() == 0) { emptySplits.push_back(split); continue; } diff --git a/src/widgets/viewarea.h b/src/widgets/viewarea.h index afd073dd..a546fa61 100644 --- a/src/widgets/viewarea.h +++ b/src/widgets/viewarea.h @@ -190,7 +190,9 @@ namespace vnotex bool close(Node *p_node, bool p_force); // Go through all ViewWindows and judge whether to close it by @p_func. - bool closeIf(bool p_force, const ViewSplit::ViewWindowSelector &p_func); + bool closeIf(bool p_force, + const ViewSplit::ViewWindowSelector &p_func, + bool p_closeEmptySplit); void checkCurrentViewWindowChange();