-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for vertical status bar? #28
Comments
Apologies for the delay @e-matteson - I didn't see this in my inbox until now!
I'm very pleased to hear that! :) I've been meaning to document the stuff in
That'd be great!
If I add a Where are you trying the
It'd be nice if there were a way for it to keep all the rendering horizontal but then have it all magically translated, but I can't see an easy way to do that with Cairo. I think you're on the right track. I think once you get the text actually rendering vertically, it'll mostly be a case of doing something like:
... but don't worry about messing that existing code up too much: those two functions are a bit of a mess anyway, so you might even improve them. If you manage to get something working, please do raise a PR and we can discuss anything you're unsure or unhappy with. |
In case you haven't found it, the Gnome documentation for Cairo is pretty good: https://www.cairographics.org/documentation/cairomm/reference/classCairo_1_1Context.html#a332811cd74028c20b5832501ec46d67e It's usually obvious how to translate it to the Rust bindings. |
I've been looking for a status bar that's positioned along the left or right edge of the screen, with text rotated 90 degrees. It seems like a good way to save precious vertical space on tiny laptop screens, but I haven't found any status bars with this option. So writing / modifying one myself seems like the thing to do. I'm here at cnx because rust, and because it has the most readable source of any status bar I've looked at.
So, how do you feel about having
Position::Left
andPosition::Right
options for a vertical statusbar? Do you have any advice on the best way to implement it, without making a mess of your existing code?I just spent a few minutes messing around with
Position::Left
, and it seems simple to get the struts and the surface in more or less the right place. The text rendering is more complicated, though, and I have no experience with cairo. Maybe all the text can be rendered normally, using the screen height as the text "width", and then the whole cairo context can be rotate 90 degrees? I tried addingcontext.rotate(PI / 2.)
, and it rotates the background rectangle, but there's no text visible.The text was updated successfully, but these errors were encountered: