MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Fix #22055: button size changes when button is selected

Open SirKuzalot opened this issue 11 months ago • 3 comments

Resolves: #22055

The size of buttons in the MainToolBar was being determined by the size of the displayed text within them. Since this text size changed when the button was selected (the text becomes bold, thus increasing in size), the button size changed. I have set the button size to always be determined by the Selected Font Size, so size does not change upon selecting the button. A re-centering of the text was also required.

  • [x] I signed the CLA
  • [x] The title of the PR describes the problem it addresses
  • [x] Each commit's message describes its purpose and effects, and references the issue it resolves
  • [x] If changes are extensive, there is a sequence of easily reviewable commits
  • [x] The code in the PR follows the coding rules
  • [x] There are no unnecessary changes
  • [x] The code compiles and runs on my machine, preferably after each commit individually
  • [] I created a unit test or vtest to verify the changes I made (if applicable)

SirKuzalot avatar Apr 01 '24 15:04 SirKuzalot

Note that PageTabButton can also be used in horizontal orientation: Scherm­afbeelding 2024-04-02 om 18 42 56 In the horizontal orientation, the text needs to be left-aligned, otherwise the leftmost edges of the different buttons won't line up.

cbjeukendrup avatar Apr 02 '24 16:04 cbjeukendrup

@cbjeukendrup I have updated the code according to the advised changes.

The size used for row width is in fact being automatically (and correctly) calculated as implicitWidth, which is then used on higher levels of the file for any necessary calculations (it already takes into account the calculated textLabel width). As such, I am following your call and removing it from the code, as it is an unnecessary definition

Regarding the vertical menu unalignment, it was something that I had overlooked, and as such have now added a ternary operator to decide wether the alignment will be central or to the left

Finally, to assure I had not missed an important point as I did with the horizontal menus, I ran through the code to check all calls of PageTabButton and assure that the changes made did not, somehow, alter them in an unwanted way.

SirKuzalot avatar Apr 02 '24 17:04 SirKuzalot

Approved on my end!

avvvvve avatar Apr 29 '24 14:04 avvvvve

Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved https://github.com/musescore/MuseScore/issues/22055 FIXED

zacjansheski avatar May 01 '24 14:05 zacjansheski

@SirKuzalot One last question, what username did you use on MuseScore.org to sign the CLA?

cbjeukendrup avatar May 02 '24 00:05 cbjeukendrup

@cbjeukendrup The account is nicknamed SirKuzalot and the email submitted was the active email for this account: [email protected]

SirKuzalot avatar May 02 '24 00:05 SirKuzalot

Thanks! Somehow it didn't seem to appear in the list before, but now I see it.

cbjeukendrup avatar May 02 '24 00:05 cbjeukendrup