Git commit b1b406448503db766c13f9510a9b13f33652830d by Alexander Semke.
Committed on 31/01/2016 at 22:00.
Pushed by asemke into branch 'gsoc2015-datapicker'.
1. Added tooltips to image edit widgets.
2. Some more polishment in ImageWidget.
M +251 -252 src/kdefrontend/ui/imagewidget.ui
M +40 -36 src/kdefrontend/widgets/ImageWidget.cpp
http://commits.kde.org/labplot/b1b406448503db766c13f9510a9b13f33652830d
diff --git a/src/kdefrontend/ui/imagewidget.ui b/src/kdefrontend/ui/imagewi=
dget.ui
index 1201ee8..e88dd55 100644
--- a/src/kdefrontend/ui/imagewidget.ui
+++ b/src/kdefrontend/ui/imagewidget.ui
@@ -6,7 +6,7 @@
0
0
- 1051
+ 1181
1181
@@ -34,23 +34,7 @@
- -
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Fixed
-
-
-
- 13
- 20
-
-
-
-
- -
+
-
@@ -60,14 +44,14 @@
- -
+
-
Comment
- -
+
-
@@ -77,7 +61,7 @@
- -
+
-
Qt::Vertical
@@ -93,7 +77,7 @@
- -
+
-
@@ -113,7 +97,7 @@
- -
+
-
Specify the name of the image file.
@@ -123,7 +107,7 @@
- -
+
-
@@ -139,21 +123,47 @@
- -
+
-
Type
- -
+
-
- -
+
-
+
+
+ Rotation
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ =C2=B0
+
+
+ -360.000000000000000
+
+
+ 360.000000000000000
+
+
+
+ -
Qt::Vertical
@@ -169,7 +179,7 @@
- -
+
-
@@ -182,14 +192,14 @@
- -
+
-
1.
- -
+
-
-
@@ -469,47 +479,103 @@
- -
+
-
2.
- -
+
-
3.
- -
-
+
-
+
+
+ x+y+z=3D
+
+
+
+ -
+
+
+ -
+
+
+
+ 75
+ true
+
+
+
+ Segments:
+
+
+
+ -
+
+
+ Length
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ px
+
+
+
+ -
+
+
+ Point separation
+
+
+
+ -
+
- Qt::Vertical
+ Qt::Horizontal
QSizePolicy::Fixed
- 20
- 18
+ 13
+ 23
- -
-
-
- x+y+z=3D
+
-
+
+
+
+ 0
+ 0
+
+
+
+ px
+
+
+
- -
-
-
- -
+
-
Qt::Vertical
@@ -522,6 +588,38 @@
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 18
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 18
+
+
+
+
@@ -529,7 +627,7 @@
Ref. Points Symbol
- -
+
-
@@ -542,13 +640,29 @@
- -
+
-
Style
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 13
+ 23
+
+
+
+
-
@@ -559,7 +673,7 @@
- -
+
-
Size
@@ -579,7 +693,7 @@
- -
+
-
Rotation
@@ -614,7 +728,7 @@
- -
+
-
Opacity
@@ -649,7 +763,23 @@
- -
+
-
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 18
+
+
+
+
+ -
@@ -662,7 +792,7 @@
- -
+
-
Style
@@ -672,7 +802,7 @@
-
- -
+
-
Color
@@ -689,7 +819,23 @@
- -
+
-
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 18
+
+
+
+
+ -
@@ -702,7 +848,7 @@
- -
+
-
Style
@@ -712,7 +858,7 @@
-
- -
+
-
Color
@@ -729,7 +875,7 @@
- -
+
-
Width
@@ -759,45 +905,13 @@
- -
+
-
visible
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 18
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 18
-
-
-
-
@@ -805,14 +919,32 @@
Edit Image
- -
-
+
-
+
+
+ -
+
+
+ -
+
+
+ -
+
- Current Image
+ Intensity
- -
+
-
+
+
+ -
+
+
+ -
+
+
+ -
@@ -825,6 +957,9 @@
+ -
+
+
-
@@ -841,35 +976,6 @@
- -
-
-
- -
-
-
- Hue
-
-
-
- -
-
-
- -
-
-
- -
-
-
- Saturation
-
-
-
- -
-
-
- -
-
-
-
@@ -877,135 +983,58 @@
- -
-
-
- -
-
-
- -
-
-
- Intensity
-
-
-
- -
-
-
- -
-
-
- -
-
+
-
+
- Foreground
+ Hue
- -
-
-
-
-
+
Qt::Vertical
-
- QSizePolicy::Fixed
-
20
- 18
+ 40
- -
-
+
-
+
- Rotation
+ Current Image
- -
-
-
-
- 0
- 0
-
-
-
- =C2=B0
-
-
- -360.000000000000000
-
-
- 360.000000000000000
-
-
+
-
+
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 18
-
-
-
+
-
+
- -
-
-
-
- 75
- true
-
-
+
-
+
- Segments:
+ Saturation
- -
-
+
-
+
- Min. length
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- px
+ Foreground
- -
-
-
- Min. point separation
-
-
+
-
+
- -
-
+
-
+
Qt::Horizontal
@@ -1020,35 +1049,6 @@
- -
-
-
-
- 0
- 0
-
-
-
- px
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
@@ -1088,7 +1088,6 @@
lHue
lSaturation
lValue
- sbRotation
diff --git a/src/kdefrontend/widgets/ImageWidget.cpp b/src/kdefrontend/widg=
ets/ImageWidget.cpp
index a33c8a6..658651c 100644
--- a/src/kdefrontend/widgets/ImageWidget.cpp
+++ b/src/kdefrontend/widgets/ImageWidget.cpp
@@ -131,25 +131,30 @@ ImageWidget::ImageWidget(QWidget *parent): QWidget(pa=
rent) {
editTabLayout->setHorizontalSpacing(2);
editTabLayout->setVerticalSpacing(4);
=
- ssIntensity =3D new QxtSpanSlider(Qt::Horizontal, ui.tEdit);
- ssIntensity->setRange(0, 100);
- editTabLayout->addWidget(ssIntensity, 3, 3);
-
- ssForeground =3D new QxtSpanSlider(Qt::Horizontal, ui.tEdit);
- ssForeground->setRange(0, 100);
- editTabLayout->addWidget(ssForeground, 5, 3);
-
ssHue =3D new QxtSpanSlider(Qt::Horizontal, ui.tEdit);
+ ssHue->setToolTip(i18n("Select the range for the hue.\nEverything outside=
of this range will be set to white."));
ssHue->setRange(0, 360);
- editTabLayout->addWidget(ssHue, 7, 3);
+ editTabLayout->addWidget(ssHue, 3, 2);
=
ssSaturation =3D new QxtSpanSlider(Qt::Horizontal, ui.tEdit);
+ ssSaturation->setToolTip(i18n("Select the range for the saturation.\nEver=
ything outside of this range will be set to white."));
ssSaturation->setRange(0,100);
- editTabLayout->addWidget(ssSaturation, 9, 3);
+ editTabLayout->addWidget(ssSaturation, 5, 2);
=
ssValue =3D new QxtSpanSlider(Qt::Horizontal, ui.tEdit);
+ ssValue->setToolTip(i18n("Select the range for the value, the degree of l=
ightness of the color.\nEverything outside of this range will be set to whi=
te."));
ssValue->setRange(0,100);
- editTabLayout->addWidget(ssValue, 11, 3);
+ editTabLayout->addWidget(ssValue, 7, 2);
+
+ ssIntensity =3D new QxtSpanSlider(Qt::Horizontal, ui.tEdit);
+ ssIntensity->setToolTip(i18n("Select the range for the intensity.\nEveryt=
hing outside of this range will be set to white."));
+ ssIntensity->setRange(0, 100);
+ editTabLayout->addWidget(ssIntensity, 9, 2);
+
+ ssForeground =3D new QxtSpanSlider(Qt::Horizontal, ui.tEdit);
+ ssForeground->setToolTip(i18n("Select the range for the colors that are n=
ot part of the background color.\nEverything outside of this range will be =
set to white."));
+ ssForeground->setRange(0, 100);
+ editTabLayout->addWidget(ssForeground, 11, 2);
=
ui.cbGraphType->addItem(i18n("Cartesian (x, y)"));
ui.cbGraphType->addItem(i18n("Polar (x, y=C2=B0)"));
@@ -176,23 +181,28 @@ ImageWidget::ImageWidget(QWidget *parent): QWidget(pa=
rent) {
QString saturationFile =3D KStandardDirs::locate("data", "labplot2/pics/c=
olorchooser/colorchooser_saturation.xpm");
=
gvHue =3D new HistogramView(ui.tEdit, ImageEditor::colorAttributeMax(Data=
pickerImage::Hue));
- editTabLayout->addWidget(gvHue, 2, 3);
+ gvHue->setToolTip(i18n("Select the range for the hue.\nEverything outside=
of this range will be set to white."));
+ editTabLayout->addWidget(gvHue, 2, 2);
gvHue->setScalePixmap(hueFile);
=
gvSaturation =3D new HistogramView(ui.tEdit, ImageEditor::colorAttributeM=
ax(DatapickerImage::Saturation));
- editTabLayout->addWidget(gvSaturation, 4, 3);
+ gvSaturation->setToolTip(i18n("Select the range for the saturation.\nEver=
ything outside of this range will be set to white."));
+ editTabLayout->addWidget(gvSaturation, 4, 2);
gvSaturation->setScalePixmap(saturationFile);
=
gvValue =3D new HistogramView(ui.tEdit, ImageEditor::colorAttributeMax(Da=
tapickerImage::Value));
- editTabLayout->addWidget(gvValue, 6,3);
+ gvValue->setToolTip(i18n("Select the range for the value, the degree of l=
ightness of the color.\nEverything outside of this range will be set to whi=
te."));
+ editTabLayout->addWidget(gvValue, 6,2);
gvValue->setScalePixmap(valueFile);
=
gvIntensity =3D new HistogramView(ui.tEdit, ImageEditor::colorAttributeMa=
x(DatapickerImage::Intensity));
- editTabLayout->addWidget(gvIntensity, 8, 3);
+ gvIntensity->setToolTip(i18n("Select the range for the intensity.\nEveryt=
hing outside of this range will be set to white."));
+ editTabLayout->addWidget(gvIntensity, 8, 2);
gvIntensity->setScalePixmap(valueFile);
=
gvForeground =3D new HistogramView(ui.tEdit, ImageEditor::colorAttributeM=
ax(DatapickerImage::Foreground));
- editTabLayout->addWidget(gvForeground, 10, 3);
+ gvForeground->setToolTip(i18n("Select the range for the colors that are n=
ot part of the background color.\nEverything outside of this range will be =
set to white."));
+ editTabLayout->addWidget(gvForeground, 10, 2);
gvForeground->setScalePixmap(valueFile);
=
connect( ssIntensity, SIGNAL(spanSliderMoved(int,int)), gvIntensity, SLOT=
(setSpan(int,int)) );
@@ -322,36 +332,30 @@ void ImageWidget::initConnections() {
connect( m_image, SIGNAL(pointBrushChanged(QBrush)), this, SLOT(symbolBru=
shChanged(QBrush)) );
connect( m_image, SIGNAL(pointPenChanged(QPen)), this, SLOT(symbolPenChan=
ged(QPen)) );
connect( m_image, SIGNAL(pointVisibilityChanged(bool)), this, SLOT(symbol=
VisibleChanged(bool)) );
-
}
=
void ImageWidget::handleWidgetActions() {
QString fileName =3D ui.kleFileName->text().trimmed();
- if (!fileName.isEmpty()) {
- ui.tEdit->setEnabled(true);
- ui.cbGraphType->setEnabled(true);
- ui.sbPoisitionX1->setEnabled(true);
- ui.sbPoisitionX2->setEnabled(true);
- ui.sbPoisitionX3->setEnabled(true);
- ui.sbPoisitionY1->setEnabled(true);
- ui.sbPoisitionY2->setEnabled(true);
- ui.sbPoisitionY3->setEnabled(true);
-
+ bool b =3D !fileName.isEmpty();
+ ui.tEdit->setEnabled(b);
+ ui.cbGraphType->setEnabled(b);
+ ui.sbRotation->setEnabled(b);
+ ui.sbPoisitionX1->setEnabled(b);
+ ui.sbPoisitionX2->setEnabled(b);
+ ui.sbPoisitionX3->setEnabled(b);
+ ui.sbPoisitionY1->setEnabled(b);
+ ui.sbPoisitionY2->setEnabled(b);
+ ui.sbPoisitionY3->setEnabled(b);
+ ui.sbMinSegmentLength->setEnabled(b);
+ ui.sbPointSeparation->setEnabled(b);
+
+ if (b) {
//upload histogram to view
gvIntensity->bins =3D m_image->intensityBins;
gvForeground->bins =3D m_image->foregroundBins;
gvHue->bins =3D m_image->hueBins;
gvSaturation->bins =3D m_image->saturationBins;
gvValue->bins =3D m_image->valueBins;
- } else {
- ui.tEdit->setEnabled(false);
- ui.cbGraphType->setEnabled(false);
- ui.sbPoisitionX1->setEnabled(false);
- ui.sbPoisitionX2->setEnabled(false);
- ui.sbPoisitionX3->setEnabled(false);
- ui.sbPoisitionY1->setEnabled(false);
- ui.sbPoisitionY2->setEnabled(false);
- ui.sbPoisitionY3->setEnabled(false);
}
}
=20