mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-16 22:31:03 +02:00
refactor: put in basic placeholders for menu icon diffs
This commit is contained in:
parent
662ddb6946
commit
486beff8a5
2 changed files with 12 additions and 5 deletions
|
@ -18,7 +18,9 @@ pub struct MenuItemDiff {
|
||||||
/// True if the item is visible in the menu.
|
/// True if the item is visible in the menu.
|
||||||
pub visible: Option<bool>,
|
pub visible: Option<bool>,
|
||||||
/// Icon name of the item, following the freedesktop.org icon spec.
|
/// Icon name of the item, following the freedesktop.org icon spec.
|
||||||
// pub icon_name: Option<Option<String>>,
|
pub icon_name: Option<Option<String>>,
|
||||||
|
/// PNG icon data.
|
||||||
|
pub icon_data: Option<Option<Vec<u8>>>,
|
||||||
/// Describe the current state of a "togglable" item. Can be one of:
|
/// Describe the current state of a "togglable" item. Can be one of:
|
||||||
/// - Some(true): on
|
/// - Some(true): on
|
||||||
/// - Some(false): off
|
/// - Some(false): off
|
||||||
|
@ -52,7 +54,8 @@ impl MenuItemDiff {
|
||||||
label: diff!(&label),
|
label: diff!(&label),
|
||||||
enabled: diff!(enabled),
|
enabled: diff!(enabled),
|
||||||
visible: diff!(visible),
|
visible: diff!(visible),
|
||||||
// icon_name: diff!(&icon_name),
|
icon_name: diff!(&icon_name),
|
||||||
|
icon_data: diff!(&icon_data),
|
||||||
toggle_state: diff!(toggle_state),
|
toggle_state: diff!(toggle_state),
|
||||||
submenu: get_diffs(&old.submenu, &new.submenu),
|
submenu: get_diffs(&old.submenu, &new.submenu),
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,9 +343,13 @@ impl TrayMenuItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Image support
|
// TODO: Image support
|
||||||
// if let Some(icon_name) = diff.icon_name {
|
if let Some(_icon_name) = diff.icon_name {
|
||||||
//
|
warn!("received unimplemented menu icon update");
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
if let Some(_icon_data) = diff.icon_data {
|
||||||
|
warn!("received unimplemented menu icon update");
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(enabled) = diff.enabled {
|
if let Some(enabled) = diff.enabled {
|
||||||
match &self.widget {
|
match &self.widget {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue