Commit 1afe484b authored by Davide Gianforte's avatar Davide Gianforte

Configurable colors to rename line

Add to Konfigurator two options to set foreground and background colors to be
applied to the rename field.

BUG: 301034
BUG: 414968
FIXED: [ 301034 ] Rename input field doesn't respect text[NORMAL] when GTK theme is used
FIXED: [ 414968 ] Using provided custom colour package Midnight Commander, renaming files is difficult, as line colours are very pale.
ADDED: In Konfigurator, two options are added to set foreground and background colors to the rename field.
GUI: Two new options ("Rename background" and "Rename foreground") are seen by users.
parent 9198345c
......@@ -118,6 +118,8 @@ KgColors::KgColors(bool first, QWidget* parent) :
ADDITIONAL_COLOR sameAsMarkedForegnd = { i18n("Same as selected foreground"), getColorSelector("Marked Foreground")->getColor(), "Marked Foreground" };
addColorSelector("Marked Current Foreground", i18n("Selected current foreground:"), Qt::white, i18n("Not used"), &sameAsMarkedForegnd, 1);
addColorSelector("Current Background", i18n("Current background:"), Qt::white, i18n("Not used"), &sameAsBckgnd, 1);
addColorSelector("Rename Foreground", i18n("Rename foreground:"), getColorSelector("Foreground")->getColor(), i18n("Same as foreground"));
addColorSelector("Rename Background", i18n("Rename background:"), getColorSelector("Background")->getColor(), i18n("Same as background"));
colorsGrid->addWidget(createSpacer(colorsGrp), itemList.count() - offset, 1);
......
......@@ -23,6 +23,7 @@
#include "krviewproperties.h"
#include "../krglobal.h"
#include "../listpanel.h"
#include "../krcolorcache.h"
// QtGui
#include <QKeyEvent>
......@@ -72,6 +73,20 @@ void KrViewItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index
lineEdit->deselect();
lineEdit->setSelection(0, nameWithoutExt.length());
}
KrColorSettings colorSettings;
if (!colorSettings.getBoolValue("KDE Default")) {
QPalette renamePalette = lineEdit->palette();
if (!colorSettings.getColorTextValue("Rename Foreground").isEmpty())
renamePalette.setColor(QPalette::Text, colorSettings.getColorValue("Rename Foreground"));
if (!colorSettings.getColorTextValue("Rename Background").isEmpty())
renamePalette.setColor(QPalette::Base, colorSettings.getColorValue("Rename Background"));
lineEdit->setPalette(renamePalette);
}
}
}
......
......@@ -64,6 +64,7 @@ void KrColorSettingNames::initialize()
return;
s_colorNames["Foreground"] = true;
s_colorNames["Inactive Foreground"] = true;
s_colorNames["Rename Foreground"] = true;
s_colorNames["Directory Foreground"] = true;
s_colorNames["Inactive Directory Foreground"] = true;
s_colorNames["Executable Foreground"] = true;
......@@ -86,6 +87,7 @@ void KrColorSettingNames::initialize()
s_colorNames["Inactive Alternate Background"] = true;
s_colorNames["Background"] = true;
s_colorNames["Inactive Background"] = true;
s_colorNames["Rename Background"] = true;
s_colorNames["Alternate Marked Background"] = true;
s_colorNames["Inactive Alternate Marked Background"] = true;
s_colorNames["Dim Target Color"] = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment