Commit Graph

28 Commits

Author SHA1 Message Date
Marco Martin
1a321f0df1 contentsRect() function, consistent with QGraphicsWidget::contentsRect()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=851491
2008-08-23 20:36:09 +00:00
Marco Martin
aaab3a310a API change:
changed paintPanel(QPainter* painter, const QRectF& rect, const
QPointF& pos = QPointF(0, 0));
into
 void paintPanel(QPainter* painter, const QRectF& target, const QRectF&
source);   
and
 void paintPanel(QPainter* painter, const QPointF& pos = QPointF(0, 0));

to be more similat di QPainter::drawPixmap api

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=838379
2008-07-27 17:20:27 +00:00
Marco Martin
bebd1cdc1c inserted a new group of hints:
prefix-hint-margin-direction where prefix (optional) is the current
rendered panel and direction is either top bottom, left or right
is used to give a panel custom margins different respect to the borders

removed the contentAtOrigin property that vas never used and actually
dead code

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=837731
2008-07-25 15:08:22 +00:00
Aaron J. Seigo
1e35b37d5c SVN_SILENT: ws tightening
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=828242
2008-07-05 05:20:40 +00:00
Marijn Kruisselbrink
21b148b963 change all ClassName::Private classes to ClassNamePrivate, and adjust friends accordingly; this makes plasma compilable with gcc < 4.2
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=826893
2008-07-01 18:56:43 +00:00
Marco Martin
d01cb72c4d update the svg painting and margins calculations when the theme changes
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=812089
2008-05-24 15:33:35 +00:00
Aaron J. Seigo
e32ed254f1 SVN_SILENT: shh
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=811947
2008-05-24 07:33:33 +00:00
Aaron J. Seigo
9f4246059e when changing the prefix, let's base it on the previous size.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=811927
2008-05-24 05:29:42 +00:00
Marco Martin
48f9257fb1 not hasElementPrefix(prefix) works also when prefix is empty
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=805339
2008-05-08 09:12:04 +00:00
Marco Martin
ee2468472c don't try to paint non existent elements
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803865
2008-05-04 11:19:11 +00:00
Marco Martin
899260cc23 use iterators to avoid two searches
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803659
2008-05-03 18:29:06 +00:00
Marco Martin
c3925a3496 * added new function panelSize() that returns the size of the panel (and
not of the svg)
* some valid pointers checks

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803637
2008-05-03 16:03:44 +00:00
Marco Martin
9c588df3bb Added the overloaded function
bool hasElementPrefix(Plasma::Location location) const;

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803268
2008-05-02 13:25:04 +00:00
Marco Martin
b4ee14d44f don't erase the entire cache when updating the sizes of a single panel,
so the cache for multiple items now actually works :)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803217
2008-05-02 10:32:47 +00:00
Marco Martin
0f1809e9f4 new function bool hasElementPrefix(prefix) that checks if the given
element prefix exists for the loaded svg
and build fix woops

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803066
2008-05-01 20:09:24 +00:00
Marco Martin
5939dfc87c scale the svg elements at the right size in case of stretched borders
and/or
not tiled center element.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803061
2008-05-01 19:51:41 +00:00
Marco Martin
703b6c2ffa * adds a new convenience method getMargins(&qreal,&qreal,&qreal,&qreal)
to fetch all the four margins at a time
* now applet uses it

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=802928
2008-05-01 09:49:30 +00:00
Robert Knight
cdb840d200 Print warnings if trying to assign invalid sizes to a panel or trying to generate a panel background with an invalid size. Prevents attempts to paint on an invalid pixmap leading to XRender errors.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801852
2008-04-27 22:34:24 +00:00
Aaron J. Seigo
de3ab77f26 paint -> paintPanel. allows one to use the Svg api directly when you have a PanelSvg class and falls into line with the resize->resizePanel change as well.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801077
2008-04-25 16:18:51 +00:00
Aaron J. Seigo
f4cb38cef1 cache clearing fixes, some performance improvements
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800759
2008-04-24 19:49:24 +00:00
Aaron J. Seigo
2e71b7a700 * clear() the panels list after deleting the items (fixes crash)
* resize -> resizePanel ... resolves a semantically annoying ambiguity now that it subclasses Svg
* don't use the [] accessor more than necessary
* slightly clearer code in places


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800283
2008-04-23 20:38:09 +00:00
Aaron J. Seigo
d52b839cf9 we need to signal a repain on borders changing.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800186
2008-04-23 16:18:45 +00:00
Marco Martin
d0ba4e77ec Api change:
Plasma::Svg(imagePath, parent) -> Plasma::Svg(parent)  and
Plasma::PanelSvg(imagePath, parent) -> Plasma::PanelSvg(parent)
updated as needed every class that was using Svg or PanelSvg

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=800143
2008-04-23 13:07:41 +00:00
Marco Martin
203fda098d PanelSvg now is a subclass of Plasma::Svg so it doesn't use anymore an internal istance of Plasma::Svg
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=799908
2008-04-22 20:25:28 +00:00
Marco Martin
85a1f0e516 use a separate cache for each elementPrefix, this will speed up
rendering a lot if prefixes are switched very often. this will make
possible for instance to render the background of taskbar items with a
PanelSvg.
This behaviour is disabled by default, you can enable/disable it with
setCacheAllRenderedPanels(bool), get with cacheAllRenderedPanels() and
erase the entire cache with clearCache()

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=799411
2008-04-21 14:01:46 +00:00
Marco Martin
f522c38eeb file() and setFile() -> imagePath() and setImagePath()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797772
2008-04-16 20:48:53 +00:00
Marco Martin
6024f48475 Api changes to PanelSvg finished:
-now it's a Plasma::Svg
-DrawTopBorder DrawLeftBorder etc -> TopBorder LeftBorder etc
-contentAtOrigin -> out of flags
-setFile() -> setImagePath()
-setBorderFlags() -> setEnabledBorders()
-added resize(qreal,qreal)
-setPrefix() -> setElementsPrefix()
-updateSizes() -> Q_PRIVATE_SLOT
-pos() setPos() removed, now pos is a parameter of paint
-setLocation() -> setElementPrefix(enum)
-location() removed


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797736
2008-04-16 20:17:36 +00:00
Marco Martin
d07a60c581 Rename SvnPanel into PanelSvg and update accordingly who is using that,
as discussed in api reviews

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797663
2008-04-16 17:23:58 +00:00