psifidotos / nowdock-plasmoid

Plasma 5 plasmoid that creates a plank or mac style effect for tasks
GNU General Public License v3.0
37 stars 3 forks source link

option to anchor the plasmoid #21

Closed kupiqu closed 7 years ago

kupiqu commented 7 years ago

In its current version nowdock-plasmoid anchors its position to the center of the plasmoid (when the plasmoid grows because of more tasks, etc, the plasmoid extends in both directions).

It would be useful (although I am not sure whether this is easily doable or not) to give also the option to anchor position to one of the extrems so it only extends in the opposite direction.

As an example, this would somehow resemble a bit the behavior of unity when the plasmoid is on the left, and anchored to top.

psifidotos commented 7 years ago

It can be done... I dont know though if there is a way to be supported for both of the extrems... I know for example that when we are in horizontal, most of plasmoids are placed to the left, but the tasks plasmoid is placed to the right...

I'll keep an eye on this to see how it is implemented...

psifidotos commented 7 years ago

@kupiqu I am thinking of this and I believe that there isnt an implementation issue but there is another issue. How would the zoom effect behave in such a case? By anchoring the Now Dock plasmoid for example to the left, when the user will try to hover an item this item would move a lot to the right and there is a big chance that the mouse will not hover it any more...

Have you seen such a behavior in another program?

kupiqu commented 7 years ago

That is indeed an issue.

What I am thinking of would be to anchor the panel but tolerate the increase in size of the hovered icon by the zooming effect, so the icon remains at its centered position.

I guess this would require that the minimum separation between icons and margins on extremes would somehow depend on icons size + zoom scaling factor. This would avoid: i) cropped icons by too short margins, and ii) overlapping icons.

Does it make sense?

psifidotos commented 7 years ago

@kupiqu it dont know... Currently the implementation is a list of rectangles if something grows then all the rest are influenced. a rectangle can not overlap with the rest. You can think it as a tower of boxes, one over the other... I dont know if with margins this could be solved...

kupiqu commented 7 years ago

Perhaps the easiest solution would be to just anchor (the center of) the first rectangle (with respect to selected anchor; e.g. icon at the top if top anchor is selected). Would that be possible?

I think a bit of a shift for the rest of the panel (for example, going down for the top anchor) because of hovering would be just ok.

psifidotos commented 7 years ago

@kupiqu that solution would be ok only for the first item, all the rest would keep the problem of moving far from the point that the hover event occured

kupiqu commented 7 years ago

Sorry, I think I am not explaining myself properly... What I meant is that the main reference for anchoring is, let's say, the center of the icon at top (in the non-zoomed condition). Then on hovering on any icon of the dock, there would be a bit of a shift up/down for the icons that are above/below the hovered icon.

In that way, issues would be avoided, and the anchor would remain (even though we would need to have some tolerance for relatively minor shifts due to hovering).

kupiqu commented 7 years ago

I have read about how you are dealing with this issue: https://github.com/psifidotos/nowdock-panel/issues/1

Wondering now how the nowdock panel may behave for the icon only taskbar as it is anchored to left or top.

Perhaps it could be inspiring to this issue too...

psifidotos commented 7 years ago

@kupiqu with the now dock panel is a hate love situation currently. The Now Dock Panel currently only centers its items. The last days I am also concerned about anchoring on top or on left as you describe... The issue is not how to implement it, but how it should behave on hovering.

I dont know what to implement in order to make sense :)

The functionality you are describing... For example to grow around the hovered item is the current implementation but the only issue is that the tasks are in the center. I could that make it free and the use would be able to simple add the Now Dock plasmoid to the left or use a spacer to add it to the right, but on hovering because things are grow some of the items in the edge would get outside of the screen... If I anchor them in order to not get out of the screen then there is the issue of moving hovered items outside of the mouse position.

It is a very strange situation and I dont know what to implement in order to support positioning on far left, far right, far top etc. edges....

The icon only taskbar doesnot make a hovering effect because it is all considered one item.

But I am absolutely positive to search and talk about the best practice for this issue both for the plasmoid and the panel...

kupiqu commented 7 years ago

+1

Thanks!

psifidotos commented 7 years ago

@kupiqu , I have an update in this!!!

I played around again with the anchors and there are cases that this can be supported !!!! for example left and top anchoring with the default panel work like a charm! There is only a very small glitch when first hovering but after that it looks good!

with right and bottom positioning there are some small issues but I believe these could be solved through the Now Dock Panel!

The only thing is that the user should choose the anchoring from the configuration window... I will enable center behavior as default and after that Left,Right for Vertical and Top, Bottom, for Horizontal...

kupiqu commented 7 years ago

It sounds great, looking forward to giving it a try... :)

psifidotos commented 7 years ago

@kupiqu you could try branch, newAnchors

psifidotos commented 7 years ago

dont try it with the Now Dock panel but with the default one....

kupiqu commented 7 years ago

Yes, it works nicely here! :)

psifidotos commented 7 years ago

:), ok!!! :+1:

I will try to make it even a little better when the Now Dock panel fully support this..

psifidotos commented 7 years ago

update: Now Dock Panel (scratch repo) !! anchoring in every way you want :)....

kupiqu commented 7 years ago

Amazing, gonna try it...

psifidotos commented 7 years ago

this is fixed both in plasmoid and panel...

kupiqu commented 7 years ago

It works great, but unfortunately there is an issue with the bar line, which only appears properly if the dock is centered, otherwise it does funny things. This only happens in the vertical mode. The horizontal mode works like a charm.

Could you please check this out?

Update: I think there was some mess going on with a previous version... now it works just fine.