[Kst] branches/work/kst/portto4/kst/src/widgets
Nicolas Brisset
nicolas.brisset at eurocopter.com
Sun Mar 18 17:34:09 UTC 2012
SVN commit 1286206 by brisset:
Rework CurveAppearance::enableSettings() to make sure it does what we want. Previously the point density widget was not always enabled when we needed it.
When using points only, density is forced to "All", I think we had already discussed that and decided something else does not make sense.
M +16 -10 curveappearance.cpp
--- branches/work/kst/portto4/kst/src/widgets/curveappearance.cpp #1286205:1286206
@@ -129,30 +129,36 @@
void CurveAppearance::enableSettings() {
bool enable;
+ // Use an intermediate boolean to avoid having to use setEnabled(true) and setEnabled(false)
+ // Leave text labels enabled for now, it should be enough to disable the widgets
+
+ // Line appearance options common to lines and bars
enable = showLines() || showBars();
+ _color->setEnabled(enable);
_comboLineStyle->setEnabled(enable);
- //_textLabelLineStyle->setEnabled(enable);
-
- enable = enable || showPoints();
- _textLabelWeight->setEnabled(enable);
+ // _textLabelWeight->setEnabled(enable);
_spinBoxLineWidth->setEnabled(enable);
-
+ // Option specific to bars
enable = showBars();
- _textLabelBarStyle->setEnabled(enable);
_barFillColor->setEnabled(enable);
+ // _textLabelBarStyle->setEnabled(enable);
+ // Now point options
enable = showPoints();
- _textLabelPointStyle->setEnabled(enable);
_comboPointSymbol->setEnabled(enable);
-
+ // _textLabelPointStyle->setEnabled(enable);
+ // Set point density to all by default
+ _comboPointDensity->setCurrentIndex(0); // 0 is "All"
+ // and disable widget if not using lines, as using only points and not plotting all of them sounds weird
enable = enable && showLines();
- _textLabelPointDensity->setEnabled(enable);
_comboPointDensity->setEnabled(enable);
+ // _textLabelPointDensity->setEnabled(enable);
+ // Heads
enable = showHead();
- _textLabelHeadStyle->setEnabled(enable);
_comboHeadSymbol->setEnabled(enable);
_headColor->setEnabled(enable);
+ // _textLabelHeadStyle->setEnabled(enable);
}
More information about the Kst
mailing list