┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2012-08-13 18:40:43 +0200
committerEmmanuel Pescosta <[email protected]>2012-08-13 19:10:50 +0200
commitab61d9d3ba40e5a5869ab02907b4b14921118924 (patch)
tree661fedb284cd535449e1f9ec2da957c5116c53c1 /src/panels
parenta8cbc655502982dabf37477ed8db314e2bd97906 (diff)
Fix wrong text color in places and in folders panel.
FIXED-IN: 4.9.1 REVIEW: 105832 BUG: 303133
Diffstat (limited to 'src/panels')
-rw-r--r--src/panels/folders/foldersitemlistwidget.cpp36
-rw-r--r--src/panels/folders/foldersitemlistwidget.h42
-rw-r--r--src/panels/folders/folderspanel.cpp2
-rw-r--r--src/panels/places/placesitemlistwidget.cpp5
-rw-r--r--src/panels/places/placesitemlistwidget.h3
5 files changed, 87 insertions, 1 deletions
diff --git a/src/panels/folders/foldersitemlistwidget.cpp b/src/panels/folders/foldersitemlistwidget.cpp
new file mode 100644
index 000000000..513059204
--- /dev/null
+++ b/src/panels/folders/foldersitemlistwidget.cpp
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Emmanuel Pescosta <[email protected]>*
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#include "foldersitemlistwidget.h"
+
+FoldersItemListWidget::FoldersItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) :
+ KFileItemListWidget(informant, parent)
+{
+}
+
+FoldersItemListWidget::~FoldersItemListWidget()
+{
+}
+
+QPalette::ColorRole FoldersItemListWidget::normalTextColorPalette() const
+{
+ return QPalette::WindowText;
+}
+
+#include "foldersitemlistwidget.moc"
diff --git a/src/panels/folders/foldersitemlistwidget.h b/src/panels/folders/foldersitemlistwidget.h
new file mode 100644
index 000000000..fa7b143ae
--- /dev/null
+++ b/src/panels/folders/foldersitemlistwidget.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Emmanuel Pescosta <[email protected]>*
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#ifndef FOLDERSITEMLISTWIDGET_H
+#define FOLDERSITEMLISTWIDGET_H
+
+#include <kitemviews/kfileitemlistwidget.h>
+
+/**
+ * @brief Extends KFileItemListWidget to use the right text color.
+*/
+class FoldersItemListWidget : public KFileItemListWidget
+{
+ Q_OBJECT
+
+public:
+ FoldersItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent);
+ virtual ~FoldersItemListWidget();
+
+protected:
+ virtual QPalette::ColorRole normalTextColorPalette() const;
+};
+
+#endif
+
+
diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp
index 78e437a41..0760200b6 100644
--- a/src/panels/folders/folderspanel.cpp
+++ b/src/panels/folders/folderspanel.cpp
@@ -22,6 +22,7 @@
#include "dolphin_folderspanelsettings.h"
#include "dolphin_generalsettings.h"
#include "treeviewcontextmenu.h"
+#include "foldersitemlistwidget.h"
#include <kitemviews/kitemlistselectionmanager.h>
#include <kitemviews/kfileitemlistview.h>
@@ -120,6 +121,7 @@ void FoldersPanel::showEvent(QShowEvent* event)
// This assures that no performance and memory overhead is given when the folders panel is not
// used at all and stays invisible.
KFileItemListView* view = new KFileItemListView();
+ view->setWidgetCreator(new KItemListWidgetCreator<FoldersItemListWidget>());
view->setSupportsItemExpanding(true);
// Set the opacity to 0 initially. The opacity will be increased after the loading of the initial tree
// has been finished in slotLoadingCompleted(). This prevents an unnecessary animation-mess when
diff --git a/src/panels/places/placesitemlistwidget.cpp b/src/panels/places/placesitemlistwidget.cpp
index 24c2b3f11..00f0fdab0 100644
--- a/src/panels/places/placesitemlistwidget.cpp
+++ b/src/panels/places/placesitemlistwidget.cpp
@@ -35,4 +35,9 @@ bool PlacesItemListWidget::isHidden() const
return data().value("isHidden").toBool();
}
+QPalette::ColorRole PlacesItemListWidget::normalTextColorPalette() const
+{
+ return QPalette::WindowText;
+}
+
#include "placesitemlistwidget.moc"
diff --git a/src/panels/places/placesitemlistwidget.h b/src/panels/places/placesitemlistwidget.h
index d7a4f3ddd..93cd8f468 100644
--- a/src/panels/places/placesitemlistwidget.h
+++ b/src/panels/places/placesitemlistwidget.h
@@ -24,7 +24,7 @@
/**
* @brief Extends KStandardItemListWidget to interpret the hidden
- * property of the PlacesModel.
+ * property of the PlacesModel and use the right text color.
*/
class PlacesItemListWidget : public KStandardItemListWidget
{
@@ -36,6 +36,7 @@ public:
protected:
virtual bool isHidden() const;
+ virtual QPalette::ColorRole normalTextColorPalette() const;
};
#endif