refine macOS and release v3.0.0-beta.1 (#1594)

* refine macos

* release v3.0.0-beta.1
This commit is contained in:
Le Tan 2020-12-13 04:28:42 -08:00 committed by GitHub
parent 847e3d621d
commit c95e850bb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 40 additions and 17 deletions

View File

@ -10,7 +10,7 @@ on:
workflow_dispatch: workflow_dispatch:
env: env:
VNOTE_VER: 3.0.0 VNOTE_VER: 3.0.0-beta.1
jobs: jobs:
build-linux: build-linux:

View File

@ -10,7 +10,7 @@ on:
workflow_dispatch: workflow_dispatch:
env: env:
VNOTE_VER: 3.0.0 VNOTE_VER: 3.0.0-beta.1
jobs: jobs:
build-linux: build-linux:

View File

@ -10,7 +10,7 @@ on:
workflow_dispatch: workflow_dispatch:
env: env:
VNOTE_VER: 3.0.0 VNOTE_VER: 3.0.0-beta.1
jobs: jobs:
build: build:

20
scripts/update_version.py Normal file
View File

@ -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='')

View File

@ -72,7 +72,16 @@ void SessionConfig::loadCore(const QJsonObject &p_session)
m_openGL = stringToOpenGL(option); m_openGL = stringToOpenGL(option);
} }
if (coreObj.contains(QStringLiteral("system_title_bar"))) {
m_systemTitleBarEnabled = readBool(coreObj, 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 QJsonObject SessionConfig::saveCore() const

View File

@ -3,7 +3,7 @@
"metadata" : { "metadata" : {
"//comment": "When releasing new version, please go through the following configs to check if override is needed.", "//comment": "When releasing new version, please go through the following configs to check if override is needed.",
"//Comment": "markdown_editor#override_viewer_resource", "//Comment": "markdown_editor#override_viewer_resource",
"version" : "3.0.0" "version" : "3.0.0-beta.1"
}, },
"core" : { "core" : {
"theme" : "native", "theme" : "native",

View File

@ -60,7 +60,7 @@
"markdown-editor-styles" : { "markdown-editor-styles" : {
"Text" : { "Text" : {
"//comment" : "Support a list of fonts separated by ,", "//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 "font-size" : 12
} }
}, },

View File

@ -1,6 +1,6 @@
body { body {
margin: 0 auto; 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; color: #222222;
line-height: 1.5; line-height: 1.5;
padding: 15px; padding: 15px;

View File

@ -14,7 +14,7 @@ class NodeLineMapper {
this.headingNodes = []; this.headingNodes = [];
this.smoothAnchorScroll = true; this.smoothAnchorScroll = false;
window.addEventListener( window.addEventListener(
'scroll', 'scroll',

View File

@ -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) void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, bool p_meta)
{ {
Q_UNUSED(p_shift); Q_UNUSED(p_shift);
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
bool macCtrl = p_meta;
#else
Q_UNUSED(p_meta); Q_UNUSED(p_meta);
bool macCtrl = false;
#endif
switch (p_key) { switch (p_key) {
// Esc // Esc
case 27: case 27:
@ -332,7 +326,7 @@ void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, boo
// Dash // Dash
case 189: case 189:
if (p_ctrl || macCtrl) { if (p_ctrl) {
// Zoom out. // Zoom out.
zoomOut(); zoomOut();
} }
@ -340,7 +334,7 @@ void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, boo
// Equal // Equal
case 187: case 187:
if (p_ctrl || macCtrl) { if (p_ctrl) {
// Zoom in. // Zoom in.
zoomIn(); zoomIn();
} }
@ -348,7 +342,7 @@ void MarkdownViewer::handleWebKeyPress(int p_key, bool p_ctrl, bool p_shift, boo
// 0 // 0
case 48: case 48:
if (p_ctrl || macCtrl) { if (p_ctrl) {
// Recover zoom. // Recover zoom.
restoreZoom(); restoreZoom();
} }