diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 39eaecab..a40617ac 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - VNOTE_VER: 3.0.0 + VNOTE_VER: 3.0.0-beta.1 jobs: build-linux: diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index f5e0b015..eb35604c 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - VNOTE_VER: 3.0.0 + VNOTE_VER: 3.0.0-beta.1 jobs: build-linux: diff --git a/.github/workflows/ci-win.yml b/.github/workflows/ci-win.yml index 03d0d92e..ce8c2cb1 100644 --- a/.github/workflows/ci-win.yml +++ b/.github/workflows/ci-win.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - VNOTE_VER: 3.0.0 + VNOTE_VER: 3.0.0-beta.1 jobs: build: diff --git a/scripts/update_version.py b/scripts/update_version.py new file mode 100644 index 00000000..0b3be32c --- /dev/null +++ b/scripts/update_version.py @@ -0,0 +1,20 @@ +import fileinput +import sys +import re + +if len(sys.argv) < 2: + print("Please provide a new version string!") + exit + +newVersion = sys.argv[1] +print("New version: {0}".format(newVersion)) + +# vnotex.json +regExp = re.compile('(\\s+)"version" : "\\S+"') +for line in fileinput.input(['src/data/core/vnotex.json'], inplace = True): + print(regExp.sub('\\1"version" : "' + newVersion + '"', line), end='') + +# ci-xxx.yml +regExp = re.compile('(\\s+)VNOTE_VER: \\S+') +for line in fileinput.input(['.github/workflows/ci-win.yml', '.github/workflows/ci-linux.yml', '.github/workflows/ci-macos.yml'], inplace = True): + print(regExp.sub('\\1VNOTE_VER: ' + newVersion, line), end='') diff --git a/src/core/sessionconfig.cpp b/src/core/sessionconfig.cpp index b6f678d4..29c6df46 100644 --- a/src/core/sessionconfig.cpp +++ b/src/core/sessionconfig.cpp @@ -72,7 +72,16 @@ void SessionConfig::loadCore(const QJsonObject &p_session) m_openGL = stringToOpenGL(option); } - m_systemTitleBarEnabled = readBool(coreObj, QStringLiteral("system_title_bar")); + if (coreObj.contains(QStringLiteral("system_title_bar"))) { + m_systemTitleBarEnabled = readBool(coreObj, QStringLiteral("system_title_bar")); + } else { + // Enable system title bar on macOS by default. +#if defined(Q_OS_MACOS) || defined(Q_OS_MAC) + m_systemTitleBarEnabled = true; +#else + m_systemTitleBarEnabled = false; +#endif + } } QJsonObject SessionConfig::saveCore() const diff --git a/src/data/core/vnotex.json b/src/data/core/vnotex.json index 9e3646e0..50633d6c 100644 --- a/src/data/core/vnotex.json +++ b/src/data/core/vnotex.json @@ -3,7 +3,7 @@ "metadata" : { "//comment": "When releasing new version, please go through the following configs to check if override is needed.", "//Comment": "markdown_editor#override_viewer_resource", - "version" : "3.0.0" + "version" : "3.0.0-beta.1" }, "core" : { "theme" : "native", diff --git a/src/data/extra/themes/native/text-editor.theme b/src/data/extra/themes/native/text-editor.theme index 015c1c18..39e48f10 100644 --- a/src/data/extra/themes/native/text-editor.theme +++ b/src/data/extra/themes/native/text-editor.theme @@ -60,7 +60,7 @@ "markdown-editor-styles" : { "Text" : { "//comment" : "Support a list of fonts separated by ,", - "font-family" : "Hiragino Sans GB, 冬青黑体, YaHei Consolas Hybrid, Microsoft YaHei, 微软雅黑, Microsoft YaHei UI, WenQuanYi Micro Hei, 文泉驿雅黑, Dengxian, 等线体, STXihei, 华文细黑, Liberation Sans, Droid Sans, NSimSun, 新宋体, SimSun, 宋体, Verdana, Helvetica, sans-serif, Tahoma, Arial, Geneva, Georgia, Times New Roman", + "font-family" : "冬青黑体, YaHei Consolas Hybrid, Microsoft YaHei, 微软雅黑, Microsoft YaHei UI, WenQuanYi Micro Hei, 文泉驿雅黑, Dengxian, 等线体, STXihei, 华文细黑, Liberation Sans, Droid Sans, NSimSun, 新宋体, SimSun, 宋体, Verdana, Helvetica, sans-serif, Tahoma, Arial, Geneva, Georgia, Times New Roman", "font-size" : 12 } }, diff --git a/src/data/extra/themes/native/web.css b/src/data/extra/themes/native/web.css index ffc5a773..01572634 100644 --- a/src/data/extra/themes/native/web.css +++ b/src/data/extra/themes/native/web.css @@ -1,6 +1,6 @@ body { margin: 0 auto; - font-family: "Segoe UI", Helvetica, sans-serif, Tahoma, Arial, Geneva, Georgia, Palatino, "Times New Roman", "Hiragino Sans GB", "冬青黑体", "YaHei Consolas Hybrid", "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "WenQuanYi Micro Hei", "文泉驿雅黑", Dengxian, "等线体", STXihei, "华文细黑", "Liberation Sans", "Droid Sans", NSimSun, "新宋体", SimSun, "宋体"; + font-family: "Segoe UI", Helvetica, sans-serif, Tahoma, Arial, Geneva, Georgia, Palatino, "Times New Roman", "冬青黑体", "YaHei Consolas Hybrid", "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "WenQuanYi Micro Hei", "文泉驿雅黑", Dengxian, "等线体", STXihei, "华文细黑", "Liberation Sans", "Droid Sans", NSimSun, "新宋体", SimSun, "宋体"; color: #222222; line-height: 1.5; padding: 15px; diff --git a/src/data/extra/web/js/nodelinemapper.js b/src/data/extra/web/js/nodelinemapper.js index f1f2a549..cd3d357b 100644 --- a/src/data/extra/web/js/nodelinemapper.js +++ b/src/data/extra/web/js/nodelinemapper.js @@ -14,7 +14,7 @@ class NodeLineMapper { this.headingNodes = []; - this.smoothAnchorScroll = true; + this.smoothAnchorScroll = false; window.addEventListener( 'scroll', diff --git a/src/widgets/editors/markdownviewer.cpp b/src/widgets/editors/markdownviewer.cpp index 3dd8e58a..68c6f42d 100644 --- a/src/widgets/editors/markdownviewer.cpp +++ b/src/widgets/editors/markdownviewer.cpp @@ -318,13 +318,7 @@ void MarkdownViewer::hideUnusedActions(QMenu *p_menu) void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, bool p_meta) { Q_UNUSED(p_shift); -#if defined(Q_OS_MACOS) || defined(Q_OS_MAC) - bool macCtrl = p_meta; -#else Q_UNUSED(p_meta); - bool macCtrl = false; -#endif - switch (p_key) { // Esc case 27: @@ -332,7 +326,7 @@ void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, boo // Dash case 189: - if (p_ctrl || macCtrl) { + if (p_ctrl) { // Zoom out. zoomOut(); } @@ -340,7 +334,7 @@ void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, boo // Equal case 187: - if (p_ctrl || macCtrl) { + if (p_ctrl) { // Zoom in. zoomIn(); } @@ -348,7 +342,7 @@ void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, boo // 0 case 48: - if (p_ctrl || macCtrl) { + if (p_ctrl) { // Recover zoom. restoreZoom(); }