Fixed Bug 396528
Needs RevisionPublic

Authored by anujgoyal on Oct 7 2018, 12:12 PM.

Details

Reviewers
scottpetrovic
rempt
dkazakov
Group Reviewers
Krita
Summary

fixed the bug 396528

  • Increased the size of curveWidget and now it's taking all space available by own its own.
  • also in some of the sensors there is some explanation provided along with values in Qlabel.so,made the label to appear in the the Tool-tip for better view and also underlined the labels who have tool-tip for everyone to know that there must be something out there like tool-tip.( as discussed on irc with scottyp as this will going to help him on his patch).
  • Updated some minor changes in the dialog like size of push buttons etc.

Before

After

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
anujgoyal requested review of this revision.Oct 7 2018, 12:12 PM
anujgoyal created this revision.

This looks good to me.

Committer note:
Before we commit this to master, we need to figure out how this will work with 2 other patches that have brush editor changes.

  1. https://phabricator.kde.org/D16009 (this patch with adding tooltips)
  2. https://phabricator.kde.org/D16008 (giant UI patch with resizing most brush editor UI files to shrink it by 1/2)
  3. https://phabricator.kde.org/D15903 (patch to add input fields to the curve so people can see and change where a node is at)

To be able to merge these, I think we will need to apply patch #2 first, then apply patch #1 and #2. The main merge conflicts with all of these will be in the UI files. I don't think there is going to be much conflict in the actual code files, so I think figuring out how to get the UI files merged is going to be the tricky part.

My thinking now is t

This revision is now accepted and ready to land.Oct 7 2018, 1:16 PM

I think for merging the ui file the only option is that anyone of us have to make UI file by taking into account of all the ui files

rempt added a comment.Oct 10 2018, 1:42 PM

I think the aspect ratio of the widget itself needs to remain square?

rempt added a comment.Oct 10 2018, 1:57 PM

I would prefer a clear icon to be shown that would expand to show the help text on clicking. Tooltips are not very discoverable, especially if people are using a stylus.

anujgoyal updated this revision to Diff 43314.Oct 10 2018, 2:49 PM

Now the aspect ratio of the curve widget is square. you can checkout.
and currently working on the adding icon .

anujgoyal updated this revision to Diff 43477.Oct 12 2018, 4:08 PM
anujgoyal updated this revision to Diff 43478.Oct 12 2018, 4:13 PM

the above are the changed and the icon is added to label with tooltip .

anujgoyal updated this revision to Diff 43479.Oct 12 2018, 4:15 PM

i think that if the user sees a different icon on only the 3 options than the user will definitely try to hover over it either intentionally or unintentionally .and will get to know that we get the explanation on hovering over.what do you think .So i,don't think there is any need of clickable icon as far as i think.please provide your feedbacks .

i think its accepted but not commited .if required any changes or if its not useful than please let me know

@rempt please rereview this or commit it.

Anush, could you give us a firstname, lastname and email adress that we can attach to the commit?

@woltherav

It's not Anush . Full name is Anuj Goyal and email id is :- anujg935@gmail.com

The patch doesn't apply on master...

The patch has a lot of commented out code and doesn't do what it is intended to do: the widget is not scaled:

This is the version of the patch I tried against master:

