mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 23:01:04 +02:00
feat: change icon_overrides
to apply to all resolved images
This commit is contained in:
parent
3e55d87c3a
commit
3a0e102afc
7 changed files with 18 additions and 64 deletions
|
@ -261,11 +261,7 @@ impl Module<gtk::Box> for KeyboardModule {
|
|||
|
||||
let caps = IconLabel::new(&self.icons.caps_off, self.icon_size, &image_provider);
|
||||
let num = IconLabel::new(&self.icons.num_off, self.icon_size, &image_provider);
|
||||
let scroll = IconLabel::new(
|
||||
&self.icons.scroll_off,
|
||||
self.icon_size,
|
||||
&image_provider,
|
||||
);
|
||||
let scroll = IconLabel::new(&self.icons.scroll_off, self.icon_size, &image_provider);
|
||||
|
||||
caps.label().set_angle(self.layout.angle(info));
|
||||
caps.label().set_justify(self.layout.justify.into());
|
||||
|
|
|
@ -23,23 +23,16 @@ pub struct Item {
|
|||
pub open_state: OpenState,
|
||||
pub windows: IndexMap<usize, Window>,
|
||||
pub name: String,
|
||||
pub icon_override: String,
|
||||
}
|
||||
|
||||
impl Item {
|
||||
pub fn new(
|
||||
app_id: String,
|
||||
icon_override: String,
|
||||
open_state: OpenState,
|
||||
favorite: bool,
|
||||
) -> Self {
|
||||
pub fn new(app_id: String, open_state: OpenState, favorite: bool) -> Self {
|
||||
Self {
|
||||
app_id,
|
||||
favorite,
|
||||
open_state,
|
||||
windows: IndexMap::new(),
|
||||
name: String::new(),
|
||||
icon_override,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,7 +107,6 @@ impl From<ToplevelInfo> for Item {
|
|||
open_state,
|
||||
windows,
|
||||
name,
|
||||
icon_override: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -179,9 +171,7 @@ impl ItemButton {
|
|||
}
|
||||
|
||||
if appearance.show_icons {
|
||||
let input = if !item.icon_override.is_empty() {
|
||||
item.icon_override.clone()
|
||||
} else if item.app_id.is_empty() {
|
||||
let input = if item.app_id.is_empty() {
|
||||
item.name.clone()
|
||||
} else {
|
||||
item.app_id.clone()
|
||||
|
|
|
@ -30,17 +30,11 @@ impl Pagination {
|
|||
) -> Self {
|
||||
let scroll_box = gtk::Box::new(orientation, 0);
|
||||
|
||||
let scroll_back = IconButton::new(
|
||||
icon_context.back,
|
||||
icon_context.size,
|
||||
image_provider.clone(),
|
||||
);
|
||||
let scroll_back =
|
||||
IconButton::new(icon_context.back, icon_context.size, image_provider.clone());
|
||||
|
||||
let scroll_fwd = IconButton::new(
|
||||
icon_context.fwd,
|
||||
icon_context.size,
|
||||
image_provider.clone(),
|
||||
);
|
||||
let scroll_fwd =
|
||||
IconButton::new(icon_context.fwd, icon_context.size, image_provider.clone());
|
||||
|
||||
scroll_back.set_sensitive(false);
|
||||
scroll_fwd.set_sensitive(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue