-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gui): add dynamic icon redefinition and reply functionality
- Introduced a `reply_revealer` widget to manage visibility of the reply entry. - Updated `update_from_details` method to accept `runtime_data` for dynamic icon redefinition. - Modified `from_details` method to handle `runtime_data` and pass it to `update_from_details`. - Added click event handling for the "inline-reply" action to toggle the reply entry or activate it. - Introduced `icon_redefines` in `_RuntimeData` to manage icon overrides dynamically.
- Loading branch information
Showing
3 changed files
with
77 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
use std::{cell::RefCell, collections::BTreeMap, rc::Rc}; | ||
use std::{ | ||
cell::RefCell, | ||
collections::{BTreeMap, HashMap}, | ||
rc::Rc, | ||
}; | ||
|
||
use crate::gui::window::Window; | ||
|
||
pub type RuntimeData = Rc<RefCell<_RuntimeData>>; | ||
|
||
#[derive(Default)] | ||
pub struct _RuntimeData { | ||
pub windows: BTreeMap<u32, Window>, | ||
pub icon_redefines: HashMap<String, String>, // TODO it has to be in config | ||
} | ||
|
||
impl Default for _RuntimeData { | ||
fn default() -> Self { | ||
let mut icon_redefines = HashMap::new(); | ||
icon_redefines.insert("inline-reply".to_owned(), "mail-reply".to_owned()); | ||
icon_redefines.insert("dismiss".to_owned(), "window-close".to_owned()); | ||
|
||
Self { | ||
windows: Default::default(), | ||
icon_redefines, | ||
} | ||
} | ||
} |