mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: automatically pick a good theme title color
The preference setting seemed far too strange to do this. And not very user friendly. So instead we figure out if this is a dark theme or not by looking at text and background colors in the palette, and make sure we get notified if that changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4c6b00f812
commit
6201ac34b4
6 changed files with 33 additions and 14 deletions
|
@ -243,14 +243,10 @@ void TabDiveInformation::updateData()
|
|||
showCurrentWidget(false, 0); // Show current star widget at lefthand side
|
||||
}
|
||||
|
||||
void TabDiveInformation::updateUi()
|
||||
void TabDiveInformation::updateUi(QString titleColor)
|
||||
{
|
||||
// Put together appropriate CSS stylesheets: NB: colors below in same order as the enum in prefs.h
|
||||
QStringList colors = { "mediumblue", "lightblue", "black" }; // If using dark theme, set color appropriately
|
||||
QString colorText = colors[prefs.headerstyle_color];
|
||||
|
||||
QString CSSSetSmallLabel = "QLabel:enabled { color: ";
|
||||
CSSSetSmallLabel.append(colorText + "; font-size: ");
|
||||
CSSSetSmallLabel.append(titleColor + "; font-size: ");
|
||||
CSSSetSmallLabel.append(QString::number((int)(0.5 + ui->diveHeadingLabel->geometry().height() * 0.66)) + "px;}");
|
||||
ui->groupBox_visibility->setStyleSheet(ui->groupBox_visibility->styleSheet() + CSSSetSmallLabel);
|
||||
ui->groupBox_current->setStyleSheet(ui->groupBox_current->styleSheet() + CSSSetSmallLabel);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue