- Selection style in mdhl does not work on macOS. Choose another Vim
visual line background.
- Disable multiple keyboard layout support on macOS.
- Make close_before_external_editor work when opening with default
program.
This commit is contained in:
Le Tan 2018-09-21 19:41:07 +08:00
parent 77dd8d0f32
commit 9b83d50116
9 changed files with 20 additions and 10 deletions

View File

@ -48,7 +48,7 @@ vim-insert-background: c5cae9
# [VNote] Vim normal mode cursor line background # [VNote] Vim normal mode cursor line background
vim-normal-background: e0e0e0 vim-normal-background: e0e0e0
# [VNote] Vim visual mode cursor line background # [VNote] Vim visual mode cursor line background
vim-visual-background: d3eafc vim-visual-background: ffe0b2
# [VNote] Vim replace mode cursor line background # [VNote] Vim replace mode cursor line background
vim-replace-background: f8bbd0 vim-replace-background: f8bbd0

View File

@ -7,7 +7,7 @@ mdhl_file=v_native.mdhl
css_file=v_native.css css_file=v_native.css
codeblock_css_file=v_native_codeblock.css codeblock_css_file=v_native_codeblock.css
mermaid_css_file=v_native_mermaid.css mermaid_css_file=v_native_mermaid.css
version=19 version=20
[phony] [phony]
; Abstract color attributes. ; Abstract color attributes.

View File

@ -49,7 +49,7 @@ vim-insert-background: c5cae9
# [VNote] Vim normal mode cursor line background # [VNote] Vim normal mode cursor line background
vim-normal-background: e0e0e0 vim-normal-background: e0e0e0
# [VNote] Vim visual mode cursor line background # [VNote] Vim visual mode cursor line background
vim-visual-background: d3eafc vim-visual-background: ffe0b2
# [VNote] Vim replace mode cursor line background # [VNote] Vim replace mode cursor line background
vim-replace-background: f8bbd0 vim-replace-background: f8bbd0

View File

@ -7,7 +7,7 @@ mdhl_file=v_pure.mdhl
css_file=v_pure.css css_file=v_pure.css
codeblock_css_file=v_pure_codeblock.css codeblock_css_file=v_pure_codeblock.css
mermaid_css_file=v_pure_mermaid.css mermaid_css_file=v_pure_mermaid.css
version=20 version=21
[phony] [phony]
; Abstract color attributes. ; Abstract color attributes.

View File

@ -257,6 +257,7 @@ max_num_of_tag_labels=3
smart_live_preview=3 smart_live_preview=3
; Support multiple keyboard layout ; Support multiple keyboard layout
; Not valid on macOS
multiple_keyboard_layout=true multiple_keyboard_layout=true
; Whether insert new note in front ; Whether insert new note in front

View File

@ -96,11 +96,10 @@ void VCaptain::keyPressEvent(QKeyEvent *p_event)
} }
if (g_config->getMultipleKeyboardLayout()) { if (g_config->getMultipleKeyboardLayout()) {
qDebug() << "Captain mode" << key << p_event->nativeScanCode() << p_event->nativeVirtualKey(); // Use virtual key here for different layout.
key = p_event->nativeVirtualKey(); key = p_event->nativeVirtualKey();
} }
// Use virtual key here for different layout.
if (handleKeyPress(key, modifiers)) { if (handleKeyPress(key, modifiers)) {
p_event->accept(); p_event->accept();
} else { } else {

View File

@ -314,8 +314,12 @@ void VConfigManager::initialize()
m_smartLivePreview = getConfigFromSettings("global", m_smartLivePreview = getConfigFromSettings("global",
"smart_live_preview").toInt(); "smart_live_preview").toInt();
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
m_multipleKeyboardLayout = false;
#else
m_multipleKeyboardLayout = getConfigFromSettings("global", m_multipleKeyboardLayout = getConfigFromSettings("global",
"multiple_keyboard_layout").toBool(); "multiple_keyboard_layout").toBool();
#endif
m_insertNewNoteInFront = getConfigFromSettings("global", m_insertNewNoteInFront = getConfigFromSettings("global",
"insert_new_note_in_front").toBool(); "insert_new_note_in_front").toBool();

View File

@ -1286,7 +1286,9 @@ QMenu *VFileList::getOpenWithMenu()
if (item) { if (item) {
VNoteFile *file = getVFile(item); VNoteFile *file = getVFile(item);
if (file if (file
&& (!editArea->isFileOpened(file) || editArea->closeFile(file, false))) { && (!g_config->getCloseBeforeExternalEditor()
|| !editArea->isFileOpened(file)
|| editArea->closeFile(file, false))) {
QUrl url = QUrl::fromLocalFile(file->fetchPath()); QUrl url = QUrl::fromLocalFile(file->fetchPath());
QDesktopServices::openUrl(url); QDesktopServices::openUrl(url);
} }

View File

@ -1442,10 +1442,14 @@ void VMainWindow::changeMarkdownConverter(QAction *action)
void VMainWindow::aboutMessage() void VMainWindow::aboutMessage()
{ {
QString info = tr("<span style=\"font-weight: bold;\">v%1</span>").arg(VConfigManager::c_version); QString info = tr("VNote");
info += "<br/><br/>";
info += tr("VNote is a free Vim-inspired note-taking application that knows programmers and Markdown better.");
info += "<br/>"; info += "<br/>";
info += tr("Version: %1").arg(VConfigManager::c_version);
info += "<br/>";
info += tr("Author: Le Tan (tamlok)");
info += "<br/><br/>";
info += tr("VNote is a free and open source Vim-inspired note-taking application that knows programmers and Markdown better.");
info += "<br/><br/>";
info += tr("Please visit <a href=\"https://github.com/tamlok/vnote.git\">Github</a> for more information."); info += tr("Please visit <a href=\"https://github.com/tamlok/vnote.git\">Github</a> for more information.");
QMessageBox::about(this, tr("About VNote"), info); QMessageBox::about(this, tr("About VNote"), info);
} }