mirror of
https://github.com/JakeStanger/ironbar.git
synced 2024-11-30 05:24:20 +03:00
fix: add sensible class names for icon labels
BREAKING CHANGE: Where both textual and image icons are supported, CSS classes have changed to better reflect their targets. `.icon` has changed to `.icon-box` and `.icon` now targets the underlying element. `.label` has been changed to `.icon.text-icon`. This affects icons on the **music**, **workspaces**, and **clipboard** modules. Resolves #185.
This commit is contained in:
parent
cbba2bc614
commit
e11177fea3
@ -10,6 +10,7 @@ pub fn new_icon_button(input: &str, icon_theme: &IconTheme, size: i32) -> Button
|
|||||||
if ImageProvider::is_definitely_image_input(input) {
|
if ImageProvider::is_definitely_image_input(input) {
|
||||||
let image = Image::new();
|
let image = Image::new();
|
||||||
add_class(&image, "image");
|
add_class(&image, "image");
|
||||||
|
add_class(&image, "icon");
|
||||||
|
|
||||||
match ImageProvider::parse(input, icon_theme, size)
|
match ImageProvider::parse(input, icon_theme, size)
|
||||||
.map(|provider| provider.load_into_image(image.clone()))
|
.map(|provider| provider.load_into_image(image.clone()))
|
||||||
@ -35,6 +36,7 @@ pub fn new_icon_label(input: &str, icon_theme: &IconTheme, size: i32) -> gtk::Bo
|
|||||||
|
|
||||||
if ImageProvider::is_definitely_image_input(input) {
|
if ImageProvider::is_definitely_image_input(input) {
|
||||||
let image = Image::new();
|
let image = Image::new();
|
||||||
|
add_class(&image, "icon");
|
||||||
add_class(&image, "image");
|
add_class(&image, "image");
|
||||||
|
|
||||||
container.add(&image);
|
container.add(&image);
|
||||||
@ -43,7 +45,8 @@ pub fn new_icon_label(input: &str, icon_theme: &IconTheme, size: i32) -> gtk::Bo
|
|||||||
.map(|provider| provider.load_into_image(image));
|
.map(|provider| provider.load_into_image(image));
|
||||||
} else {
|
} else {
|
||||||
let label = Label::new(Some(input));
|
let label = Label::new(Some(input));
|
||||||
add_class(&label, "label");
|
add_class(&label, "icon");
|
||||||
|
add_class(&label, "text-icon");
|
||||||
|
|
||||||
container.add(&label);
|
container.add(&label);
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,7 @@ impl IconLabel {
|
|||||||
let icon = new_icon_label(icon_input, icon_theme, 24);
|
let icon = new_icon_label(icon_input, icon_theme, 24);
|
||||||
let label = Label::new(label);
|
let label = Label::new(label);
|
||||||
|
|
||||||
add_class(&icon, "icon");
|
add_class(&icon, "icon-box");
|
||||||
add_class(&label, "label");
|
add_class(&label, "label");
|
||||||
|
|
||||||
container.add(&icon);
|
container.add(&icon);
|
||||||
|
Loading…
Reference in New Issue
Block a user