panels/places/placesitemmodel.cpp
panels/places/placesitemsignalhandler.cpp
panels/panel.cpp
+ panels/folders/foldersitemlistwidget.cpp
panels/folders/treeviewcontextmenu.cpp
panels/folders/folderspanel.cpp
search/dolphinfacetswidget.cpp
return baseFont;
}
+QPalette::ColorRole KStandardItemListWidget::normalTextColorPalette() const
+{
+ return QPalette::Text;
+}
+
void KStandardItemListWidget::setTextColor(const QColor& color)
{
if (color != m_customTextColor) {
}
const QPalette::ColorGroup group = isActiveWindow() ? QPalette::Active : QPalette::Inactive;
- const QPalette::ColorRole role = isSelected() ? QPalette::HighlightedText : QPalette::Text;
+ const QPalette::ColorRole role = isSelected() ? QPalette::HighlightedText : normalTextColorPalette();
return styleOption().palette.brush(group, role).color();
}
const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, maxWidth);
textInfo->staticText.setText(elidedText);
requiredWidth = m_customizedFontMetrics.width(elidedText);
- } else if (role == "rating") {
+ } else if (role == "rating") {
// Use the width of the rating pixmap, because the rating text is empty.
requiredWidth = m_rating.width();
}
*/
virtual QFont customizedFont(const QFont& baseFont) const;
+ virtual QPalette::ColorRole normalTextColorPalette() const;
+
void setTextColor(const QColor& color);
QColor textColor() const;
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2012 by Emmanuel Pescosta <emmanuelpescosta099@gmail.com>*
+ * *
+ * 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"
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2012 by Emmanuel Pescosta <emmanuelpescosta099@gmail.com>*
+ * *
+ * 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
+
+
#include "dolphin_folderspanelsettings.h"
#include "dolphin_generalsettings.h"
#include "treeviewcontextmenu.h"
+#include "foldersitemlistwidget.h"
#include <kitemviews/kitemlistselectionmanager.h>
#include <kitemviews/kfileitemlistview.h>
// 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
return data().value("isHidden").toBool();
}
+QPalette::ColorRole PlacesItemListWidget::normalTextColorPalette() const
+{
+ return QPalette::WindowText;
+}
+
#include "placesitemlistwidget.moc"
/**
* @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
{
protected:
virtual bool isHidden() const;
+ virtual QPalette::ColorRole normalTextColorPalette() const;
};
#endif