1diff --git a/libs/ui/widgets/kis_curve_widget.cpp b/libs/ui/widgets/kis_curve_widget.cpp
2index 9f18242..befd7c0 100644
3--- a/libs/ui/widgets/kis_curve_widget.cpp
4+++ b/libs/ui/widgets/kis_curve_widget.cpp
5@@ -77,7 +77,7 @@ KisCurveWidget::KisCurveWidget(QWidget *parent, Qt::WindowFlags f)
6 setAutoFillBackground(false);
7 setAttribute(Qt::WA_OpaquePaintEvent);
8 setMinimumSize(150, 50);
9- setMaximumSize(250, 250);
10+ setMaximumSize(16777215, 16777215);
11
12 d->setCurveModified();
13
14diff --git a/plugins/paintops/colorsmudge/kis_colorsmudgeop_settings_widget.cpp b/plugins/paintops/colorsmudge/kis_colorsmudgeop_settings_widget.cpp
15index 6ba0de7..6504cc3 100644
16--- a/plugins/paintops/colorsmudge/kis_colorsmudgeop_settings_widget.cpp
17+++ b/plugins/paintops/colorsmudge/kis_colorsmudgeop_settings_widget.cpp
18@@ -63,9 +63,9 @@ KisColorSmudgeOpSettingsWidget::KisColorSmudgeOpSettingsWidget(QWidget* parent):
19 addPaintOpOption(new KisPressureScatterOptionWidget(), i18n("Scatter"));
20 addPaintOpOption(new KisOverlayModeOptionWidget(), i18n("Overlay Mode"));
21 addPaintOpOption(new KisCurveOptionWidget(new KisPressureGradientOption(), i18n("0%"), i18n("100%")), i18n("Gradient"));
22- addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createHueOption(), KisPressureHSVOption::hueMinLabel(), KisPressureHSVOption::huemaxLabel()), i18n("Hue"));
23- addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createSaturationOption(), KisPressureHSVOption::saturationMinLabel(), KisPressureHSVOption::saturationmaxLabel()), i18n("Saturation"));
24- addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createValueOption(), KisPressureHSVOption::valueMinLabel(), KisPressureHSVOption::valuemaxLabel()), i18nc("HSV Value", "Value"));
25+ addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createHueOption(), KisPressureHSVOption::hueMinLabel(), KisPressureHSVOption::huemaxLabel(),false,KisPressureHSVOption::hueMinToolTip(),KisPressureHSVOption::hueMaxToolTip()), i18n("Hue"));
26+ addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createSaturationOption(), KisPressureHSVOption::saturationMinLabel(), KisPressureHSVOption::saturationmaxLabel(),false,KisPressureHSVOption::saturationMinToolTip(),KisPressureHSVOption::saturationMaxToolTip()), i18n("Saturation"));
27+ addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createValueOption(), KisPressureHSVOption::valueMinLabel(), KisPressureHSVOption::valuemaxLabel(),false,KisPressureHSVOption::valueMinToolTip(),KisPressureHSVOption::valueMaxToolTip()), i18nc("HSV Value", "Value"));
28
29 addPaintOpOption(new KisTextureOption(), i18n("Pattern"));
30 addPaintOpOption(new KisCurveOptionWidget(new KisPressureTextureStrengthOption(), i18n("Weak"), i18n("Strong")), i18n("Strength"));
31diff --git a/plugins/paintops/defaultpaintops/brush/kis_brushop_settings_widget.cpp b/plugins/paintops/defaultpaintops/brush/kis_brushop_settings_widget.cpp
32index b0d7b31..52eb9bc 100644
33--- a/plugins/paintops/defaultpaintops/brush/kis_brushop_settings_widget.cpp
34+++ b/plugins/paintops/defaultpaintops/brush/kis_brushop_settings_widget.cpp
35@@ -74,9 +74,9 @@ KisBrushOpSettingsWidget::KisBrushOpSettingsWidget(QWidget* parent)
36 addPaintOpOption(new KisColorSourceOptionWidget(), i18n("Source"));
37 addPaintOpOption(new KisCurveOptionWidget(new KisPressureDarkenOption(), i18n("0.0"), i18n("1.0")), i18n("Darken"));
38 addPaintOpOption(new KisCurveOptionWidget(new KisPressureMixOption(), i18n("Foreground"), i18n("Background")), i18n("Mix"));
39- addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createHueOption(), KisPressureHSVOption::hueMinLabel(), KisPressureHSVOption::huemaxLabel()), i18n("Hue"));
40- addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createSaturationOption(), KisPressureHSVOption::saturationMinLabel(), KisPressureHSVOption::saturationmaxLabel()), i18n("Saturation"));
41- addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createValueOption(), KisPressureHSVOption::valueMinLabel(), KisPressureHSVOption::valuemaxLabel()), i18nc("HSV Value", "Value"));
42+ addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createHueOption(), KisPressureHSVOption::hueMinLabel(), KisPressureHSVOption::huemaxLabel(),false,KisPressureHSVOption::hueMinToolTip(),KisPressureHSVOption::hueMaxToolTip()), i18n("Hue"));
43+ addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createSaturationOption(), KisPressureHSVOption::saturationMinLabel(), KisPressureHSVOption::saturationmaxLabel(),false,KisPressureHSVOption::saturationMinToolTip(), KisPressureHSVOption::saturationMaxToolTip()), i18n("Saturation"));
44+ addPaintOpOption(new KisCurveOptionWidget(KisPressureHSVOption::createValueOption(), KisPressureHSVOption::valueMinLabel(), KisPressureHSVOption::valuemaxLabel(),false,KisPressureHSVOption::valueMinToolTip(),KisPressureHSVOption::valueMaxToolTip()), i18nc("HSV Value", "Value"));
45 addPaintOpOption(new KisAirbrushOptionWidget(false), i18n("Airbrush"));
46 addPaintOpOption(new KisCurveOptionWidget(new KisPressureRateOption(), i18n("0%"), i18n("100%")), i18n("Rate"));
47
48diff --git a/plugins/paintops/libpaintop/forms/wdgcurveoption.ui b/plugins/paintops/libpaintop/forms/wdgcurveoption.ui
49index 0dd0a42..24a613d 100644
50--- a/plugins/paintops/libpaintop/forms/wdgcurveoption.ui
51+++ b/plugins/paintops/libpaintop/forms/wdgcurveoption.ui
52@@ -42,6 +42,9 @@
53 </item>
54 <item>
55 <layout class="QHBoxLayout" name="horizontalLayout_2">
56+ <property name="spacing">
57+ <number>6</number>
58+ </property>
59 <item>
60 <widget class="QCheckBox" name="checkBoxUseCurve">
61 <property name="minimumSize">
62@@ -57,10 +60,16 @@
63 </item>
64 <item>
65 <widget class="QPushButton" name="linearCurveButton">
66+ <property name="sizePolicy">
67+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
68+ <horstretch>0</horstretch>
69+ <verstretch>0</verstretch>
70+ </sizepolicy>
71+ </property>
72 <property name="maximumSize">
73 <size>
74- <width>24</width>
75- <height>24</height>
76+ <width>32</width>
77+ <height>32</height>
78 </size>
79 </property>
80 <property name="text">
81@@ -76,10 +85,16 @@
82 </item>
83 <item>
84 <widget class="QPushButton" name="revLinearButton">
85+ <property name="sizePolicy">
86+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
87+ <horstretch>0</horstretch>
88+ <verstretch>0</verstretch>
89+ </sizepolicy>
90+ </property>
91 <property name="maximumSize">
92 <size>
93- <width>24</width>
94- <height>24</height>
95+ <width>32</width>
96+ <height>32</height>
97 </size>
98 </property>
99 <property name="text">
100@@ -95,10 +110,16 @@
101 </item>
102 <item>
103 <widget class="QPushButton" name="sCurveButton">
104+ <property name="sizePolicy">
105+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
106+ <horstretch>0</horstretch>
107+ <verstretch>0</verstretch>
108+ </sizepolicy>
109+ </property>
110 <property name="maximumSize">
111 <size>
112- <width>24</width>
113- <height>24</height>
114+ <width>32</width>
115+ <height>32</height>
116 </size>
117 </property>
118 <property name="text">
119@@ -114,10 +135,16 @@
120 </item>
121 <item>
122 <widget class="QPushButton" name="reverseSCurveButton">
123+ <property name="sizePolicy">
124+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
125+ <horstretch>0</horstretch>
126+ <verstretch>0</verstretch>
127+ </sizepolicy>
128+ </property>
129 <property name="maximumSize">
130 <size>
131- <width>24</width>
132- <height>24</height>
133+ <width>32</width>
134+ <height>32</height>
135 </size>
136 </property>
137 <property name="text">
138@@ -133,10 +160,16 @@
139 </item>
140 <item>
141 <widget class="QPushButton" name="uCurveButton">
142+ <property name="sizePolicy">
143+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
144+ <horstretch>0</horstretch>
145+ <verstretch>0</verstretch>
146+ </sizepolicy>
147+ </property>
148 <property name="maximumSize">
149 <size>
150- <width>24</width>
151- <height>24</height>
152+ <width>32</width>
153+ <height>32</height>
154 </size>
155 </property>
156 <property name="text">
157@@ -152,10 +185,16 @@
158 </item>
159 <item>
160 <widget class="QPushButton" name="revUCurveButton">
161+ <property name="sizePolicy">
162+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
163+ <horstretch>0</horstretch>
164+ <verstretch>0</verstretch>
165+ </sizepolicy>
166+ </property>
167 <property name="maximumSize">
168 <size>
169- <width>24</width>
170- <height>24</height>
171+ <width>32</width>
172+ <height>32</height>
173 </size>
174 </property>
175 <property name="text">
176@@ -171,10 +210,16 @@
177 </item>
178 <item>
179 <widget class="QPushButton" name="jCurveButton">
180+ <property name="sizePolicy">
181+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
182+ <horstretch>0</horstretch>
183+ <verstretch>0</verstretch>
184+ </sizepolicy>
185+ </property>
186 <property name="maximumSize">
187 <size>
188- <width>24</width>
189- <height>24</height>
190+ <width>32</width>
191+ <height>32</height>
192 </size>
193 </property>
194 <property name="text">
195@@ -190,10 +235,16 @@
196 </item>
197 <item>
198 <widget class="QPushButton" name="lCurveButton">
199+ <property name="sizePolicy">
200+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
201+ <horstretch>0</horstretch>
202+ <verstretch>0</verstretch>
203+ </sizepolicy>
204+ </property>
205 <property name="maximumSize">
206 <size>
207- <width>24</width>
208- <height>24</height>
209+ <width>32</width>
210+ <height>32</height>
211 </size>
212 </property>
213 <property name="text">
214@@ -251,32 +302,6 @@
215 </item>
216 <item>
217 <layout class="QGridLayout" name="gridLayout_2">
218- <item row="0" column="3">
219- <spacer name="horizontalSpacer_2">
220- <property name="orientation">
221- <enum>Qt::Horizontal</enum>
222- </property>
223- <property name="sizeHint" stdset="0">
224- <size>
225- <width>2</width>
226- <height>2</height>
227- </size>
228- </property>
229- </spacer>
230- </item>
231- <item row="3" column="1">
232- <spacer name="verticalSpacer">
233- <property name="orientation">
234- <enum>Qt::Vertical</enum>
235- </property>
236- <property name="sizeHint" stdset="0">
237- <size>
238- <width>2</width>
239- <height>2</height>
240- </size>
241- </property>
242- </spacer>
243- </item>
244 <item row="1" column="1">
245 <widget class="QCheckBox" name="checkBoxUseSameCurve">
246 <property name="text">
247@@ -289,6 +314,9 @@
248 </item>
249 <item row="0" column="1">
250 <layout class="QGridLayout" name="gridLayout">
251+ <property name="spacing">
252+ <number>3</number>
253+ </property>
254 <item row="2" column="1">
255 <layout class="QVBoxLayout" name="verticalLayout">
256 <item>
257@@ -302,6 +330,9 @@
258 <verstretch>0</verstretch>
259 </sizepolicy>
260 </property>
261+ <property name="styleSheet">
262+ <string notr="true">color:white;</string>
263+ </property>
264 <property name="text">
265 <string comment="KDE::DoNotExtract">TextLabel</string>
266 </property>
267@@ -371,6 +402,9 @@
268 <verstretch>0</verstretch>
269 </sizepolicy>
270 </property>
271+ <property name="styleSheet">
272+ <string notr="true">color:white;</string>
273+ </property>
274 <property name="text">
275 <string comment="KDE::DoNotExtract">TextLabel</string>
276 </property>
277@@ -388,6 +422,9 @@
278 <verstretch>0</verstretch>
279 </sizepolicy>
280 </property>
281+ <property name="styleSheet">
282+ <string notr="true">color:white;</string>
283+ </property>
284 <property name="text">
285 <string comment="KDE::DoNotExtract">TextLabel</string>
286 </property>
287@@ -451,6 +488,9 @@
288 <verstretch>0</verstretch>
289 </sizepolicy>
290 </property>
291+ <property name="styleSheet">
292+ <string notr="true">color:white;</string>
293+ </property>
294 <property name="text">
295 <string comment="KDE::DoNotExtract">TextLabel</string>
296 </property>
297@@ -461,15 +501,15 @@
298 <item row="2" column="0">
299 <widget class="KisCurveWidget" name="curveWidget" native="true">
300 <property name="sizePolicy">
301- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
302- <horstretch>1</horstretch>
303+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
304+ <horstretch>0</horstretch>
305 <verstretch>0</verstretch>
306 </sizepolicy>
307 </property>
308 <property name="minimumSize">
309 <size>
310- <width>200</width>
311- <height>200</height>
312+ <width>0</width>
313+ <height>0</height>
314 </size>
315 </property>
316 </widget>
317diff --git a/plugins/paintops/libpaintop/kis_curve_option_widget.cpp b/plugins/paintops/libpaintop/kis_curve_option_widget.cpp
318index ead1835..89dc525 100644
319--- a/plugins/paintops/libpaintop/kis_curve_option_widget.cpp
320+++ b/plugins/paintops/libpaintop/kis_curve_option_widget.cpp
321@@ -28,7 +28,10 @@
322 #include "kis_curve_option.h"
323 #include "kis_signals_blocker.h"
324 #include "kis_icon_utils.h"
325-
326+#include <QPixmap>
327+#include <QPainter>
328+#include <QFont>
329+#include <QFontMetrics>
330 inline void setLabel(QLabel* label, const KisCurveLabel& curve_label)
331 {
332 if (curve_label.icon().isNull()) {
333@@ -38,8 +41,27 @@ inline void setLabel(QLabel* label, const KisCurveLabel& curve_label)
334 label->setPixmap(QPixmap::fromImage(curve_label.icon()));
335 }
336 }
337-
338-KisCurveOptionWidget::KisCurveOptionWidget(KisCurveOption* curveOption, const QString &minLabel, const QString &maxLabel, bool hideSlider)
339+inline QPixmap mergeImageText( const QPixmap& pix, const QString txt )
340+ {
341+ QPainter p;
342+
343+ int strWidth = p.fontMetrics().width( txt );
344+ int strHeight = p.fontMetrics().height();
345+ int pixWidth = pix.width();
346+ int pixHeight = pix.height();
347+ QPixmap res( strWidth + 3 + pixWidth, std::max( strHeight, pixHeight ) );
348+
349+ res.fill(Qt::transparent);
350+
351+ p.begin( &res );
352+ p.drawPixmap(0,0, pix );
353+ p.setPen(Qt::white);
354+ p.drawText( QRect( pixWidth +3, 0, strWidth, strHeight), 0, txt);
355+ p.end();
356+
357+ return res;
358+ }
359+KisCurveOptionWidget::KisCurveOptionWidget(KisCurveOption* curveOption, const QString &minLabel, const QString &maxLabel, bool hideSlider, const QString &minLabel_tooltip, const QString &maxLabel_tooltip)
360 : KisPaintOpOption(curveOption->category(), curveOption->isChecked())
361 , m_widget(new QWidget)
362 , m_curveOptionWidget(new Ui_WdgCurveOption())
363@@ -76,9 +98,33 @@ KisCurveOptionWidget::KisCurveOptionWidget(KisCurveOption* curveOption, const QS
364 connect(m_curveOptionWidget->uCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveUShape()));
365 connect(m_curveOptionWidget->revUCurveButton, SIGNAL(clicked(bool)), this, SLOT(changeCurveArchShape()));
366
367-
368- m_curveOptionWidget->label_ymin->setText(minLabel);
369- m_curveOptionWidget->label_ymax->setText(maxLabel);
370+ QPixmap pix((KisIconUtils::loadIcon("help-contents")).pixmap(15, 15));
371+ m_curveOptionWidget->label_ymin->setStyleSheet("color:white;");
372+ m_curveOptionWidget->label_ymax->setStyleSheet("color:white;");
373+ if(minLabel_tooltip !="" || maxLabel_tooltip !=""){
374+ QPixmap minL = mergeImageText(pix,minLabel);
375+ QPixmap maxL = mergeImageText(pix,maxLabel);
376+
377+ m_curveOptionWidget->label_ymin->setPixmap(minL);
378+ m_curveOptionWidget->label_ymax->setPixmap(maxL);
379+ m_curveOptionWidget->label_ymin->setToolTip(minLabel_tooltip);
380+ m_curveOptionWidget->label_ymax->setToolTip(maxLabel_tooltip);
381+ /*m_curveOptionWidget->label_ymin->setTextFormat(Qt::RichText);
382+ m_curveOptionWidget->label_ymax->setTextFormat(Qt::RichText);
383+ m_curveOptionWidget->label_ymin->setText("<img src=":/help-contents.svg"> + minLabel");
384+ m_curveOptionWidget->label_ymax->setText("<img src=":/help-contents.svg "> + maxLabel");
385+ setText("<img src=":/myimage.png">Hello!");
386+ m_curveOptionWidget->label_ymax->setStyleSheet("background-image: url(images/welcome.png);")*/
387+ }
388+ else{
389+ QPixmap minL = mergeImageText(QPixmap(0,0),minLabel);
390+ QPixmap maxL = mergeImageText(QPixmap(0,0),maxLabel);
391+
392+ m_curveOptionWidget->label_ymin->setPixmap(minL);
393+ m_curveOptionWidget->label_ymax->setPixmap(maxL);/*
394+ m_curveOptionWidget->label_ymin->setText(minLabel);
395+ m_curveOptionWidget->label_ymax->setText(maxLabel);*/
396+ }
397
398 // strength settings is shown as 0-100%
399 m_curveOptionWidget->strengthSlider->setRange(curveOption->minValue()*100, curveOption->maxValue()*100, 0);
400diff --git a/plugins/paintops/libpaintop/kis_curve_option_widget.h b/plugins/paintops/libpaintop/kis_curve_option_widget.h
401index eae9d1b..8b2319e 100644
402--- a/plugins/paintops/libpaintop/kis_curve_option_widget.h
403+++ b/plugins/paintops/libpaintop/kis_curve_option_widget.h
404@@ -34,7 +34,7 @@ class PAINTOP_EXPORT KisCurveOptionWidget : public KisPaintOpOption
405 {
406 Q_OBJECT
407 public:
408- KisCurveOptionWidget(KisCurveOption* curveOption, const QString &minLabel, const QString &maxLabel, bool hideSlider = false);
409+ KisCurveOptionWidget(KisCurveOption* curveOption, const QString &minLabel, const QString &maxLabel, bool hideSlider = false, const QString &minLabel_tooltip="", const QString &maxLabel_tooltip="");
410 ~KisCurveOptionWidget() override;
411
412 void writeOptionSetting(KisPropertiesConfigurationSP setting) const override;
413diff --git a/plugins/paintops/libpaintop/kis_pressure_hsv_option.cpp b/plugins/paintops/libpaintop/kis_pressure_hsv_option.cpp
414index d6a7f74..6538854 100644
415--- a/plugins/paintops/libpaintop/kis_pressure_hsv_option.cpp
416+++ b/plugins/paintops/libpaintop/kis_pressure_hsv_option.cpp
417@@ -26,24 +26,34 @@ KisPressureHSVOption* KisPressureHSVOption::createHueOption() {
418
419 QString KisPressureHSVOption::hueMinLabel()
420 {
421- // xgettext: no-c-format
422- QString activeColorMsg = i18n("(0° is active color)");
423- QString br("<br />");
424 QString fullPercent = i18n("+180°");
425 QString zeroPercent = i18n("-180°");
426
427- return QString(zeroPercent + br + i18n("CCW hue") + br + activeColorMsg);
428+ return QString(zeroPercent);
429 }
430
431-QString KisPressureHSVOption::huemaxLabel()
432+QString KisPressureHSVOption::hueMinToolTip()
433 {
434 // xgettext: no-c-format
435 QString activeColorMsg = i18n("(0° is active color)");
436 QString br("<br />");
437+ return QString(i18n("CCW hue") + br + activeColorMsg);
438+}
439+
440+QString KisPressureHSVOption::huemaxLabel()
441+{
442 QString fullPercent = i18n("+180°");
443 QString zeroPercent = i18n("-180°");
444
445- return QString(fullPercent + br + i18n("CW hue"));
446+ return QString(fullPercent);
447+}
448+
449+QString KisPressureHSVOption::hueMaxToolTip()
450+{
451+ // xgettext: no-c-format
452+ QString activeColorMsg = i18n("(0° is active color)");
453+ QString br("<br />");
454+ return QString(i18n("CW hue") + br + activeColorMsg);
455 }
456
457 KisPressureHSVOption* KisPressureHSVOption::createSaturationOption() {
458@@ -52,25 +62,36 @@ KisPressureHSVOption* KisPressureHSVOption::createSaturationOption() {
459
460 QString KisPressureHSVOption::saturationMinLabel()
461 {
462- // xgettext: no-c-format
463- QString activeColorMsg = i18n("(50% is active color)");
464- QString br("<br />");
465 QString fullPercent = i18n("+100%");
466 QString zeroPercent = i18n("-100%");
467
468- return QString(zeroPercent + br + i18n("Less saturation ") + br + activeColorMsg);
469+ return QString(zeroPercent);
470
471 }
472
473-QString KisPressureHSVOption::saturationmaxLabel()
474+QString KisPressureHSVOption::saturationMinToolTip()
475 {
476 // xgettext: no-c-format
477 QString activeColorMsg = i18n("(50% is active color)");
478 QString br("<br />");
479+
480+ return QString(i18n("Less saturation ") + br + activeColorMsg);
481+}
482+
483+QString KisPressureHSVOption::saturationmaxLabel()
484+{
485 QString fullPercent = i18n("+100%");
486 QString zeroPercent = i18n("-100%");
487
488- return QString(fullPercent + br + i18n("More saturation"));
489+ return QString(fullPercent);
490+}
491+
492+QString KisPressureHSVOption::saturationMaxToolTip()
493+{
494+ // xgettext: no-c-format
495+ QString activeColorMsg = i18n("(50% is active color)");
496+ QString br("<br />");
497+ return QString(i18n("More saturation") + br + activeColorMsg);
498 }
499
500 KisPressureHSVOption* KisPressureHSVOption::createValueOption() {
501@@ -79,29 +100,40 @@ KisPressureHSVOption* KisPressureHSVOption::createValueOption() {
502
503 QString KisPressureHSVOption::valueMinLabel()
504 {
505- // xgettext: no-c-format
506- QString activeColorMsg = i18n("(50% is active color)");
507- QString br("<br />");
508 QString fullPercent = i18n("+100%");
509 QString zeroPercent = i18n("-100%");
510
511- return QString(zeroPercent + br + i18n("Lower value ") + br + activeColorMsg);
512+ return QString(zeroPercent);// + br + i18n("Lower value ") + br + activeColorMsg);
513
514 }
515
516-QString KisPressureHSVOption::valuemaxLabel()
517+QString KisPressureHSVOption::valueMinToolTip()
518 {
519 // xgettext: no-c-format
520 QString activeColorMsg = i18n("(50% is active color)");
521 QString br("<br />");
522+
523+ return QString(i18n("Lower value ") + br + activeColorMsg);
524+}
525+
526+QString KisPressureHSVOption::valuemaxLabel()
527+{
528 QString fullPercent = i18n("+100%");
529 QString zeroPercent = i18n("-100%");
530
531- return QString(fullPercent + br + i18n("Higher value"));
532+ return QString(fullPercent);// + br + i18n("Higher value"));
533
534
535 }
536
537+QString KisPressureHSVOption::valueMaxToolTip()
538+{
539+ // xgettext: no-c-format
540+ QString activeColorMsg = i18n("(50% is active color)");
541+ QString br("<br />");
542+ return QString(i18n("Higher value")+ br + activeColorMsg);
543+}
544+
545 struct KisPressureHSVOption::Private
546 {
547 QString parameterName;
548diff --git a/plugins/paintops/libpaintop/kis_pressure_hsv_option.h b/plugins/paintops/libpaintop/kis_pressure_hsv_option.h
549index e586c95..12d1546 100644
550--- a/plugins/paintops/libpaintop/kis_pressure_hsv_option.h
551+++ b/plugins/paintops/libpaintop/kis_pressure_hsv_option.h
552@@ -36,15 +36,21 @@ class PAINTOP_EXPORT KisPressureHSVOption : public KisCurveOption
553 public:
554 static KisPressureHSVOption* createHueOption();
555 static QString hueMinLabel();
556+ static QString hueMinToolTip();
557 static QString huemaxLabel();
558+ static QString hueMaxToolTip();
559
560 static KisPressureHSVOption* createSaturationOption();
561 static QString saturationMinLabel();
562+ static QString saturationMinToolTip();
563 static QString saturationmaxLabel();
564+ static QString saturationMaxToolTip();
565
566 static KisPressureHSVOption* createValueOption();
567 static QString valueMinLabel();
568+ static QString valueMinToolTip();
569 static QString valuemaxLabel();
570+ static QString valueMaxToolTip();
571 public:
572
573 KisPressureHSVOption(const QString& parameterName);

plugins/paintops/libpaintop/kis_curve_option_widget.cpp
18

These lines give warnings like:

QPainter::fontMetrics: Painter not active
43

I'm not sure we should push it.

dkazakov requested changes to this revision.Mar 25 2019, 7:10 PM
This revision now requires changes to proceed.Mar 25 2019, 7:10 PM