mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09: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" : "纯净"
|
"display_name_zh_CN" : "纯净"
|
||||||
},
|
},
|
||||||
"palette" : {
|
"palette" : {
|
||||||
|
"bg3_0" : "#bbbbbb",
|
||||||
"bg3_1" : "#c0c0c0",
|
"bg3_1" : "#c0c0c0",
|
||||||
"bg3_2" : "#cdcdcd",
|
"bg3_2" : "#cdcdcd",
|
||||||
"bg3_3" : "#d2d2d2",
|
"bg3_3" : "#d2d2d2",
|
||||||
@ -37,7 +38,7 @@
|
|||||||
"fg15_3" : "#b0b0b0",
|
"fg15_3" : "#b0b0b0",
|
||||||
"fg15_4" : "#7a7a7a",
|
"fg15_4" : "#7a7a7a",
|
||||||
"fg15_5" : "#222222",
|
"fg15_5" : "#222222",
|
||||||
"bg11" : "#6dafff"
|
"bg11" : "#1976d2"
|
||||||
},
|
},
|
||||||
"base" : {
|
"base" : {
|
||||||
"normal" : {
|
"normal" : {
|
||||||
@ -85,7 +86,7 @@
|
|||||||
"border" : "@base#master#bg"
|
"border" : "@base#master#bg"
|
||||||
},
|
},
|
||||||
"selection" : {
|
"selection" : {
|
||||||
"fg" : "@palette#fg3_5",
|
"fg" : "@palette#bg3_6",
|
||||||
"bg" : "@palette#bg11"
|
"bg" : "@palette#bg11"
|
||||||
},
|
},
|
||||||
"selected" : {
|
"selected" : {
|
||||||
@ -474,12 +475,12 @@
|
|||||||
"bg" : "transparent"
|
"bg" : "transparent"
|
||||||
},
|
},
|
||||||
"handle" : {
|
"handle" : {
|
||||||
"bg" : "@palette#bg3_4",
|
"bg" : "@palette#bg3_2",
|
||||||
"hover" : {
|
"hover" : {
|
||||||
"bg" : "@palette#bg3_3"
|
"bg" : "@palette#bg3_1"
|
||||||
},
|
},
|
||||||
"pressed" : {
|
"pressed" : {
|
||||||
"bg" : "@palette#bg3_2"
|
"bg" : "@palette#bg3_0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -201,8 +201,8 @@ div.vx-plantuml-graph {
|
|||||||
}
|
}
|
||||||
|
|
||||||
::selection {
|
::selection {
|
||||||
background-color: #6dafff;
|
background-color: #1976d2;
|
||||||
color: #222222;
|
color: #f1f1f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
@ -239,15 +239,15 @@ div.vx-plantuml-graph {
|
|||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
/* This selector affects the styling of draggable element of the scollbar */
|
/* This selector affects the styling of draggable element of the scollbar */
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #dadada;
|
background-color: #cdcdcd;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
::-webkit-scrollbar-thumb:hover {
|
||||||
background-color: #d2d2d2;
|
background-color: #c0c0c0;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:active {
|
::-webkit-scrollbar-thumb:active {
|
||||||
background-color: #cdcdcd;
|
background-color: #bbbbbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-button:horizontal:increment {
|
::-webkit-scrollbar-button:horizontal:increment {
|
||||||
|
@ -134,10 +134,13 @@ void NodeInfoWidget::setNode(const Node *p_node)
|
|||||||
|
|
||||||
auto createdTime = Utils::dateTimeString(m_node->getCreatedTimeUtc().toLocalTime());
|
auto createdTime = Utils::dateTimeString(m_node->getCreatedTimeUtc().toLocalTime());
|
||||||
m_createdDateTimeLabel->setText(createdTime);
|
m_createdDateTimeLabel->setText(createdTime);
|
||||||
|
|
||||||
|
if (m_modifiedDateTimeLabel) {
|
||||||
auto modifiedTime = Utils::dateTimeString(m_node->getModifiedTimeUtc().toLocalTime());
|
auto modifiedTime = Utils::dateTimeString(m_node->getModifiedTimeUtc().toLocalTime());
|
||||||
m_modifiedDateTimeLabel->setText(modifiedTime);
|
m_modifiedDateTimeLabel->setText(modifiedTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void NodeInfoWidget::setupFileTypeComboBox(QWidget *p_parent)
|
void NodeInfoWidget::setupFileTypeComboBox(QWidget *p_parent)
|
||||||
{
|
{
|
||||||
@ -167,6 +170,7 @@ void NodeInfoWidget::setupFileTypeComboBox(QWidget *p_parent)
|
|||||||
|
|
||||||
if (!newName.isEmpty()) {
|
if (!newName.isEmpty()) {
|
||||||
m_nameLineEdit->setText(newName);
|
m_nameLineEdit->setText(newName);
|
||||||
|
emit inputEdited();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -753,7 +753,7 @@ bool ViewArea::close(bool p_force)
|
|||||||
return closeIf(p_force, [](ViewWindow *p_win) {
|
return closeIf(p_force, [](ViewWindow *p_win) {
|
||||||
Q_UNUSED(p_win);
|
Q_UNUSED(p_win);
|
||||||
return true;
|
return true;
|
||||||
});
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewArea::setupShortcuts()
|
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) {
|
return closeIf(p_force, [p_node](ViewWindow *p_win) {
|
||||||
auto buffer = p_win->getBuffer();
|
auto buffer = p_win->getBuffer();
|
||||||
return buffer->match(p_node) || buffer->isChildOf(p_node);
|
return buffer->match(p_node) || buffer->isChildOf(p_node);
|
||||||
});
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViewArea::close(const Notebook *p_notebook, bool p_force)
|
bool ViewArea::close(const Notebook *p_notebook, bool p_force)
|
||||||
@ -816,7 +816,7 @@ void ViewArea::checkCurrentViewWindowChange()
|
|||||||
emit currentViewWindowChanged();
|
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.
|
// Go through all hidden workspace. Use current split to show the workspace.
|
||||||
if (m_workspaces.size() > m_splits.size()) {
|
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);
|
m_currentSplit->setWorkspace(nullptr);
|
||||||
|
|
||||||
|
// Remove this workspace if it is empty.
|
||||||
|
if (ws->m_viewWindows.isEmpty()) {
|
||||||
removeWorkspace(ws);
|
removeWorkspace(ws);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Restore.
|
// Restore.
|
||||||
m_currentSplit->setWorkspace(currentWorkspace);
|
m_currentSplit->setWorkspace(currentWorkspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT(m_workspaces.size() == m_splits.size());
|
|
||||||
|
|
||||||
// Go through all splits.
|
// Go through all splits.
|
||||||
// Collect the ViewWindows first. Collect empty splits.
|
// Collect the ViewWindows first. Collect empty splits.
|
||||||
QVector<ViewWindow *> wins;
|
QVector<ViewWindow *> wins;
|
||||||
QVector<ViewSplit *> emptySplits;
|
QVector<ViewSplit *> emptySplits;
|
||||||
for (auto split : m_splits) {
|
for (auto split : m_splits) {
|
||||||
if (split->getViewWindowCount() == 0) {
|
if (p_closeEmptySplit && split->getViewWindowCount() == 0) {
|
||||||
emptySplits.push_back(split);
|
emptySplits.push_back(split);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,9 @@ namespace vnotex
|
|||||||
bool close(Node *p_node, bool p_force);
|
bool close(Node *p_node, bool p_force);
|
||||||
|
|
||||||
// Go through all ViewWindows and judge whether to close it by @p_func.
|
// 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();
|
void checkCurrentViewWindowChange();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user