Created
August 15, 2013 21:40
-
-
Save QuantumCD/6245215 to your computer and use it in GitHub Desktop.
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qApp->setStyle(QStyleFactory::create("Fusion")); | |
QPalette darkPalette; | |
darkPalette.setColor(QPalette::Window, QColor(53,53,53)); | |
darkPalette.setColor(QPalette::WindowText, Qt::white); | |
darkPalette.setColor(QPalette::Base, QColor(25,25,25)); | |
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53)); | |
darkPalette.setColor(QPalette::ToolTipBase, Qt::white); | |
darkPalette.setColor(QPalette::ToolTipText, Qt::white); | |
darkPalette.setColor(QPalette::Text, Qt::white); | |
darkPalette.setColor(QPalette::Button, QColor(53,53,53)); | |
darkPalette.setColor(QPalette::ButtonText, Qt::white); | |
darkPalette.setColor(QPalette::BrightText, Qt::red); | |
darkPalette.setColor(QPalette::Link, QColor(42, 130, 218)); | |
darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); | |
darkPalette.setColor(QPalette::HighlightedText, Qt::black); | |
qApp->setPalette(darkPalette); | |
qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); |
I had to fix appearance of disabled widgets:
QColor darkGray(53, 53, 53); QColor gray(128, 128, 128); QColor black(25, 25, 25); QColor blue(42, 130, 218); QPalette darkPalette; darkPalette.setColor(QPalette::Window, darkGray); darkPalette.setColor(QPalette::WindowText, Qt::white); darkPalette.setColor(QPalette::Base, black); darkPalette.setColor(QPalette::AlternateBase, darkGray); darkPalette.setColor(QPalette::ToolTipBase, blue); darkPalette.setColor(QPalette::ToolTipText, Qt::white); darkPalette.setColor(QPalette::Text, Qt::white); darkPalette.setColor(QPalette::Button, darkGray); darkPalette.setColor(QPalette::ButtonText, Qt::white); darkPalette.setColor(QPalette::Link, blue); darkPalette.setColor(QPalette::Highlight, blue); darkPalette.setColor(QPalette::HighlightedText, Qt::black); darkPalette.setColor(QPalette::Active, QPalette::Button, gray.darker()); darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, gray); darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, gray); darkPalette.setColor(QPalette::Disabled, QPalette::Text, gray); darkPalette.setColor(QPalette::Disabled, QPalette::Light, darkGray);
Awesome thank you! For Python, use this:
palette.setColor(QPalette.Disabled, QPalette.Button, QColor(35, 35, 35))
When I had floating docks using this I got white lines on the left edge.
Setting QPallete::Light to the same color as QPalette::Window fixed it.
darkPalette.setColor(QPalette::Light,QColor(53, 53, 53));
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @leplatrem, @QuantumCD
I've used the style in my steganography app.
All the best to you guys!