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

build: decouple workspace and keyboard modules

Fixes #862
This commit is contained in:
Jake Stanger 2025-03-24 12:22:02 +00:00
parent 157e34ceb8
commit a4eb149816
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
4 changed files with 35 additions and 10 deletions

View file

@ -4,14 +4,24 @@ use gtk::prelude::*;
use gtk::{Button, IconTheme, Image, Label, Orientation};
use std::ops::Deref;
#[cfg(any(feature = "music", feature = "workspaces", feature = "clipboard"))]
#[derive(Debug, Clone)]
#[cfg(any(
feature = "clipboard",
feature = "keyboard",
feature = "music",
feature = "workspaces"
))]
pub struct IconButton {
button: Button,
label: Label,
}
#[cfg(any(feature = "music", feature = "workspaces", feature = "clipboard"))]
#[cfg(any(
feature = "clipboard",
feature = "keyboard",
feature = "music",
feature = "workspaces"
))]
impl IconButton {
pub fn new(input: &str, icon_theme: &IconTheme, size: i32) -> Self {
let button = Button::new();
@ -55,7 +65,7 @@ impl Deref for IconButton {
}
}
#[cfg(any(feature = "music", feature = "keyboard"))]
#[cfg(any(feature = "keyboard", feature = "music", feature = "workspaces"))]
pub struct IconLabel {
container: gtk::Box,
label: Label,
@ -65,7 +75,7 @@ pub struct IconLabel {
size: i32,
}
#[cfg(any(feature = "music", feature = "keyboard"))]
#[cfg(any(feature = "keyboard", feature = "music", feature = "workspaces"))]
impl IconLabel {
pub fn new(input: &str, icon_theme: &IconTheme, size: i32) -> Self {
let container = gtk::Box::new(Orientation::Horizontal, 0);