further development on rewrite
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#include "style.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QPalette>
|
||||
#include <QStyleFactory>
|
||||
|
||||
void olive::style::SetDefault()
|
||||
{
|
||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||
|
||||
// Set palette for Fusion
|
||||
QPalette palette;
|
||||
|
||||
palette.setColor(QPalette::Window, QColor(53,53,53));
|
||||
palette.setColor(QPalette::WindowText, Qt::white);
|
||||
palette.setColor(QPalette::Base, QColor(25,25,25));
|
||||
palette.setColor(QPalette::AlternateBase, QColor(53,53,53));
|
||||
palette.setColor(QPalette::ToolTipBase, QColor(25,25,25));
|
||||
palette.setColor(QPalette::ToolTipText, Qt::white);
|
||||
palette.setColor(QPalette::Text, Qt::white);
|
||||
palette.setColor(QPalette::Button, QColor(53,53,53));
|
||||
palette.setColor(QPalette::ButtonText, Qt::white);
|
||||
palette.setColor(QPalette::BrightText, Qt::red);
|
||||
palette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(128, 128, 128));
|
||||
palette.setColor(QPalette::Link, QColor(42, 130, 218));
|
||||
palette.setColor(QPalette::Highlight, QColor(42, 130, 218));
|
||||
palette.setColor(QPalette::HighlightedText, Qt::white);
|
||||
|
||||
qApp->setPalette(palette);
|
||||
|
||||
// set default CSS
|
||||
QString stylesheet = "QPushButton::checked { background: rgb(25, 25, 25); }";
|
||||
|
||||
// Windows menus have the option of being native, so we may not need this CSS
|
||||
bool set_separator_color = false;
|
||||
#ifndef Q_OS_WIN
|
||||
//set_separator_color = !olive::config.use_native_menu_styling;
|
||||
#endif
|
||||
if (set_separator_color) {
|
||||
stylesheet.append("QMenu::separator { background: #404040; }");
|
||||
}
|
||||
|
||||
qApp->setStyleSheet(stylesheet);
|
||||
}
|
||||
Reference in New Issue
Block a user