Browse Source

Tweaks to how qjackctl looks and behaves under macOS

tags/v1.0
falkTX 4 years ago
parent
commit
61fe6bb626
3 changed files with 130 additions and 1 deletions
  1. +6
    -1
      build-jack2.sh
  2. +124
    -0
      patches/qjackctl/03_apple-win32-ui-adjustments.patch
  3. +0
    -0
      patches/qjackctl/QjackCtl.icns

+ 6
- 1
build-jack2.sh View File

@@ -147,7 +147,12 @@ if [ -f "${PAWPAW_PREFIX}/bin/moc" ]; then

build_autoconf qjackctl "${QJACKCTL_VERSION}" "--enable-jack-version ${qjackctl_extra_args}"

if [ "${WIN32}" -eq 1 ]; then
if [ "${MACOS}" -eq 1 ]; then
cp "${PAWPAW_ROOT}/patches/qjackctl/QjackCtl.icns" "${PAWPAW_BUILDDIR}/qjackctl${name}-${QJACKCTL_VERSION}/src/qjackctl.app/Contents/Resources/QjackCtl.icns"
patch_file qjackctl "${QJACKCTL_VERSION}" "src/qjackctl.app/Contents/Info.plist" 's|Created by Qt/QMake|JACK Audio Connection Kit Qt GUI Interface|'
patch_file qjackctl "${QJACKCTL_VERSION}" "src/qjackctl.app/Contents/Info.plist" 's|com.yourcompany.qjackctl|org.rncbc.QjackCtl|'
patch_file qjackctl "${QJACKCTL_VERSION}" "src/qjackctl.app/Contents/Info.plist" 's|<string></string>|<string>QjackCtl.icns</string>|'
elif [ "${WIN32}" -eq 1 ]; then
copy_file qjackctl "${QJACKCTL_VERSION}" "src/release/qjackctl.exe" "${jack2_prefix}/bin/qjackctl.exe"
fi
fi


+ 124
- 0
patches/qjackctl/03_apple-win32-ui-adjustments.patch View File

