mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
committed by
GitHub
parent
25b7972f88
commit
ce013f132f
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2023 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2023-2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -64,21 +64,23 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
class ColorWidget final : public QFrame
|
||||
class ColorWidget final : public QLabel
|
||||
{
|
||||
Q_DISABLE_COPY_MOVE(ColorWidget)
|
||||
Q_DECLARE_TR_FUNCTIONS(ColorWidget)
|
||||
|
||||
public:
|
||||
explicit ColorWidget(const QColor ¤tColor, const QColor &defaultColor, QWidget *parent = nullptr)
|
||||
: QFrame(parent)
|
||||
: QLabel(parent)
|
||||
, m_defaultColor {defaultColor}
|
||||
, m_currentColor {currentColor}
|
||||
{
|
||||
setObjectName(u"colorWidget"_s);
|
||||
setFrameShape(QFrame::Box);
|
||||
setFrameShadow(QFrame::Plain);
|
||||
setAlignment(Qt::AlignCenter);
|
||||
|
||||
setCurrentColor(currentColor);
|
||||
applyColor(currentColor);
|
||||
}
|
||||
|
||||
QColor currentColor() const
|
||||
@@ -119,7 +121,16 @@ private:
|
||||
|
||||
void applyColor(const QColor &color)
|
||||
{
|
||||
setStyleSheet(u"#colorWidget { background-color: %1; }"_s.arg(color.name()));
|
||||
if (color.isValid())
|
||||
{
|
||||
setStyleSheet(u"#colorWidget { background-color: %1; }"_s.arg(color.name()));
|
||||
setText({});
|
||||
}
|
||||
else
|
||||
{
|
||||
setStyleSheet({});
|
||||
setText(tr("System"));
|
||||
}
|
||||
}
|
||||
|
||||
void showColorDialog()
|
||||
@@ -262,6 +273,8 @@ void UIThemeDialog::loadColors()
|
||||
int row = 2;
|
||||
for (const QString &id : colorIDs)
|
||||
{
|
||||
if (id == u"Log.Normal")
|
||||
qDebug() << "!!!!!!!";
|
||||
m_ui->colorsLayout->addWidget(new QLabel(id), row, 0);
|
||||
|
||||
const UIThemeColor &defaultColor = defaultColors.value(id);
|
||||
|
||||
Reference in New Issue
Block a user