Reset user colors on theme change (in qml timeline)
This commit is contained in:
parent
2895162971
commit
6bdc75d073
12 changed files with 20 additions and 89 deletions
|
|
@ -18,6 +18,8 @@ Q_DECLARE_METATYPE(mtx::events::collections::TimelineEvents)
|
|||
void
|
||||
TimelineViewManager::updateColorPalette()
|
||||
{
|
||||
userColors.clear();
|
||||
|
||||
if (settings->theme() == "light") {
|
||||
QPalette lightActive(/*windowText*/ QColor("#333"),
|
||||
/*button*/ QColor("#333"),
|
||||
|
|
@ -53,6 +55,15 @@ TimelineViewManager::updateColorPalette()
|
|||
}
|
||||
}
|
||||
|
||||
QColor
|
||||
TimelineViewManager::userColor(QString id, QColor background)
|
||||
{
|
||||
if (!userColors.contains(id))
|
||||
userColors.insert(
|
||||
id, QColor(utils::generateContrastingHexColor(id, background.name())));
|
||||
return userColors.value(id);
|
||||
}
|
||||
|
||||
TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
||||
: imgProvider(new MxcImageProvider())
|
||||
, colorImgProvider(new ColorImageProvider())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue