summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
24ed38d)
Everything was handling palette change already but for the visual distinction between
active and non-active view (in case of split view), a custom palette was set which was
then never updated. This could be seen by the label text color changing but not the view background.
Differential Revision: https://phabricator.kde.org/D3909
- QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
- if (!active) {
- color.setAlpha(150);
- }
-
- QWidget* viewport = m_container->viewport();
- if (viewport) {
- QPalette palette;
- palette.setColor(viewport->backgroundRole(), color);
- viewport->setPalette(palette);
- }
-
- update();
if (active) {
m_container->setFocus();
if (active) {
m_container->setFocus();
m_model->cancelDirectoryLoading();
}
m_model->cancelDirectoryLoading();
}
+void DolphinView::updatePalette()
+{
+ QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
+ if (!m_active) {
+ color.setAlpha(150);
+ }
+
+ QWidget* viewport = m_container->viewport();
+ if (viewport) {
+ QPalette palette;
+ palette.setColor(viewport->backgroundRole(), color);
+ viewport->setPalette(palette);
+ }
+
+ update();
+}
+
bool DolphinView::eventFilter(QObject* watched, QEvent* event)
{
switch (event->type()) {
bool DolphinView::eventFilter(QObject* watched, QEvent* event)
{
switch (event->type()) {
+ case QEvent::PaletteChange:
+ updatePalette();
+ break;
+
case QEvent::KeyPress:
if (GeneralSettings::useTabForSwitchingSplitView()) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
case QEvent::KeyPress:
if (GeneralSettings::useTabForSwitchingSplitView()) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
QUrl viewPropertiesUrl() const;
private:
QUrl viewPropertiesUrl() const;
private:
+ void updatePalette();
+
bool m_active;
bool m_tabsForFiles;
bool m_assureVisibleCurrentIndex;
bool m_active;
bool m_tabsForFiles;
bool m_assureVisibleCurrentIndex;