decoration.h | [was: Review Request for KDecoration]

Martin Gräßlin mgraesslin at kde.org
Thu Nov 6 12:58:24 GMT 2014


On Thursday 06 November 2014 13:31:57 Thomas Lübking wrote:
> decoration.h
> -------------
> borderLeft|Right|Bottom|Top
> Use QMargins here as well (they'll usually be required together)?
> 
> extendedBorder*
> QMargins as well?. Also maybe "resizeOnlyBorder"? (extendedBorder is very
> generic)

will look into those two.

> 
> "titleRect"
> is this "titleBarRect" or "captionRect" - and should the name be more
> specific? (And if it points an entire section to allow vertical titles etc.
> would a Qt::WindowFrameSection make more sense?)

It's the "titleBarRect" - buttons and caption. The idea is to have the backend 
know which are is the titlebar, so that it can react on mouse clicks 
accordingly. While writing this I realize that it might not be needed at all.

> 
> "setSettings"
> As this is supposed to be only invoked from the framework, make private to a
> friend class/function?

yes I thought about that as well when writing the code. But I didn't find a 
class to friend with. The framework part is hidden from the decoration and 
thus difficult to friend ;-) Of course one could go through the Bridge, but 
I'm not sure whether it's a real improvement. And even Qt has internal public 
methods ;-)

> 
> "paint"
> w/o having looked at the paint system, but assuming it operates on
> translation and clip"region"(rect), maybe explicitly hand the rect for this
> pass to be painted as paramenter?

yes that might be an option. Do you think that Decorations could benefit from 
that information?

> 
> "requestMaximize"
> rename to "requestToggleMaximize|ization"?
> 
> "windowFrameSection":
> What's that supposed to be at all? "Decoration" will not point a single tile
> of the Decoration, does it?

It's the replacement for what used to be mousePosition() in Kdecoration1. That 
is on a mouse event the Decoration updates the windowFrameSection so that the 
framework can show the correct cursor. Which goes back to what I wrote above: 
the titleBarRect might not be needed as it can be derived from this property 
being Qt::TitleBarArea.

Cheers
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20141106/a8858c4e/attachment.sig>


More information about the kde-core-devel mailing list