akiraux / Akira

Native Linux App for UI and UX Design built in Vala and GTK
GNU General Public License v3.0
5.24k stars 203 forks source link

Add alignment panel, logic & anchor alignment #683

Closed giacomoalbe closed 2 years ago

giacomoalbe commented 2 years ago
## Summary / How this PR fixes the problem?

This PR adds the Alignment Panel to the left sidebar, which I decided to name PropertiesSidebar in order to follow the naming convention for the other sidebar.

AlignmentPanel buttons are enabled only when the selection is a multi selection. By default, the alignment type is auto, but it is possible to select an item in the selection by simply clicking on it to make the alignment relative to that item (called "anchor").

Steps to Test

* Draw some items on the canvas * Select two or more of them by SHIFT clicking * Use the buttons in the AlignmentPanel on the Properties sidebar to align the items * Click (without holding SHIFT) on one of the selected items in order to align the items relative to it ## Screenshots

https://user-images.githubusercontent.com/11556031/147503903-29723385-7049-47de-9e5d-290522772833.mp4

Known Issues / Things To Do

Is PropertiesSidebar a good name for the previously named LeftSidebar?

Alecaddd commented 2 years ago

Is PropertiesSidebar a good name for the previously named LeftSidebar?

I think OptionsSidebar sounds better.

giacomoalbe commented 2 years ago

Ok, i solved the issues and renamed the "properties" sidebar to "options":

The only thing I'm not completely ok with is the fact that whenever a redraw of the selected items occurs the selection bound and the nobs seem to "flicker", and since I added the sub_selection to the nob_layer this happens to the sub_selection rect too.

Nevertheless, I think the PR now could be merged, let me know what you think!