Playing around with dark themes, found one that works. TODO: Display
licenses.
This commit is contained in:
parent
263c65ac46
commit
5945969ab8
106 changed files with 9489 additions and 15 deletions
|
@ -2,6 +2,7 @@
|
|||
#include "ui_mainwindow.h"
|
||||
#include "assetlist.h"
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QApplication>
|
||||
#include <QBitmap>
|
||||
#include <QComboBox>
|
||||
|
@ -54,25 +55,38 @@ void MainWindow::EnableThemeDark()
|
|||
{
|
||||
ui->actionToggleDark->setIcon(QIcon(":/icons/data/icons/alexandru.stoica/sun_star [#1268].svg"));
|
||||
|
||||
QFile file(":/css/data/css/style.qss");
|
||||
file.open(QFile::ReadOnly);
|
||||
QTextStream ts(&file);
|
||||
qApp->setStyleSheet(ts.readAll());
|
||||
//QFile file(":/css/data/css/style.qss");
|
||||
//QFile file(":/css/data/css/DarkMonokai.qss");
|
||||
QFile file(":/css/data/css/darkorange.qss");
|
||||
//QFile file(":/css/data/css/darkstyle.qss");
|
||||
//QFile file(":/css/data/css/QTDark.qss");
|
||||
//QFile file(":/dark.qss");
|
||||
file.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream stream(&file);
|
||||
qApp->setStyleSheet(stream.readAll());
|
||||
|
||||
auto& children = this->children();
|
||||
for( auto& child : children )
|
||||
{
|
||||
for( auto& child : children ) {
|
||||
QAction* action = qobject_cast<QAction*>(child);
|
||||
if( action )
|
||||
{
|
||||
QAbstractButton* button = qobject_cast<QAbstractButton*>(child);
|
||||
if( action ) {
|
||||
auto icon = action->icon();
|
||||
auto pixmap = icon.pixmap(icon.actualSize(QSize(32,32)));
|
||||
const auto& mask = pixmap.createMaskFromColor(QColor("transparent"), Qt::MaskInColor);
|
||||
pixmap.fill(QColor("white"));
|
||||
pixmap.setMask(mask);
|
||||
action->setIcon(QIcon(pixmap));
|
||||
} else if( button ) {
|
||||
auto icon = button->icon();
|
||||
auto pixmap = icon.pixmap(icon.actualSize(QSize(32,32)));
|
||||
const auto& mask = pixmap.createMaskFromColor(QColor("transparent"), Qt::MaskInColor);
|
||||
pixmap.fill(QColor("white"));
|
||||
pixmap.setMask(mask);
|
||||
button->setIcon(QIcon(pixmap));
|
||||
}
|
||||
}
|
||||
|
||||
//this->setWindowState(Qt::WindowMaximized);
|
||||
}
|
||||
|
||||
void MainWindow::EnableThemeLight()
|
||||
|
@ -81,6 +95,11 @@ void MainWindow::EnableThemeLight()
|
|||
|
||||
qApp->setStyleSheet("");
|
||||
|
||||
//QFile file(":/light.qss");
|
||||
//file.open(QFile::ReadOnly | QFile::Text);
|
||||
//QTextStream stream(&file);
|
||||
//qApp->setStyleSheet(stream.readAll());
|
||||
|
||||
auto& children = this->children();
|
||||
for( auto& child : children )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue