]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
macOS: fix statusbar button clickability
authortobtoht <thotbot@protonmail.com>
Thu, 28 Oct 2021 17:50:18 +0000 (19:50 +0200)
committertobtoht <thotbot@protonmail.com>
Thu, 28 Oct 2021 17:50:18 +0000 (19:50 +0200)
src/MainWindow.cpp
src/MainWindow.h
src/assets.qrc
src/assets/macStylesheet.patch [new file with mode: 0644]

index bced3c9c0fd1d7b866d4ef3aad798c4355a19a4c..0dfcbb0df0802bf260acf37e5540c79701c6efe1 100644 (file)
@@ -95,6 +95,10 @@ void MainWindow::initStatusBar() {
     this->statusBar()->setStyleSheet("QStatusBar::item {border: None;}");
 #endif
 
+#if defined(Q_OS_MACOS)
+    this->patchStylesheetMac();
+#endif
+
     this->statusBar()->setFixedHeight(30);
 
     m_statusLabelStatus = new QLabel("Idle", this);
@@ -849,6 +853,10 @@ void MainWindow::skinChanged(const QString &skinName) {
     m_windowManager->changeSkin(skinName);
     ColorScheme::updateFromWidget(this);
     this->updateWidgetIcons();
+
+#if defined(Q_OS_MACOS)
+    this->patchStylesheetMac();
+#endif
 }
 
 void MainWindow::updateWidgetIcons() {
@@ -1586,6 +1594,14 @@ bool MainWindow::verifyPassword() {
     return true;
 }
 
+void MainWindow::patchStylesheetMac() {
+    auto patch = Utils::fileOpenQRC(":assets/macStylesheet.patch");
+    auto patch_text = Utils::barrayToString(patch);
+
+    QString styleSheet = qApp->styleSheet() + patch_text;
+    qApp->setStyleSheet(styleSheet);
+}
+
 void MainWindow::toggleSearchbar(bool visible) {
     config()->set(Config::showSearchbar, visible);
 
index fc863e156e7d46a3ad348f74d74d85af9ec9a957..a4fc590313153690393eaaa81f86548821729b5b 100644 (file)
@@ -215,6 +215,7 @@ private:
     void updateRecentlyOpenedMenu();
     void updateWidgetIcons();
     bool verifyPassword();
+    void patchStylesheetMac();
 
     QIcon hardwareDevicePairedIcon();
     QIcon hardwareDeviceUnpairedIcon();
index bf99e011a51ab934d9dda4d2b0c4816c35023d39..cf9e9abf636200ad0d319a255a3d834713c82b1a 100644 (file)
@@ -3,6 +3,7 @@
     <file>assets/about.txt</file>
     <file>assets/ack.txt</file>
     <file>assets/feather.desktop</file>
+    <file>assets/macStylesheet.patch</file>
     <file>assets/nodes.json</file>
     <file>assets/gpg_keys/featherwallet.asc</file>
     <file>assets/images/appicons/32x32.png</file>
diff --git a/src/assets/macStylesheet.patch b/src/assets/macStylesheet.patch
new file mode 100644 (file)
index 0000000..955debd
--- /dev/null
@@ -0,0 +1,31 @@
+/* From electrum/gui/qt/stylesheet_patcher.py */
+StatusBarButton {
+    background-color: transparent;
+    border: 1px solid transparent;
+    border-radius: 4px;
+    margin: 0px;
+    padding: 2px;
+}
+
+StatusBarButton:checked {
+  background-color: transparent;
+  border: 1px solid #1464A0;
+}
+
+StatusBarButton:checked:disabled {
+  border: 1px solid #14506E;
+}
+
+StatusBarButton:pressed {
+  margin: 1px;
+  background-color: transparent;
+  border: 1px solid #1464A0;
+}
+
+StatusBarButton:disabled {
+  border: none;
+}
+
+StatusBarButton:hover {
+  border: 1px solid #148CD2;
+}
\ No newline at end of file