Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indicate nbx activation as with gatom #1749

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

umlaeute
Copy link
Contributor

@umlaeute umlaeute commented Sep 9, 2022

activation indicator

this simply uses the border width to indicate whether an iemgui [nbx] is active or not, similar as the ordinary gatoms do it (which is nice as it doesn't clash with any color concepts)

active-nbx

streamlined number shortening algorithm

at also uses the same float-shortening algorithm as the number gatom (so if the number is too big, it displays a trailing > rather than replacing the entire number with a +

nbx-shortener

improved fontwidth calculation

the new calculation uses the system fontspecs (as other objects/gatoms do), getting rid of the empty space on the right hand of the nbx.
for backwards compatibility, we make sure that the new width is not bigger than it used to be (so objects on GOPs will always be visible). this shouldn't be an issue with the default fonts, but might be one, if a weird non-standard font is used).
it's possible to force the old behaviour by setting the compat-level to <0.53

nbx-width

@umlaeute umlaeute added subject:GUI things concerning the GUI side improvement improves an existing functionality without adding new features labels Sep 9, 2022
@reduzent
Copy link
Contributor

reduzent commented Sep 13, 2022

Looks definitely nicer without the unnecessary whitespace on the right. However, it breaks many layouts:

image

What makes matters worse is that there is no way to make the new nbx fit into the box size it had before. At least, it is not breaking functionality as this change reduces size only.

On a related note: When using an odd height, the triangle cannot be rendered with exact 45 degree lines, which looks ugly:

image

This is not a regression of this MR, rather it is something that might be addressed with the same MR.

@umlaeute
Copy link
Contributor Author

@reduzent i think i've fixed the ugly triangles with my last commit 019037e

@porres

This comment was marked as resolved.

umlaeute and others added 5 commits May 6, 2024 10:50
the new calculation uses the system fontspecs (as other objects/gatoms do).
for backwards compatibility, we make sure that the new width is not bigger
than it used to be (so objects on GOPs will still be visible).

you can force the old width via compatibility <0.53

Closes: pure-data#1755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement improves an existing functionality without adding new features subject:GUI things concerning the GUI side
Projects
None yet
4 participants