[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Tue Jan 31 05:45:19 CET 2006
SVN commit 504021 by staikos:
- make transparent label/legend space movable from the transparent regions
- make transparent labels update the clip mask appropriately
- fix the margin size in labels and legends
Reviewed by Barth
BUG: 121064
M +6 -3 kstviewlabel.cpp
M +6 -5 kstviewlegend.cpp
--- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #504020:504021
@@ -55,6 +55,7 @@
KstViewLabel::KstViewLabel(const QString& txt, KstLJustifyType justify, float rotation)
: KstBorderedViewObject("Label") {
+ _fallThroughTransparency = false;
_container = false;
setFollowsFlow(true);
_dataPrecision = 8;
@@ -80,6 +81,7 @@
KstViewLabel::KstViewLabel(const QDomElement& e)
: KstBorderedViewObject(e) {
// some defaults and invariants
+ _fallThroughTransparency = false;
_container = false;
setFollowsFlow(true);
_type = "Label";
@@ -324,6 +326,7 @@
void KstViewLabel::updateSelf() {
if (dirty()) {
+ invalidateClipRegion();
if (_autoResize) {
adjustSizeForText(_parent->contentsRect());
} else {
@@ -484,7 +487,7 @@
}
QRect cr(contentsRect());
- cr.setSize(sz + QSize(2 * _labelMargin + _ascent / 5, 2 * _labelMargin + _ascent / 5));
+ cr.setSize(sz + QSize(2 * _labelMargin * _ascent / 10, 2 * _labelMargin * _ascent / 10));
setContentsRect(cr);
}
@@ -572,7 +575,7 @@
widget->_boxColors->setForeground(KstSettings::globalSettings()->foregroundColor);
widget->_boxColors->setBackground(KstSettings::globalSettings()->backgroundColor);
- if (size().width()*size().height()<25) { // assume a click, and default to just text
+ if (size().width() * size().height() < 25) { // assume a click, and default to just text
widget->_transparent->setChecked(true);
widget->_autoResize->setChecked(true);
widget->_border->setValue(0);
@@ -634,7 +637,7 @@
setBorderColor(widget->_boxColors->foreground());
setBackgroundColor(widget->_boxColors->background());
setLabelMargin(widget->_margin->value());
-
+
reparse(); // calls setDirty()
return true;
}
--- trunk/extragear/graphics/kst/kst/kstviewlegend.cpp #504020:504021
@@ -54,6 +54,7 @@
KstViewLegend::KstViewLegend()
: KstBorderedViewObject("Legend") {
+ _fallThroughTransparency = false;
_container = false;
_rotation = 0;
_vertical = true;
@@ -77,6 +78,7 @@
: KstBorderedViewObject(e) {
// some defaults and invariants
+ _fallThroughTransparency = false;
_container = false;
_type = "Legend";
_rotation = 0.0;
@@ -177,9 +179,8 @@
for (KstBaseCurveList::Iterator it = _curves.begin(); it != _curves.end(); ++it) {
p.save();
if ((*it)->parsedLegendTag()) {
- p.translate(borderWidth() + _legendMargin*_ascent/10, borderWidth() + _legendMargin*_ascent/10 + (i)*(rc.fontHeight()+_ascent/4));
- QRect symbolBound(QPoint(0,0),
- QSize(16*_ascent/4, rc.fontHeight()));
+ p.translate(_legendMargin*_ascent/10, _legendMargin*_ascent/10 + i * (rc.fontHeight() + _ascent / 4));
+ QRect symbolBound(QPoint(0,0), QSize(16*_ascent/4, rc.fontHeight()));
(*it)->paintLegendSymbol(&p, symbolBound);
p.translate(9*_ascent/2, 0);
@@ -193,7 +194,7 @@
}
} else {
p.save();
- p.translate(borderWidth() + _legendMargin*_ascent/10, borderWidth() + _legendMargin*_ascent/10);
+ p.translate(_legendMargin*_ascent/10, _legendMargin*_ascent/10);
for (KstBaseCurveList::Iterator it = _curves.begin(); it != _curves.end(); ++it) {
if ((*it)->parsedLegendTag()) {
QRect symbolBound(QPoint(0,0),
@@ -380,7 +381,7 @@
}
QRect cr(contentsRect());
- cr.setSize(sz + QSize(2 * _legendMargin + _ascent / 5, 2 * _legendMargin + _ascent / 5));
+ cr.setSize(sz + QSize(2 * _legendMargin * _ascent / 10, 2 * _legendMargin * _ascent / 10));
setContentsRect(cr);
}
More information about the Kst
mailing list