DynamicPlaylistControls: Make background follow system colors
Fixes #1483
This commit is contained in:
parent
9d22e4ec07
commit
232399ea28
|
@ -45,5 +45,6 @@
|
||||||
<file>mood/sample.mood</file>
|
<file>mood/sample.mood</file>
|
||||||
<file>text/ghosts.txt</file>
|
<file>text/ghosts.txt</file>
|
||||||
<file>pictures/sidebar-background.png</file>
|
<file>pictures/sidebar-background.png</file>
|
||||||
|
<file>style/dynamicplaylistcontrols.css</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#container {
|
||||||
|
background: %background;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid rgba(200, 200, 200, 75%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#label1 {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#label2 {
|
||||||
|
font-size: 7.5pt;
|
||||||
|
}
|
|
@ -1,20 +1,31 @@
|
||||||
/* This file is part of Clementine.
|
/*
|
||||||
Copyright 2010, David Sansome <me@davidsansome.com>
|
* Strawberry Music Player
|
||||||
|
* This file was part of Clementine.
|
||||||
Clementine is free software: you can redistribute it and/or modify
|
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||||
it under the terms of the GNU General Public License as published by
|
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
*
|
||||||
(at your option) any later version.
|
* Strawberry is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
Clementine is distributed in the hope that it will be useful,
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* (at your option) any later version.
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*
|
||||||
GNU General Public License for more details.
|
* Strawberry is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
You should have received a copy of the GNU General Public License
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QIODevice>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QPalette>
|
||||||
|
|
||||||
|
#include "core/logging.h"
|
||||||
|
|
||||||
#include "dynamicplaylistcontrols.h"
|
#include "dynamicplaylistcontrols.h"
|
||||||
#include "ui_dynamicplaylistcontrols.h"
|
#include "ui_dynamicplaylistcontrols.h"
|
||||||
|
|
||||||
|
@ -28,6 +39,16 @@ DynamicPlaylistControls::DynamicPlaylistControls(QWidget *parent)
|
||||||
QObject::connect(ui_->repopulate, &QPushButton::clicked, this, &DynamicPlaylistControls::Repopulate);
|
QObject::connect(ui_->repopulate, &QPushButton::clicked, this, &DynamicPlaylistControls::Repopulate);
|
||||||
QObject::connect(ui_->off, &QPushButton::clicked, this, &DynamicPlaylistControls::TurnOff);
|
QObject::connect(ui_->off, &QPushButton::clicked, this, &DynamicPlaylistControls::TurnOff);
|
||||||
|
|
||||||
|
QFile stylesheet_file(QStringLiteral(":/style/dynamicplaylistcontrols.css"));
|
||||||
|
if (stylesheet_file.open(QIODevice::ReadOnly)) {
|
||||||
|
QString stylesheet = QString::fromLatin1(stylesheet_file.readAll());
|
||||||
|
stylesheet_file.close();
|
||||||
|
QColor color = palette().color(QPalette::Light);
|
||||||
|
color.setAlpha(50);
|
||||||
|
stylesheet.replace(QLatin1String("%background"), QStringLiteral("rgba(%1, %2, %3, %4%5)").arg(QString::number(color.red()), QString::number(color.green()), QString::number(color.blue()), QString::number(color.alpha())).arg(QLatin1Char('%')));
|
||||||
|
setStyleSheet(stylesheet);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicPlaylistControls::~DynamicPlaylistControls() { delete ui_; }
|
DynamicPlaylistControls::~DynamicPlaylistControls() { delete ui_; }
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
/* This file is part of Clementine.
|
/*
|
||||||
Copyright 2010, David Sansome <me@davidsansome.com>
|
* Strawberry Music Player
|
||||||
|
* This file was part of Clementine.
|
||||||
Clementine is free software: you can redistribute it and/or modify
|
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||||
it under the terms of the GNU General Public License as published by
|
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
*
|
||||||
(at your option) any later version.
|
* Strawberry is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
Clementine is distributed in the hope that it will be useful,
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* (at your option) any later version.
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*
|
||||||
GNU General Public License for more details.
|
* Strawberry is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
You should have received a copy of the GNU General Public License
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DYNAMICPLAYLISTCONTROLS_H
|
#ifndef DYNAMICPLAYLISTCONTROLS_H
|
||||||
|
|
|
@ -10,21 +10,6 @@
|
||||||
<height>54</height>
|
<height>54</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">#container {
|
|
||||||
background: rgba(200, 200, 200, 50%);
|
|
||||||
border-radius: 10px;
|
|
||||||
border: 1px solid rgba(200, 200, 200, 75%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#label1 {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
#label2 {
|
|
||||||
font-size: 7.5pt;
|
|
||||||
}</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="layout_dynamic_playlist_controls">
|
<layout class="QVBoxLayout" name="layout_dynamic_playlist_controls">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
@ -41,10 +26,10 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="container">
|
<widget class="QFrame" name="container">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::Shape::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Shadow::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="layout_container">
|
<layout class="QHBoxLayout" name="layout_container">
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Reference in New Issue