diff --git a/libs/vtextedit b/libs/vtextedit
index 47902164..922084a3 160000
--- a/libs/vtextedit
+++ b/libs/vtextedit
@@ -1 +1 @@
-Subproject commit 47902164b0e11f5debfb40deb649d451d650660f
+Subproject commit 922084a388e1f135e25297ba84a9d0ca0078ed06
diff --git a/src/data/core/core.qrc b/src/data/core/core.qrc
index 554554cd..b4168dce 100644
--- a/src/data/core/core.qrc
+++ b/src/data/core/core.qrc
@@ -21,6 +21,7 @@
icons/menu.svg
icons/settings.svg
icons/view.svg
+ icons/inplace_preview_editor.svg
icons/settings_menu.svg
icons/whatsthis.svg
icons/help_menu.svg
diff --git a/src/data/core/icons/inplace_preview_editor.svg b/src/data/core/icons/inplace_preview_editor.svg
new file mode 100644
index 00000000..176f2647
--- /dev/null
+++ b/src/data/core/icons/inplace_preview_editor.svg
@@ -0,0 +1,15 @@
+
+
+
+
diff --git a/src/widgets/historypanel.cpp b/src/widgets/historypanel.cpp
index c3918093..9dd35b9f 100644
--- a/src/widgets/historypanel.cpp
+++ b/src/widgets/historypanel.cpp
@@ -6,6 +6,7 @@
#include
#include
+#include
#include
#include
#include
@@ -215,9 +216,12 @@ void HistoryPanel::addItem(const HistoryItemFull &p_hisItem)
item->setText(PathUtils::fileNameCheap(p_hisItem.m_item.m_path));
item->setData(Qt::UserRole, p_hisItem.m_item.m_path);
if (p_hisItem.m_notebookName.isEmpty()) {
- item->setToolTip(p_hisItem.m_item.m_path);
+ item->setToolTip(tr("%1\n%2").arg(p_hisItem.m_item.m_path,
+ Utils::dateTimeString(p_hisItem.m_item.m_lastAccessedTimeUtc.toLocalTime())));
} else {
- item->setToolTip(tr("[%1] %2").arg(p_hisItem.m_notebookName, p_hisItem.m_item.m_path));
+ item->setToolTip(tr("[%1] %2\n%3").arg(p_hisItem.m_notebookName,
+ p_hisItem.m_item.m_path,
+ Utils::dateTimeString(p_hisItem.m_item.m_lastAccessedTimeUtc.toLocalTime())));
}
}
diff --git a/src/widgets/markdownviewwindow.cpp b/src/widgets/markdownviewwindow.cpp
index 0d77413e..be1afe79 100644
--- a/src/widgets/markdownviewwindow.cpp
+++ b/src/widgets/markdownviewwindow.cpp
@@ -250,6 +250,8 @@ void MarkdownViewWindow::setupToolBar()
auto toolBar = createToolBar(this);
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
+ const auto &markdownEditorConfig = editorConfig.getMarkdownEditorConfig();
+
const int iconSize = editorConfig.getToolBarIconSize();
toolBar->setIconSize(QSize(iconSize, iconSize));
@@ -266,6 +268,16 @@ void MarkdownViewWindow::setupToolBar()
addAction(toolBar, ViewWindowToolBarHelper::SectionNumber);
+ {
+ auto act = addAction(toolBar, ViewWindowToolBarHelper::InplacePreview);
+ connect(act, &QAction::triggered,
+ this, [this, act](bool p_checked) {
+ if (!isReadMode()) {
+ m_editor->setInplacePreviewEnabled(p_checked);
+ }
+ });
+ }
+
addAction(toolBar, ViewWindowToolBarHelper::TypeHeading);
addAction(toolBar, ViewWindowToolBarHelper::TypeBold);
addAction(toolBar, ViewWindowToolBarHelper::TypeItalic);
diff --git a/src/widgets/viewwindow.cpp b/src/widgets/viewwindow.cpp
index 9af9e94d..90c0bb21 100644
--- a/src/widgets/viewwindow.cpp
+++ b/src/widgets/viewwindow.cpp
@@ -441,6 +441,16 @@ QAction *ViewWindow::addAction(QToolBar *p_toolBar, ViewWindowToolBarHelper::Act
break;
}
+ case ViewWindowToolBarHelper::InplacePreview:
+ {
+ act = ViewWindowToolBarHelper::addAction(p_toolBar, p_action);
+ connect(this, &ViewWindow::modeChanged,
+ this, [this, act]() {
+ act->setEnabled(inModeCanInsert() && getBuffer());
+ });
+ break;
+ }
+
default:
Q_ASSERT(false);
break;
diff --git a/src/widgets/viewwindowtoolbarhelper.cpp b/src/widgets/viewwindowtoolbarhelper.cpp
index 416f3b28..ab437485 100644
--- a/src/widgets/viewwindowtoolbarhelper.cpp
+++ b/src/widgets/viewwindowtoolbarhelper.cpp
@@ -351,6 +351,15 @@ QAction *ViewWindowToolBarHelper::addAction(QToolBar *p_tb, Action p_action)
break;
}
+ case Action::InplacePreview:
+ {
+ act = p_tb->addAction(ToolBarHelper::generateIcon("inplace_preview_editor.svg"),
+ ViewWindow::tr("Toggle In-Place Preview"));
+ act->setCheckable(true);
+ act->setChecked(true);
+ break;
+ }
+
default:
Q_ASSERT(false);
break;
diff --git a/src/widgets/viewwindowtoolbarhelper.h b/src/widgets/viewwindowtoolbarhelper.h
index 78f1d172..385fdbf1 100644
--- a/src/widgets/viewwindowtoolbarhelper.h
+++ b/src/widgets/viewwindowtoolbarhelper.h
@@ -43,7 +43,8 @@ namespace vnotex
Attachment,
Outline,
FindAndReplace,
- SectionNumber
+ SectionNumber,
+ InplacePreview
};
static QAction *addAction(QToolBar *p_tb, Action p_action);