mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Improve color scheme change detection
* Fix pieces bars won't correctly detect color scheme change with Qt 6.8. * Update RSS article content view on color scheme changed. PR #21625. Closes #21327.
This commit is contained in:
committed by
GitHub
parent
ab8d0d1dae
commit
3ab9fe55e5
@@ -42,7 +42,6 @@
|
||||
#include "base/indexrange.h"
|
||||
#include "base/path.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "gui/uithememanager.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -119,13 +118,7 @@ PiecesBar::PiecesBar(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
|
||||
updateColorsImpl();
|
||||
connect(UIThemeManager::instance(), &UIThemeManager::themeChanged, this, [this]
|
||||
{
|
||||
updateColors();
|
||||
redraw();
|
||||
});
|
||||
}
|
||||
|
||||
void PiecesBar::setTorrent(const BitTorrent::Torrent *torrent)
|
||||
@@ -143,12 +136,19 @@ void PiecesBar::clear()
|
||||
|
||||
bool PiecesBar::event(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::ToolTip)
|
||||
const QEvent::Type eventType = e->type();
|
||||
if (eventType == QEvent::ToolTip)
|
||||
{
|
||||
showToolTip(static_cast<QHelpEvent *>(e));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (eventType == QEvent::PaletteChange)
|
||||
{
|
||||
updateColors();
|
||||
redraw();
|
||||
}
|
||||
|
||||
return base::event(e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user