1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

feat: libinput keys module

Adds a new module which shows the status of toggle mod keys (capslock, num lock, scroll lock).

Resolves #700
This commit is contained in:
Jake Stanger 2024-11-17 23:46:02 +00:00
parent 353ee92d48
commit ccfe73f6a7
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
20 changed files with 799 additions and 107 deletions

View file

@ -20,6 +20,8 @@ pub struct WidgetGeometry {
pub trait IronbarGtkExt {
/// Adds a new CSS class to the widget.
fn add_class(&self, class: &str);
/// Removes a CSS class to the widget.
fn remove_class(&self, class: &str);
/// Gets the geometry for the widget
fn geometry(&self, orientation: Orientation) -> WidgetGeometry;
@ -34,6 +36,10 @@ impl<W: IsA<Widget>> IronbarGtkExt for W {
self.style_context().add_class(class);
}
fn remove_class(&self, class: &str) {
self.style_context().remove_class(class);
}
fn geometry(&self, orientation: Orientation) -> WidgetGeometry {
let allocation = self.allocation();