@@ -0,0 +1,124 @@
diff --git a/src/qjackctlAboutForm.cpp b/src/qjackctlAboutForm.cpp
index 6a28439..521b7c9 100644
--- a/src/qjackctlAboutForm.cpp
+++ b/src/qjackctlAboutForm.cpp
@@ -68,12 +68,12 @@ qjackctlAboutForm::qjackctlAboutForm ( QWidget *pParent )
list << tr("JACK Session support disabled.");
#endif
#ifndef CONFIG_ALSA_SEQ
-#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32)
+#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32) && !defined(__APPLE__)
list << tr("ALSA/MIDI sequencer support disabled.");
#endif
#endif
#ifndef CONFIG_DBUS
-#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32)
+#if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32) && !defined(__APPLE__)
list << tr("D-Bus interface support disabled.");
#endif
#endif
diff --git a/src/qjackctlMainForm.cpp b/src/qjackctlMainForm.cpp
index ee9afa4..f206270 100644
--- a/src/qjackctlMainForm.cpp
+++ b/src/qjackctlMainForm.cpp
@@ -584,6 +584,26 @@ qjackctlMainForm::qjackctlMainForm (
QObject::connect(m_ui.ForwardToolButton,
SIGNAL(clicked()),
SLOT(transportForward()));
+
+#ifdef __APPLE__
+ // Setup macOS menu bar
+ QMenuBar* const menuBar = new QMenuBar(nullptr);
+ menuBar->setNativeMenuBar(true);
+
+ QMenu* const menu = menuBar->addMenu("QjackCtl");
+
+ QAction* const actQuit = menu->addAction(tr("&Quit"));
+ actQuit->setMenuRole(QAction::QuitRole);
+ QObject::connect(actQuit, SIGNAL(triggered()), SLOT(quitMainForm()));
+
+ QAction* const actPreferences = menu->addAction(tr("Set&up..."));
+ actPreferences->setMenuRole(QAction::PreferencesRole);
+ QObject::connect(actPreferences, SIGNAL(triggered()), SLOT(showSetupForm()));
+
+ QAction* const actAbout = menu->addAction(tr("Ab&out..."));
+ actAbout->setMenuRole(QAction::AboutRole);
+ QObject::connect(actAbout, SIGNAL(triggered()), SLOT(showAboutForm()));
+#endif
}
@@ -906,6 +926,11 @@ bool qjackctlMainForm::setup ( qjackctlSetup *pSetup )
// Register the first timer slot.
QTimer::singleShot(QJACKCTL_TIMER_MSECS, this, SLOT(timerSlot()));
+#ifdef __APPLE__
+ // increazing height make UI look ugly and it is not really useful
+ setFixedHeight(height());
+#endif
+
// We're ready to go...
return true;
}
diff --git a/src/qjackctlSetup.cpp b/src/qjackctlSetup.cpp
index 8294606..487b7de 100644
--- a/src/qjackctlSetup.cpp
+++ b/src/qjackctlSetup.cpp
@@ -88,6 +88,12 @@ void qjackctlSetup::loadSetup (void)
}
m_settings.endGroup();
+#ifdef __APPLE__
+ // alternative custom defaults, as the mac theme does not look good with our custom widgets
+ sCustomColorTheme = "KXStudio";
+ sCustomStyleTheme = "Fusion";
+#endif
+
m_settings.beginGroup("/Options");
bSingleton = m_settings.value("/Singleton", true).toBool();
// sServerName = m_settings.value("/ServerName").toString();
@@ -118,8 +124,8 @@ void qjackctlSetup::loadSetup (void)
sDisplayFont2 = m_settings.value("/DisplayFont2").toString();
bDisplayEffect = m_settings.value("/DisplayEffect", true).toBool();
bDisplayBlink = m_settings.value("/DisplayBlink", true).toBool();
- sCustomColorTheme = m_settings.value("/CustomColorTheme").toString();
- sCustomStyleTheme = m_settings.value("/CustomStyleTheme").toString();
+ sCustomColorTheme = m_settings.value("/CustomColorTheme", sCustomColorTheme).toString();
+ sCustomStyleTheme = m_settings.value("/CustomStyleTheme", sCustomStyleTheme).toString();
iJackClientPortAlias = m_settings.value("/JackClientPortAlias", 0).toInt();
bJackClientPortMetadata = m_settings.value("/JackClientPortMetadata", false).toBool();
iConnectionsIconSize = m_settings.value("/ConnectionsIconSize", QJACKCTL_ICON_16X16).toInt();
diff --git a/src/qjackctlSetupForm.cpp b/src/qjackctlSetupForm.cpp
index ee64fa3..703ab52 100644
--- a/src/qjackctlSetupForm.cpp
+++ b/src/qjackctlSetupForm.cpp
@@ -126,6 +126,29 @@ qjackctlSetupForm::qjackctlSetupForm ( QWidget *pParent )
m_iDirtySettings = 0;
m_iDirtyOptions = 0;
+#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__APPLE__)
+ // Remove useless drivers for some systems
+ for (int i = m_ui.DriverComboBox->count(); --i >= 0;)
+ {
+ const QString itemText = m_ui.DriverComboBox->itemText(i);
+ if (itemText == "dummy")
+ continue;
+#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
+ if (itemText == "portaudio")
+ continue;
+#endif
+#ifdef __APPLE__
+ if (itemText == "coreaudio")
+ continue;
+#endif
+ if (itemText == "net")
+ continue;
+ if (itemText == "netone")
+ continue;
+ m_ui.DriverComboBox->removeItem(i);
+ }
+#endif
+
// Save original hard-coded driver names, only really
// useful when (changing (dis)enabling JACK D-BUS...
m_drivers.clear();

+ 0
- 0
patches/qjackctl/QjackCtl.icns View File


Loading…
Cancel
Save