kde-snap-assist icon indicating copy to clipboard operation
kde-snap-assist copied to clipboard

Ability to easily edit layouts

Open emvaized opened this issue 2 years ago • 1 comments

It would be good to refactor the script in order to use 12x12 grid, so that users could easily manage all supported layouts, add new or remove the current ones.

emvaized avatar Aug 14 '22 13:08 emvaized

As for now, I can imagine this as rewriting onWindowResize() and switchAssistLayout() functions to make use of some common layout.js file, listing all supported snapped window positions, corresponding assistant positions, and assistant alternative positions, cycled through with the Tab key. Probably it also makes sense to use abstract 12x12 grid in this config file, instead of relying on fractions of the screen height and width.

The problem to solve here is that switchAssistLayout() function uses a lot of context depending code to determine where to show next alternative position for the assist — as well as next assist positions to show on client select, depending of current assist layout. We need to figure out how to preserve all this logic.

emvaized avatar Aug 19 '22 12:08 emvaized