Skip to content

Update libadwaita, fix carousel colors and wrapping

Lorenzo Miglietta requested to merge ranfdev/Shortwave:carousel_colors into master

So, I wanted to update libadwaita to beta 1. Doing so brought a breaking change in the method AdwCarousel::scroll_to that now takes two parameters (one to indicate if you want to animate or not).

While fixing that, I've found some other improvements...

  • 1: before, the user could click really fast on the carousel's next button, causing the carousel to go from last_page to first_page (let's call this process "wrapping"). Clicking slowly resulted in the carousel adapting in time, by disabling the next button (making the wrap impossible). My proposed change removes wrapping in any case, making button behaviour more consistent.

  • 2: The previous color blending was wrong. The RGB scale is not linear. You must square the RGB values before adding them. I'm not great at explaining this. I've added a comment on the corresponding line of code with a URL to get more info about this topic.

  • 3: Improving the color blending brought up another issue (which was already present, but not as visible with the previous blending technique). See the comment on text color transition and timing.

Also, overall there are less lines than before :)

Edited by Lorenzo Miglietta

Merge request reports