Bug 180168 - Automatic spacer in panel to keep widgets to preferred sizes
Summary: Automatic spacer in panel to keep widgets to preferred sizes
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-systemtray (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 180170 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-09 19:16 UTC by Andrey Borzenkov
Modified: 2012-03-17 07:17 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of panel in 4.1.96 (15.14 KB, image/png)
2009-01-09 19:16 UTC, Andrey Borzenkov
Details
make plasma applets yield space for greedy applets (1.61 KB, patch)
2009-01-22 16:13 UTC, Marcos Dione
Details
make panel spacer be greedy about space, pushing other applets to the sides. (946 bytes, patch)
2009-01-22 16:17 UTC, Marcos Dione
Details
panel spacer 908622 (18.50 KB, image/png)
2009-03-28 17:07 UTC, Andrey Borzenkov
Details
Unfortunately for me this isn't fixed in 4.7.4. ( I believe it's still there in 4.8.0, but right now I've downgraded back to 4.7.4.). (62.23 KB, image/png)
2012-03-17 07:17 UTC, Hendy Irawan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Borzenkov 2009-01-09 19:16:00 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Mandriva packages based on 4.1.96.

After update from 4.1.85 system tray has exceptionally huge empty margins. When new program is started, the whole applet becomes more side; margins remain the same. See screen shot.
Comment 1 Andrey Borzenkov 2009-01-09 19:16:52 UTC
Created attachment 30066 [details]
Screenshot of panel in 4.1.96
Comment 2 Aaron J. Seigo 2009-01-09 19:50:12 UTC
this is because items grow to the space allowed; there is a spacer widget in playground, it should get merged in 4.3.
Comment 3 Aaron J. Seigo 2009-01-09 19:50:49 UTC
*** Bug 180170 has been marked as a duplicate of this bug. ***
Comment 4 meldroc 2009-01-16 05:44:20 UTC
I noticed that. too.  A very quick way to reproduce this bug is to remove the task manager on a default desktop with a default panel - the taskbar serves to squish both the system tray and the digital clock down to their correct sizes, but when you remove it, they expand to occupy all available space on the panel, when an more appropriate behavior would be for the clock and system tray to expand only to take just enough space to display the time/date or tray icons.
Comment 5 Andrey Borzenkov 2009-01-16 18:27:01 UTC
Exactly.

I still believe this is bug in plasmoids I have reported against originally. They should not indicate that they are capable to use extra space - they are not. I am not expert in KDE/Qt, so I do not know which exact combination of various settings would be needed here.

And current spacer plasmoid does not solve this issue as well. It is incapable of stretching and pushing other plasmoids like task bar. The only thing it allows - to set minimum width, but it is static and does not change when you add new plasmoid or existing plasmoid changes width.

I ended up with this trivial bit of code which actually mimics task bar and allows me to keep size of others in limits (and add widgets noth to the left and right side of panel); this was monkey trial and error job, I do not really understand how layout works. May be something like this could be merged into panelspacer.

#include "plasma-tutorial1.h"

PlasmaTutorial1::PlasmaTutorial1(QObject *parent, const QVariantList &args)
    : Plasma::Applet(parent, args)
{
    setBackgroundHints(DefaultBackground);
    resize(200, 200);
}

PlasmaTutorial1::~PlasmaTutorial1()
{
}

void PlasmaTutorial1::init()
{

    setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
    setAspectRatioMode(Plasma::IgnoreAspectRatio);

}

#include "plasma-tutorial1.moc"
Comment 6 Marcos Dione 2009-01-22 16:13:00 UTC
Created attachment 30511 [details]
make plasma applets yield space for greedy applets

this patch is the first of a two series fixing this. this one makes applets yield space for greedy applets like the taskbar or a spacer one. see next patch comments about it.
Comment 7 Marcos Dione 2009-01-22 16:17:45 UTC
Created attachment 30512 [details]
make panel spacer be greedy about space, pushing other applets to the sides.

This second patch is for the applet itself. note that according to aaron[1] there will be no panel spacer in kde4.3, so this code should be obsolete soon. anyways, it works as a proof of concept.

--
[1] http://mail.kde.org/pipermail/plasma-devel/2008-December/002989.html
Comment 8 Aaron J. Seigo 2009-01-22 17:21:47 UTC
please commit both patches.. thanks :)
Comment 9 Andrey Borzenkov 2009-03-28 17:07:52 UTC
Created attachment 32450 [details]
panel spacer 908622

I tried panel spacer plasma-applet-panelspacer-0.0-0.908622.2mdv2009.1 (see screenshot). I wonder if this is expected behaviour? I enabled "Spacer can automatically stretch" but as you see, both clock and tray widgets still consume much more space than they really need.

Using my widget posted above I get correctly sized widgets kept to the minimal required size.
Comment 10 Andrey Borzenkov 2009-07-04 09:30:16 UTC
For me this is fixed in 4.2.95.
Comment 11 Hendy Irawan 2012-03-17 07:17:07 UTC
Created attachment 69686 [details]
Unfortunately for me this isn't fixed in 4.7.4. ( I believe it's still there in 4.8.0, but right now I've downgraded back to 4.7.4.).

Unfortunately for me this isn't fixed in 4.7.4. ( I believe it's still there in 4.8.0, but right now I've downgraded back to 4.7.4.).

See attachment. Is this another bug? If so, please let me know so I can provide info accordingly.