瀏覽代碼

bug-fix: add Q_OS_MAC for check

Qt 5.7 seems to use Q_OS_MAC instead of Q_OS_MACOS.
Le Tan 8 年之前
父節點
當前提交
9f4ac1f260
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      src/utils/vvim.cpp
  2. 3 3
      src/vmainwindow.cpp

+ 1 - 1
src/utils/vvim.cpp

@@ -344,7 +344,7 @@ static int percentageToBlockNumber(const QTextDocument *p_doc, int p_percent)
 // See if @p_modifiers is Control which is different on macOs and Windows.
 static bool isControlModifier(int p_modifiers)
 {
-#if defined(Q_OS_MACOS)
+#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
     return p_modifiers == Qt::MetaModifier;
 #else
     return p_modifiers == Qt::ControlModifier;

+ 3 - 3
src/vmainwindow.cpp

@@ -924,7 +924,7 @@ void VMainWindow::initRenderBackgroundMenu(QMenu *menu)
         tmpAct->setCheckable(true);
         tmpAct->setData(bgColors[i].name);
 
-#if !defined(Q_OS_MACOS)
+#if !defined(Q_OS_MACOS) && !defined(Q_OS_MAC)
         tmpAct->setIcon(QIcon(predefinedColorPixmaps[i]));
 #endif
 
@@ -1011,7 +1011,7 @@ void VMainWindow::initEditorBackgroundMenu(QMenu *menu)
         tmpAct->setToolTip(tr("Set as the background color for editor"));
         tmpAct->setCheckable(true);
         tmpAct->setData(bgColors[i].name);
-#if !defined(Q_OS_MACOS)
+#if !defined(Q_OS_MACOS) && !defined(Q_OS_MAC)
         tmpAct->setIcon(QIcon(predefinedColorPixmaps[i]));
 #endif
         if (curBgColor == bgColors[i].name) {
@@ -1529,7 +1529,7 @@ QAction *VMainWindow::newAction(const QIcon &p_icon,
                                 const QString &p_text,
                                 QObject *p_parent)
 {
-#if defined(Q_OS_MACOS)
+#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
     Q_UNUSED(p_icon);
     return new QAction(p_text, p_parent);
 #else