-
Notifications
You must be signed in to change notification settings - Fork 3
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
wish: highlight current window #11
Comments
I believe this is the right code to a new CSS class to the focused window. However, I'm not having any luck targeting the CSS class to get it to display differently: diff --git a/src/ui.rs b/src/ui.rs
index 771d94e..d15948e 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -80,6 +80,11 @@ fn build_ui(app: &Application, args: Arc<Args>, conn: Arc<Mutex<Connection>>) {
// TODO: make this work for workspaces with more than 26 windows
label.set_markup(&format!("{}", ('a' as usize + idx % 26) as u8 as char));
fixed.put(&label, x, y);
+
+ // Apply a CSS class to the focused window so it can be stylced differently
+ if window.focused {
+ fixed.set_widget_name("focused");
+ }
}
window.add(&fixed); |
Merged
Merged
Thanks @markstos! You were very close; after taking a quick look at the gtkrs docs, I tried |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be a nice enhancement if the currently focused window was visually noted during the overlay.
For example, usually white letters are shown on a black square. Perhaps for the currently focused window, black letters on a white square could be used.
The text was updated successfully, but these errors were encountered: