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

consider unicode spinner #420

Closed
mfrasca opened this issue Sep 2, 2018 · 1 comment
Closed

consider unicode spinner #420

mfrasca opened this issue Sep 2, 2018 · 1 comment
Labels
opportunity let's smooth it out

Comments

@mfrasca
Copy link
Member

mfrasca commented Sep 2, 2018

we have a small spinner, built on braille characters, showing in sequence one of ⣄⡆⠇⠋⠙⠸⢰⣠
this has the advantage that it can be part of any string, at any place, for these characters all use up the same space in the string.
for isolated spinners, what about we use the angle property of Gtk.Label?
not all characters are equally usable, for not all stay at the same spot when rotated.
the one I like most:
I think this is funny: (tea)
these look fine as long as they aren't rotating:
and if we were Chinese, we could consider: (wait)

you make this easily spin, by adding this code to a presenter initializer:

    self.spinner = self.view.widgets.<spinning label id>
    self.angle = 0
    GLib.timeout_add(20, self.rotate)

and the callback would look like this:

def rotate(self):
    self.angle -= 5
    self.angle %= 360
    self.spinner.set_angle(self.angle)
    return True

right, maybe 5 degrees is too smooth, and 20ms is too often, but see it for yourself.

@mfrasca mfrasca added the opportunity let's smooth it out label Sep 2, 2018
@mfrasca
Copy link
Member Author

mfrasca commented Sep 19, 2018

Used it in #421 - #328 (Pocket Server) and it looks quite nice. The main problem with it is that when you set the angle of a label to 45 (135, etc), it might become higher than it is at angle=0°, 90°, etc. in PocketServer I put the label in a double-height button in a grid, so this does not become noticeable. But in a normal label no, it won't easily work.

@mfrasca mfrasca closed this as completed Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opportunity let's smooth it out
Projects
None yet
Development

No branches or pull requests

1 participant