Review Request: Fix margin on KMessageWidget to match that used by a styled QFrame.

David Edmundson david at davidedmundson.co.uk
Fri Nov 16 02:08:49 GMT 2012



> On Nov. 15, 2012, 9:11 a.m., Aurélien Gâteau wrote:
> > Good catch, things looks more aligned now.
> > 
> > I am a bit worried about the 2px value being specific to Oxygen widget style though. How does it behave with other styles? Maybe you can extract this value using QStyle::pixelMetric(QStyle::PM_DefaultFrameWidth)?

>...specific to Oxygen widget style 

Unfortunately the margin is hardcoded into the Oxygen style painting of QFrame.

>Maybe you can extract this value using QStyle::pixelMetric(QStyle::PM_DefaultFrameWidth)?

Actually I sort of can. That returns 3, As it's the margin + the size of the frame border. I initially discounted this approach, but given I know our border is of size 1px, that works.


> On Nov. 15, 2012, 9:11 a.m., Aurélien Gâteau wrote:
> > kdeui/tests/kmessagewidgettest.cpp, line 42
> > <http://git.reviewboard.kde.org/r/107332/diff/1/?file=94835#file94835line42>
> >
> >     I am actually wondering whether the setFrameStyle() call is needed at all. Do you get a different result without it?

Just tested, you get a frame with no border :(


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107332/#review22024
-----------------------------------------------------------


On Nov. 15, 2012, 6:40 a.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107332/
> -----------------------------------------------------------
> 
> (Updated Nov. 15, 2012, 6:40 a.m.)
> 
> 
> Review request for kdelibs and Aurélien Gâteau.
> 
> 
> Description
> -------
> 
> Fix margin on KMessageWidget to match that used by a styled QFrame.
> 
> The rationale being that in almost every usage of KMessageWidget it's used above a sunken QFrame (kate, kmail, dolphin)
> currently the message widget is slight wider, which looks wrong.
> 
> Updated testing code to match the more common usage.
> 
> 
> Diffs
> -----
> 
>   kdeui/tests/kmessagewidgettest.cpp be517fce802a8594a6d4aae50f0d1c8955d3cbf2 
>   kdeui/widgets/kmessagewidget.cpp b87b3e49e9824c068bd1d85ac7ecb2de337fa86b 
> 
> Diff: http://git.reviewboard.kde.org/r/107332/diff/
> 
> 
> Testing
> -------
> 
> Screenshot shows the difference, look at left hand side of message widget lining up with the frame below.
> Also opened in Kate, KMail, Bluetooth KCM, ktp-accounts-kcm. All instances lined up.
> 
> 
> Screenshots
> -----------
> 
> Original KMessageWidget (left) and improved KMessageWidget (right)
>   http://git.reviewboard.kde.org/r/107332/s/833/
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20121116/d6dd117f/attachment.htm>


More information about the kde-core-devel mailing list