Refresh pieces bar colors once color scheme is changed

PR #21183.
Closes #21155.
This commit is contained in:
Vladimir Golovnev
2024-08-13 09:11:21 +03:00
committed by Vladimir Golovnev (Glassez)
parent a8cffbb205
commit a67bd271c6
6 changed files with 86 additions and 55 deletions

View File

@@ -1,5 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2024 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2016 Eugene Shalygin
* Copyright (C) 2006 Christophe Dumez
*
@@ -54,17 +55,15 @@ public:
virtual void clear();
// QObject interface
bool event(QEvent *e) override;
protected:
// QWidget interface
bool event(QEvent *e) override;
void enterEvent(QEnterEvent *e) override;
void leaveEvent(QEvent *e) override;
void mouseMoveEvent(QMouseEvent *e) override;
void paintEvent(QPaintEvent *e) override;
void requestImageUpdate();
virtual void updateColors();
void redraw();
QColor backgroundColor() const;
QColor borderColor() const;
@@ -82,11 +81,9 @@ private:
void highlightFile(int imagePos);
virtual QString simpleToolTipText() const = 0;
virtual QImage renderImage() = 0;
// draw new image to replace the actual image
// returns true if image was successfully updated
virtual bool updateImage(QImage &image) = 0;
void updatePieceColors();
void updateColorsImpl();
const BitTorrent::Torrent *m_torrent = nullptr;
QImage m_image;