This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Idea] Alignment of elements in panels

Tags: None
(comma "," separated)
User avatar
pedrorodriguez
Registered Member
Posts
115
Karma
0
OS
Hi! I have been thinking about plasma's panels. I like their ability through spacers of letting you place everything exactly where you want it.

Sometimes it is a bit of a hassle though. Let's say you want to have certain elements aligned to the left, like a launcher and a task manager. You also want to have a clock that is centered, like in gnome, and taskbar and other stuff aligned to the right. You can sort of achieve that through spacers, but every time you open a window the clock and maybe other plasmoids will move, not being perfectly aligned anymore.

I was thinking that it would be nice to have a way to align to left/right/center plasmoids without their position being affected by the others. Then you could use spacers only for fine tuning, but I guess most users would just need these three positions.
User avatar
jensreuterberg
Registered Member
Posts
598
Karma
3
OS
Haha great minds think a like! I had the exact same thought yesterday and tried to solve it by placing two panels on top of each other which, since they where vaguely transparent looked awful. I'm gonna try to ask one of the Plasma Devs to come in and explain the technical issues and hindrances to it here since it's in itself a set idea and whats needed is the technical know-how.

(also a center-aligned, icon-only taskbar would be great)

(I emailed Marco Martin and asked him to join in, hopefully he will be able to explain the issue)


KDE Visual Design Group - "Sexy by default - Powerful through cooperation"
User avatar
pedrorodriguez
Registered Member
Posts
115
Karma
0
OS
Great! Hopefully something can be done about this.

Thanks :)
User avatar
notmart
KDE Developer
Posts
220
Karma
1
OS
pedrorodriguez wrote:I was thinking that it would be nice to have a way to align to left/right/center plasmoids without their position being affected by the others. Then you could use spacers only for fine tuning, but I guess most users would just need these three positions.


The reason they don't allow that is that is a very complex problem.
Right now both in Plasma1 and Plasma Next panels use what is called a linear layout¸using facilities provided by Qt.
What it does is to position elements, in this case plasmoids in a line, making sure no elements overlap each other and automatically resize them accordingly to size hints, sizes that the plasmoids advertise (this is my minimum possible size, but this other size it the one i would like) or in the case of the taskbar ask "please give me all the size possible".

This positioning is done by a quite complex C++ QML component Qt offers and is the one that is sensible to give by default, because it breaks in less occasions for the users.

Now, since panels too are plugins, and different kinds can be loaded (just as plasmoids, since technically the whole panel and the whole desktop are plasmoids too) an alternative one can be written. What you describe may perhaps be achieved with the "achor layout" system of QML, where you can tell an item things like "automatically position in the exact center of your parent.
If you think about the corner cases tough there are many areas when it can broke..
what happens when you have more then 3 plasmoids one left one center one right
how can make you sure they will never overlap
how you manage those that want to expand/reduce
etc

So complexity to provide something reasonably bug free would excalate quicly. (in gnome those problems don't happen since it's just not configurable by the user)
That's why the current one is the flexible enough to be default, that said an optional second panel plugin may be accettable even with occasional rough edges, and I would be happy if somebody volunteers to write one, giving assistance and all that jazz.

Hope it explained well ;)
User avatar
alake
Registered Member
Posts
591
Karma
3
OS
Thanks for taking the time to drop in with an explanation Marco!

Sometimes it's tough to understand from the design side why something is technically difficult. So I think your explanation is really helpful. :-)
User avatar
pedrorodriguez
Registered Member
Posts
115
Karma
0
OS
Thanks for the explanation. I am not a programmer, and didn't understand you very well, but I get that it can be difficult to implement and provide a relatively bug free experience.

It is possible that you explained this in your post, in which case I'm sorry for not realising, but I was thinking some more about this:

-It is a little awkward and unintuitive to arrange panels with spacers (the first time you use them)

-Align to left/right/center is desirable, but hard to implement and potentially problematic


Now, would it be possible to have some sort of "templates", so that you would tell a plasmoid "align yourself to the left/right/center" and spacers would automatically be set up for you?
Something along those lines would be much more user friendly IMO.

Also, if there was a way to tell a spacer "fix your right/left end here and don't allow it to move no matter what, while the other one adjusts to changes (taskbar, etc)", that would solve the moving plasmoids issue wouldn't it?

Again, maybe you addressed all of this in your post, but it wasn't clear to me.

Thanks!
silencer
Registered Member
Posts
9
Karma
0
Hi!

I registered here because I wanted to be part of this conversation. I support the idea of being able to align items to the left, right, or center. Reading the thread an idea came to my mind.

What about having a plasmoid container with the ability of taking a percentage of the parent's width? The plasmoid container could be set also to align its childs to the left, right, or center. Then, with something like this, we could have, for instance,

Example 1: Clock on the center, Traybar on the right:

Container A (void) - Container B (containing a clock plasmoid) - Container C (containing the system tray plasmoid)

Container A: 25% of parent, align childs to the left.
Container B: 50% of parent, align childs on center.
Container C: 25% of parent, align childs to the right.

Example 2: Dock aligned on the center:

Only one container, width equal to 100% of parent, put child on center (which would be a Task Icons plasmoid)

What do you think about it?
Greetings!
silencer

EDIT: The plasmoid container parent would be a Plasma Panel taking the 100% width of the Screen (if we could make the panel have a transparent background, the dock example should work fine as in macos)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot]