From 42f6048291a576d6c72bb2c861f34c130713dc2d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 30 Apr 2021 22:35:08 +0300 Subject: [PATCH] viewsdialog:simplify code for semi-transparent text --- .../viewsdialog/delegates/namedelegate.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/app/settings/viewsdialog/delegates/namedelegate.cpp b/app/settings/viewsdialog/delegates/namedelegate.cpp index 18f272732..5a92f150c 100644 --- a/app/settings/viewsdialog/delegates/namedelegate.cpp +++ b/app/settings/viewsdialog/delegates/namedelegate.cpp @@ -59,24 +59,13 @@ void NameDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, Latte::Data::Screen screen = index.data(Model::Views::SCREENROLE).value(); Latte::Data::View view = index.data(Model::Views::VIEWROLE).value(); + float textopacity = 1.0; + if (isEmpty) { myOptions.text = "< " + i18n("optional") + " >"; - - QPalette::ColorRole applyColor = Latte::isSelected(option) ? QPalette::HighlightedText : QPalette::Text; - QBrush placeholderBrush = option.palette.brush(Latte::colorGroup(option), applyColor); - QColor placeholderColor = placeholderBrush.color(); - - QString cssplaceholdercolor = "rgba("; - cssplaceholdercolor += QString::number(placeholderColor.red()) + ","; - cssplaceholdercolor += QString::number(placeholderColor.green()) + ", "; - cssplaceholdercolor += QString::number(placeholderColor.blue()) + ", "; - cssplaceholdercolor += "128)"; - - myOptions.text = ""; + textopacity = 0.5; } - float textopacity = 1.0; - if (isActive) { myOptions.text = "" + myOptions.text + ""; }