mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bug fix
* Properties on folder node causes crash; * Workspace crash on renaming node; * New note name conflicts;
This commit is contained in:
parent
bb1e23a2dd
commit
00b8995fc8
@ -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"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -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 {
|
||||
|
@ -134,10 +134,13 @@ void NodeInfoWidget::setNode(const Node *p_node)
|
||||
|
||||
auto createdTime = Utils::dateTimeString(m_node->getCreatedTimeUtc().toLocalTime());
|
||||
m_createdDateTimeLabel->setText(createdTime);
|
||||
|
||||
if (m_modifiedDateTimeLabel) {
|
||||
auto modifiedTime = Utils::dateTimeString(m_node->getModifiedTimeUtc().toLocalTime());
|
||||
m_modifiedDateTimeLabel->setText(modifiedTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NodeInfoWidget::setupFileTypeComboBox(QWidget *p_parent)
|
||||
{
|
||||
@ -167,6 +170,7 @@ void NodeInfoWidget::setupFileTypeComboBox(QWidget *p_parent)
|
||||
|
||||
if (!newName.isEmpty()) {
|
||||
m_nameLineEdit->setText(newName);
|
||||
emit inputEdited();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
// 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<ViewWindow *> wins;
|
||||
QVector<ViewSplit *> emptySplits;
|
||||
for (auto split : m_splits) {
|
||||
if (split->getViewWindowCount() == 0) {
|
||||
if (p_closeEmptySplit && split->getViewWindowCount() == 0) {
|
||||
emptySplits.push_back(split);
|
||||
continue;
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user