Mercurial > minori
comparison src/gui/dialog/settings.cc @ 294:99cbc51433e4
*: cleanup uses of QPalette
I didn't know about setBackgroundRole() which is very useful
in 99% of the cases where I even needed to edit the palette
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 12 May 2024 18:16:08 -0400 |
parents | 862d0d8619f6 |
children | 180714442770 |
comparison
equal
deleted
inserted
replaced
293:703fb7d7c917 | 294:99cbc51433e4 |
---|---|
23 font.setPixelSize(12); | 23 font.setPixelSize(12); |
24 font.setWeight(QFont::Bold); | 24 font.setWeight(QFont::Bold); |
25 page_title->setFont(font); | 25 page_title->setFont(font); |
26 | 26 |
27 { | 27 { |
28 QPalette pal = page_title->palette(); | 28 QPalette pal(page_title->palette()); |
29 pal.setColor(QPalette::Window, QColor(0xAB, 0xAB, 0xAB)); | 29 pal.setColor(QPalette::Window, QColor(0xAB, 0xAB, 0xAB)); |
30 pal.setColor(QPalette::WindowText, Qt::white); | 30 pal.setColor(QPalette::WindowText, Qt::white); |
31 page_title->setPalette(pal); | 31 page_title->setPalette(pal); |
32 } | 32 } |
33 | 33 |
96 // sidebar->AddItem(tr("Advanced"), SideBar::CreateIcon(":/icons/24x24/gear.png")); | 96 // sidebar->AddItem(tr("Advanced"), SideBar::CreateIcon(":/icons/24x24/gear.png")); |
97 | 97 |
98 sidebar->setIconSize(QSize(24, 24)); | 98 sidebar->setIconSize(QSize(24, 24)); |
99 sidebar->setFrameShape(QFrame::Box); | 99 sidebar->setFrameShape(QFrame::Box); |
100 | 100 |
101 QPalette pal(sidebar->palette()); | 101 sidebar->SetBackgroundTransparent(false); |
102 sidebar->SetBackgroundColor(pal.color(QPalette::Base)); | 102 sidebar->setBackgroundRole(QPalette::Base); |
103 | 103 |
104 sidebar->setFixedWidth(158); | 104 sidebar->setFixedWidth(158); |
105 sidebar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); | 105 sidebar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); |
106 layout->addWidget(sidebar); | 106 layout->addWidget(sidebar); |
107 } | 107 } |