Bug 180852

Summary: wasted space in toolbars
Product: [Plasma] Oxygen Reporter: Roland Leißa <roland.leissa>
Component: styleAssignee: Camilla Boemann <cbo>
Severity: normal CC: ivo
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: toolbar mockup
toolbar situation now
toolbar margin mockup
improved gaps between menubars/toolbars, toolbars/toolbars and toolbars/UI
less wasted spaces

Description Roland Leißa 2009-01-15 18:44:16 UTC
Version:            (using KDE 4.1.3)
OS:                Linux
Installed from:    Gentoo Packages

IMHO toolbars contain too much wasted which is caused by the vertical dotted line at the beginning of each toolbar. Applications will look much more polished if the top most and bottom most dot are removed. You can see the effect really good in system settings. Removing the top and bottom most dot in the search bar would result in smaller gray areas of wasted space.
Comment 1 Pino Toscano 2009-01-15 21:33:41 UTC
Could you please provide a mockup?
Comment 2 Roland Leißa 2009-01-15 22:01:23 UTC
Created attachment 30294 [details]
toolbar mockup

At the left you see the mockup of system settings. On the right you see how it is now.
Comment 3 Camilla Boemann 2009-01-15 22:21:32 UTC
First of thank you for showing interest in oxygen.

The dot have nothing to do with the space. The dots are created depending on how much space there is. not the other way around.

And the space is actually decided on purpose. Now that we don't have that many lines we need space to separate the various elements. And actually we use less space in all than many other styles.

However I'll talk to Nuno Pinheiro about it again - just to be sure.
Comment 4 Roland Leißa 2009-01-16 00:14:38 UTC
Ah ok.

I would agree that my mockup is perhaps a bit too narrow but the orignal has definitely too much space. After playing around a bit with toolbars this is what I think now:

About half the space between toolbars, between the menubar and a toolbar and between the last toolbar and the actual GUI would just be fine.

However if you have a look at system settings and -- let's say -- dolphin without menubar with just the toolbar at the top, you'll notice that system settings has a gap between the window decoration and the toolbar what dolphin does not have. Dunno whether this is a oxygen bug.
Comment 5 Camilla Boemann 2009-01-16 15:19:35 UTC
It not that easy - we don't have that fine control we mixing elements

all we can do is add margins to individual elements, but we can't speculate on combinations.

The current solution actually took quite a long time to compromise

Not closing though - we'll take a look at it

Note to self: maybe base margin on font size
Comment 6 Roland Leißa 2009-01-16 18:06:55 UTC
Created attachment 30325 [details]
toolbar situation now

I've upgraded my system today and the extra gap between the window-deco and the toolbar in system settings is gone. System settings looks better like this. Dunno whether a Qt or a KDE update (4.1.3 -> 4.1.4) solved this issue.

@toolbar margins: Have a look at the toolbar situation now (see attachment):

toolbar - toolbar: gap is too large
menubar - toolbar: gap seems even larger
toolbar - gui: gap is slightly too large

Assume we have now a margin of 4 pixels around the toolbars.  The first thing I would try is to set the margin to 2 pixels. If the bottom toolbar seems to be too near to the GUI and the menubar is still too far from the toolbar, one could set the top margin to 1 and the bottom margin to 3.

I don't know how hard this is to do. But perhaps you can post some screenshot of different margin settings?
Comment 7 Roland Leißa 2009-01-16 18:31:11 UTC
Created attachment 30326 [details]
toolbar margin mockup

Here's a mockup I made. The top margin is reduced by 4 pixels. The bottom margin is reduced by one. I really like this version.

Can it be that there is somehow extra margin set for tabs? You can see this effect in tabbed konqueror, Kopete's tabbed chat window and system settings, for instance. Even reducing this gap by one leaves quite a gap. This would be one thing left from resolving this optimally :)
Comment 8 Roland Leißa 2009-01-22 15:40:06 UTC
Where can I find the source code? Perhaps I play with the code a bit by myself.
Comment 9 Camilla Boemann 2009-01-22 22:15:25 UTC
Comment 10 Roland Leißa 2009-01-23 04:46:35 UTC
Today I played a bit with the code. This is what I've found out:

This makes the gap between menubar and toolbar bar a bit better:
-    setWidgetLayoutProp(WT_MenuBar, MenuBar::Margin + Bot, 2);                                                                                                                                              
+    setWidgetLayoutProp(WT_MenuBar, MenuBar::Margin + Bot, 0);                                                                                                                                              

With this, the gaps between toolbars are better:
-    setWidgetLayoutProp(WT_ToolButton, ToolButton::ContentsMargin, 4);
+    setWidgetLayoutProp(WT_ToolButton, ToolButton::ContentsMargin, 0); // perhaps 1, or just the bottum gap 1
+    setWidgetLayoutProp(WT_ToolButton, ToolButton::ContentsMargin + Left, 4);
+    setWidgetLayoutProp(WT_ToolButton, ToolButton::ContentsMargin + Right, 4);

However, this looks only nicely, if "Text alongside icon" or "Icons only" is chosen. Chosing Text under icons are causing some artefacts: The heading isn't completly seen. I see two solutions:

1. Make the margin bigger, when this option is set.
2. Somewhere in the depths of KDE or Qt is a bug which doesn't take the heading's size into account. This must be fixed.
Comment 11 Roland Leißa 2009-01-31 05:57:54 UTC
Created attachment 30766 [details]
improved gaps between menubars/toolbars, toolbars/toolbars and toolbars/UI

Ok, fixed the issue with text under icons.

In the attachment is a patch, which makes some gaps a bit smaller. I really
like this version. One thing that still annoys me is the gap which is caused by
LineEdits in ToolBars. You can see that the bottom gap is larger than the top
one if you drag systemsetting's toolbar away or Konqueror's location bar.

I've also sent this patch to bug 17108 but nobody seems to read this anymore. I'll mark that on as a duplicate of this one.
Comment 12 Roland Leißa 2009-01-31 05:59:11 UTC
Sorry, meant bug 171085
Comment 13 Roland Leißa 2009-01-31 05:59:58 UTC
*** Bug 171085 has been marked as a duplicate of this bug. ***
Comment 14 Roland Leißa 2009-01-31 06:48:51 UTC
Created attachment 30767 [details]
less wasted spaces

This version is even slightly better.
Comment 15 Camilla Boemann 2009-02-15 23:34:33 UTC
SVN commit 926664 by boemann:

Dont wast so much space around toolbars.

Thanks to Roland Leißa for the patch.


 M  +8 -8      oxygen.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=926664
Comment 16 Camilla Boemann 2009-02-17 23:05:31 UTC
SVN commit 927610 by boemann:

revert a good part of the spacesaving commit 

instead do someother stuff that does save a little

 M  +3 -7      oxygen.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=927610