diff --git a/cockatrice/src/interface/theme_manager.cpp b/cockatrice/src/interface/theme_manager.cpp index 5809ce350..1dc61fdb7 100644 --- a/cockatrice/src/interface/theme_manager.cpp +++ b/cockatrice/src/interface/theme_manager.cpp @@ -179,7 +179,7 @@ QBrush ThemeManager::loadExtraBrush(QString fileName, QBrush &fallbackBrush) static inline QPalette createDarkGreenFusionPalette() { - QPalette p = QStyleFactory::create("Fusion")->standardPalette(); + QPalette p; // ---------- Core backgrounds ---------- p.setColor(QPalette::Window, QColor(30, 30, 30)); // #ff1e1e1e @@ -248,7 +248,7 @@ static inline QPalette createDarkGreenFusionPalette() static inline QPalette createLightGreenFusionPalette() { - QPalette p = QStyleFactory::create("Fusion")->standardPalette(); + QPalette p; // ---------- Core backgrounds ---------- p.setColor(QPalette::Window, QColor(240, 240, 240)); // #fff0f0f0 @@ -332,15 +332,13 @@ void ThemeManager::themeChangedSlot() } if (themeName == FUSION_THEME_NAME) { - QStyle *fusionStyle = QStyleFactory::create("Fusion"); - qApp->setStyle(fusionStyle); + qApp->setStyle(QStyleFactory::create("Fusion")); #if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)) - // Start from Fusion's own palette so dark mode is handled correctly, - // then apply any tweaks on top of it. - QPalette palette = fusionStyle->standardPalette(); + QPalette palette; if (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark) { palette.setColor(QPalette::AlternateBase, QColor(53, 53, 53)); } + qApp->setPalette(palette); #endif } else if (themeName == FUSION_THEME_NAME_LIGHT) { @@ -350,7 +348,7 @@ void ThemeManager::themeChangedSlot() qApp->setStyle(QStyleFactory::create("Fusion")); qApp->setPalette(createDarkGreenFusionPalette()); } else { - qApp->setStyle(QStyleFactory::create(defaultStyleName)); // setting the style also sets the palette + qApp->setStyle(defaultStyleName); // setting the style also sets the palette } if (dirPath.isEmpty()) { diff --git a/cockatrice/src/interface/widgets/deck_analytics/resizable_panel.cpp b/cockatrice/src/interface/widgets/deck_analytics/resizable_panel.cpp index f7bb5ac35..a0c971a75 100644 --- a/cockatrice/src/interface/widgets/deck_analytics/resizable_panel.cpp +++ b/cockatrice/src/interface/widgets/deck_analytics/resizable_panel.cpp @@ -20,6 +20,7 @@ ResizablePanel::ResizablePanel(const QString &_typeId, AbstractAnalyticsPanelWid frame = new QFrame(this); frame->setFrameShape(QFrame::Box); frame->setLineWidth(2); + frame->setStyleSheet("border: none;"); auto *frameLayout = new QVBoxLayout(frame); frameLayout->setContentsMargins(0, 0, 0, 0); @@ -29,13 +30,15 @@ ResizablePanel::ResizablePanel(const QString &_typeId, AbstractAnalyticsPanelWid frameLayout->addWidget(analyticsPanel); dropIndicator = new QFrame(frame); + dropIndicator->setStyleSheet("background-color: #3daee9;"); dropIndicator->setFixedHeight(3); dropIndicator->hide(); // hidden by default dropIndicator->raise(); // make sure it's above children selectionOverlay = new QFrame(frame); - selectionOverlay->hide(); // hidden by default - selectionOverlay->raise(); // make sure it is above children + selectionOverlay->setStyleSheet("background-color: rgba(61,174,233,50);"); // semi-transparent blue + selectionOverlay->hide(); // hidden by default + selectionOverlay->raise(); // make sure it is above children selectionOverlay->setAttribute(Qt::WA_TransparentForMouseEvents); // Bottom bar with drag button and resize handle @@ -48,41 +51,24 @@ ResizablePanel::ResizablePanel(const QString &_typeId, AbstractAnalyticsPanelWid dragButton = new QPushButton("☰", bottomBar); dragButton->setFixedSize(40, 8); dragButton->setCursor(Qt::OpenHandCursor); + dragButton->setStyleSheet("QPushButton { " + "background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #4a4a4a, stop:1 #3a3a3a); " + "border: none; color: #888; font-size: 10px; }" + "QPushButton:hover { background: #5a5a5a; }"); bottomLayout->addWidget(dragButton); // Resize handle fills the rest resizeHandle = new QWidget(bottomBar); resizeHandle->setFixedHeight(8); resizeHandle->setCursor(Qt::SizeVerCursor); + resizeHandle->setStyleSheet("background: qlineargradient(x1:0, y1:0, x2:0, y2:1, " + "stop:0 #3a3a3a, stop:1 #2a2a2a);"); bottomLayout->addWidget(resizeHandle, 1); frameLayout->addWidget(bottomBar); mainLayout->addWidget(frame); - const QPalette &pal = QApplication::palette(); - QColor mid = pal.color(QPalette::Mid); - QColor dark = pal.color(QPalette::Dark); - QColor midLight = pal.color(QPalette::Midlight); - QColor shadow = pal.color(QPalette::Shadow); - QColor placeholderText = pal.color(QPalette::PlaceholderText); - - frame->setStyleSheet("QFrame { border: none; }"); - - dropIndicator->setStyleSheet("QFrame { background-color: #3daee9; }"); - - selectionOverlay->setStyleSheet("QFrame { background-color: rgba(61,174,233,50); }"); - - dragButton->setStyleSheet(QString("QPushButton { " - "background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 %1, stop:1 %2); " - "border: none; color: %3; font-size: 10px; }" - "QPushButton:hover { background: %4; }") - .arg(mid.name(), dark.name(), placeholderText.name(), midLight.name())); - - resizeHandle->setStyleSheet(QString("QWidget { background: qlineargradient(x1:0, y1:0, x2:0, y2:1, " - "stop:0 %1, stop:1 %2); }") - .arg(dark.name(), shadow.name())); - // Set size policy setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); diff --git a/oracle/src/oraclewizard.cpp b/oracle/src/oraclewizard.cpp index 2edb9e561..9d32a993b 100644 --- a/oracle/src/oraclewizard.cpp +++ b/oracle/src/oraclewizard.cpp @@ -21,10 +21,6 @@ OracleWizard::OracleWizard(QWidget *parent) : QWizard(parent) // define a dummy context that will be used where needed QString dummy = QT_TRANSLATE_NOOP("i18n", "English"); -#ifdef Q_OS_WIN - setWizardStyle(QWizard::ModernStyle); -#endif - QString oracleSettingsFile = SettingsCache::instance().getSettingsPath() + "oracle.ini"; settings = new QSettings(oracleSettingsFile, QSettings::IniFormat, this);