Commit Graph

73 Commits

Author SHA1 Message Date
Jason Stubbs
10af4df668 Added methods for gaining information about the view. This is useful for
applets such as systemtray and tasks that need to know about global
geometry.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=746172
2007-12-08 03:35:11 +00:00
Jason Stubbs
89a387b76d Cast the parent being checked rather than parentItem()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=743922
2007-12-02 11:19:26 +00:00
Aaron J. Seigo
312f42dec0 when setting min/max sizes, adjust our geometry if our current size is not within those boundaries
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=742716
2007-11-28 18:41:21 +00:00
Aaron J. Seigo
0374286c07 * don't reset the painter's opacity to the widget's opacity; rather, *apply* the widget's opacity to the painter's opacity
* get rid of the internal child list. we don't need it and it's a pain (as in error prone) to maintain, esp when we have QGraphicsItem::children()

(man i wish svn allows partial file commits =/ i wonder (idly) if git or any of those new fangled vcs's do?)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=742100
2007-11-27 06:03:19 +00:00
Tom Albers
bd382fa983 Fix wording so it does not result in false positives.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=741335
2007-11-25 13:28:25 +00:00
Aaron J. Seigo
65d405f264 more layouting love;
* widgets should let Widget handle sizing, geometry unless there are very good reasons for it
* don't relayout the parent layout if the parent layout is already relayouting, because that relayout will have called the child's relayout in the first place. get it? relayout!
* i can dance. we can dance. do the relayout dance.
* some style guide fixes

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738957
2007-11-20 01:19:59 +00:00
Aaron J. Seigo
92ba2c1b0b move all the layouts to their own directory; much more logical and makes it easier to not miss layouts that need changes
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738898
2007-11-19 22:42:56 +00:00
Aaron J. Seigo
1a3aec4af2 add another setSize convenience method and use d->size more consistently internally for clarity
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738568
2007-11-19 07:53:48 +00:00
Aaron J. Seigo
2f5fa3f5fa remove items that are removed from us from our layout, as well
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738068
2007-11-17 21:32:21 +00:00
Aaron J. Seigo
d9493e73ef avoid unecessary updates, use d->size consistently so problem, if they arise, show up more consistently ;)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738038
2007-11-17 19:01:02 +00:00
Aaron J. Seigo
bba7a3d39c invalidate the managing layout on geometry changes, which is what i expected it to do in the first place. calling setGeometry and then updateGeometry is just damaged
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=732530
2007-11-04 05:36:39 +00:00
Aaron J. Seigo
ffcf6bc16b let's not hold on to our own parent pointer; just too easy to have it fall out of date.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=731160
2007-10-30 21:00:01 +00:00
Aaron J. Seigo
c10ddbe353 the item is already children of us at this point, just make sure to not double add it.
i tried to find a way to reliably react to child add events instead of having to call our own method for this, but due to construction order and how itemChanged events are handled, i couldn't find such a thing. =/

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=731137
2007-10-30 20:25:12 +00:00
Aaron J. Seigo
5b10495cf4 get rid of reparent() as that is completely superceded by addChild, and catch when children items no longer belong to us.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=730877
2007-10-29 23:10:45 +00:00
Aaron J. Seigo
260a040477 * avoid a couple unecessary vars/method calls
* don't try and paint on a null pixmap

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=729679
2007-10-26 16:35:58 +00:00
Aaron J. Seigo
576798dd52 set panels properly in setScreen. this will need to be augmented with screen edge stuff eventually as well, but for now this might work better on multiple screens.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=729421
2007-10-25 23:09:02 +00:00
Aaron J. Seigo
49874ae140 temporary fix for the beta: don't make items unmovable when added to a layout as that is screwing with MouseReleaseEvents. this means panels items are, once again, freely draggable (which is wrong) but on the upside you can open the menu again
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=729202
2007-10-25 09:12:15 +00:00
Aaron J. Seigo
b448d9bb90 when an item is added to the layout, give it a chance to react. in the case of Widget, we're going to set the movable state of the QGraphicsItem. the result: items move, or don't, based on whether or not they are in a layout. finally, you can't just move shit around in the panel.
it's pretty hackish since we have to special case FreeLayout but hey, since when were layouts in plasma ever sane?

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=728764
2007-10-24 06:54:26 +00:00
Aaron J. Seigo
22de66fdc0 * fix order of constraints init so that geometry is done before screen affinity
* only adjust the size of the containment to the screen size if it is a DesktopContainMent

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=724225
2007-10-11 19:16:01 +00:00
Aaron J. Seigo
0f66f80fe2 allow widgets to change their size even if there isn't a layout (because that was just silly)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=723915
2007-10-11 03:30:50 +00:00
Thomas Georgiou
fab3611a21 Transparency works now!! Aaron, remember to fill QPixmaps with
Qt::transparent.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=722710
2007-10-07 23:32:56 +00:00
Aaron J. Seigo
55969fd88b - make setGeometry virtual so that Applet::setGeometry actually does what Petri Damsten was trying for
- erase the rect on the pixmap that is exposed before painting again; this prevents painting over and over and over the pixmap (resulting in darker and darker painting when using transparency)
- some minor whitespace changes made whilst debugging

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=719387
2007-10-01 05:06:51 +00:00
Petri Damstén
61fa701fc0 - Add setSize (needed by Applet)
- Delete white space from line ends

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=718077
2007-09-28 05:45:10 +00:00
Aaron J. Seigo
8f4ed43ae0 whoops, forgot this other half of the commit
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=718011
2007-09-27 22:11:46 +00:00
Matías Costa
f4efdfa1f0 Fix infinite loop
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=717393
2007-09-26 20:15:42 +00:00
Aaron J. Seigo
7fefcf98c7 fix this indentation nightmare (tabs, many levels deep)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=714178
2007-09-18 21:30:30 +00:00
Aaron J. Seigo
fc53b1a7f0 SVN_SILENT suppose we don't need dead code already ;)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=714172
2007-09-18 21:20:06 +00:00
Aaron J. Seigo
fe13964089 add a contextMenuEvent to Widget so that we get proper context menu propagation by default
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=714171
2007-09-18 21:19:10 +00:00
Robert Knight
7b607e92c9 Fix applets jumping around when they resize. Avoid calling setGeometry() on Applets in a FreeLayout that have not changed their size hint since the last update.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712674
2007-09-15 04:16:11 +00:00
Aaron J. Seigo
329d912f47 SVN_SILENT: more licensing updates ... all done with this now i think =)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712581
2007-09-14 20:17:11 +00:00
Aaron J. Seigo
e0f831373c SVN_SILENT: add "or later" clause. cleared with copyright holders, except for rich moore's ui loader which i need to ask him for permission for first.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712549
2007-09-14 19:06:18 +00:00
Aaron J. Seigo
d20c9a010f growing tired of being asked about how to get at the font used in widgets, here's a cute little accessor that provides the answer for now and gives us a way to support font settings in the future much in the way qwidget itself does.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712158
2007-09-13 19:33:44 +00:00
Aaron J. Seigo
926d039802 SVN_SILENT: why bother with a coding style.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=711898
2007-09-13 05:34:11 +00:00
Andreas Aardal Hanssen
1cf7d7c0f6 Enable DeviceCoordinateCacheMode by default. Overload update() to give
it invalidate-like behavior, and remove invalidate(). Revert last change
to analogclock, cached behavior is now enabled for all applets. If you
want to disable caching, call setCachePaintMode(NoCacheMode) from your
applet's constructor.


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=710764
2007-09-10 20:44:24 +00:00
Andreas Aardal Hanssen
55e02ca70a Add CachePaintMode, as a temporary local back-port of
QGraphicsItem::CacheMode, which will appear in 4.4. I've chosen names
that aren't really good, but they're not misleading, and they don't
clash with the API in 4.4.

