macOS: fix statusbar button clickability

This commit is contained in:
tobtoht
2021-10-28 19:50:18 +02:00
parent 17519ef7c0
commit d68496bdd4
4 changed files with 49 additions and 0 deletions
+16
View 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);