Sfoglia il codice sorgente

fix

- 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.
Le Tan 7 anni fa
parent
commit
9b83d50116

+ 1 - 1
src/resources/themes/v_native/v_native.mdhl

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

+ 1 - 1
src/resources/themes/v_native/v_native.palette

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

+ 1 - 1
src/resources/themes/v_pure/v_pure.mdhl

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

+ 1 - 1
src/resources/themes/v_pure/v_pure.palette

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

+ 1 - 0
src/resources/vnote.ini

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

+ 1 - 2
src/vcaptain.cpp

@@ -96,11 +96,10 @@ void VCaptain::keyPressEvent(QKeyEvent *p_event)
     }
 
     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();
     }
 
-    // Use virtual key here for different layout.
     if (handleKeyPress(key, modifiers)) {
         p_event->accept();
     } else {

+ 4 - 0
src/vconfigmanager.cpp

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

+ 3 - 1
src/vfilelist.cpp

@@ -1286,7 +1286,9 @@ QMenu *VFileList::getOpenWithMenu()
                 if (item) {
                     VNoteFile *file = getVFile(item);
                     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());
                         QDesktopServices::openUrl(url);
                     }

+ 7 - 3
src/vmainwindow.cpp

@@ -1442,10 +1442,14 @@ void VMainWindow::changeMarkdownConverter(QAction *action)
 
 void VMainWindow::aboutMessage()
 {
-    QString info = tr("<span style=\"font-weight: bold;\">v%1</span>").arg(VConfigManager::c_version);
-    info += "<br/><br/>";
-    info += tr("VNote is a free Vim-inspired note-taking application that knows programmers and Markdown better.");
+    QString info = tr("VNote");
+    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.");
     QMessageBox::about(this, tr("About VNote"), info);
 }