My first KDE submit :-DDD.


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=710738
2007-09-10 19:06:58 +00:00
Robert Knight
37b4ea6334 managingLayout() is a better way to get the layout managing the widget's geometry than parent()->layout() which doesn't work for top-level Widget instances.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=709899
2007-09-08 14:01:03 +00:00
Robert Knight
3dc0a4795f Correct the layout invalidation logic. As with Qt, when a layout is invalidated it finds its top-level layout and causes that to be updated. Calling Widget::updageGeometry() causes the parent widget's layout to be invalidated.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=709495
2007-09-07 16:15:46 +00:00
Robert Knight
04375c4b09 Replace 'INFINITY' with more correct numeric_limits<qreal>::infinity()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=706983
2007-08-31 17:46:12 +00:00
Robert Knight
bb25f62e55 Remove Widget::invalidate(), that is a feature which is part of the layouts. Better attempt at Widget::updateGeometry() which widget subclasses can call when their size hint or min/max size changes. Ultimately should behave like the QWidget methods of the same name. Make Widget return Qt::Horizontal | Qt::Vertical in its default implementation of expandingDirections()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=706939
2007-08-31 15:32:10 +00:00
Thomas Georgiou
44c1f66714 Make other widgets paint when zoomed out. (These 3 commits are just
commenting things out. The code will need to be removed once we are 
sure we do not need it.)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=705868
2007-08-28 19:12:13 +00:00
Robert Knight
773612ac44 Default implementations of minimumSize() , maximumSize() in Layout and correct implementations of minimumSize() , maximumSize() in Widget to match equivalents in QLayout , QWidget.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=703547
2007-08-22 20:13:24 +00:00
Robert Knight
93bf2933e4 When updating a Widget's geometry, pass the geometry in the Widget's co-ordinates to layout()->setGeometry() rather than the parent widget's co-ordinates. Call updateGeometry() inside setGeometry().
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=701207
2007-08-17 16:28:54 +00:00
Matt Broadstone
19efbb9108 Respect min/max sizeHints when setting geometry
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=701205
2007-08-17 16:04:49 +00:00
Robert Knight
93070ce1fd Implement the same sizeHint() logic in Plasma::Widget as QWidget. It returns the layout's sizeHint() if there is a layout or an invalid QSizeF otherwise. Implement sizeHint() in Plasma::Applet. It returns the same as contentSize() if there is no border or the content size hint plus the border size otherwise. Many of the applets need changes for setGeometry() to work properly on them. Fix various warnings.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=701192
2007-08-17 15:05:01 +00:00
Robert Knight
2475cfed09 Add LayoutAnimator class. This provides a way to animate changes in layouts. eg. Fading in new items, fading out removed items, moving and resizing items smoothly as the layout changes. The layouts themselves need some small changes to make use of this class, and the client code must create the animator, attach it to the layout and choose the animation effects to use.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=700844
2007-08-16 15:56:00 +00:00
Robert Knight
482f9824ba Optimization. Avoid calling prepareGeometryChange() if the new and old geometry have the same size. Added a graphicsItem() method to LayoutItem which returns the associated graphics item (if any). Needed for effects during layouting.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=699494
2007-08-13 09:01:00 +00:00
Aaron J. Seigo
db4a7ebe61 copyright cleanups:
* Copyright (C) -> Copyright
* add "or later" clause to files that i have the sole copyright on
* add current year (2007) to my copyrights where it was missing

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=696946
2007-08-06 11:20:02 +00:00
Aaron J. Seigo
5d05c8ac7e more comparison fixes
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=696656
2007-08-05 14:24:24 +00:00
Aaron J. Seigo
b1d1f1959f comparing doubles for equality with == isn't great
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=696628
2007-08-05 12:58:40 +00:00
Matt Broadstone
a53be5affe Proper documentation, added setSize
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=696079
2007-08-03 18:56:14 +00:00