use slint::ComponentHandle;
use crate::Theme;
use crate::shell::Platform;
impl super::AppAdapter_adp {
pub fn set_active_view(&self, name: &str) {
*self.active_view.borrow_mut() = name.to_string();
self.ui.set_active_view(name.into());
}
pub fn get_active_view(&self) -> String {
self.active_view.borrow().clone()
}
pub fn set_dark_mode(&self, on: bool) {
*self.dark_mode.borrow_mut() = on;
self.ui.global::<Theme>().set_dark(on);
}
pub fn get_dark_mode(&self) -> bool {
*self.dark_mode.borrow()
}
pub fn set_status(&self, text: &str) {
*self.status_text.borrow_mut() = text.to_string();
self.ui.set_status_text(text.into());
}
pub fn get_status(&self) -> String {
self.status_text.borrow().clone()
}
pub fn get_zoom(&self) -> f32 {
*self.zoom.borrow()
}
pub fn get_row_top_ratio(&self) -> f32 {
*self.row_top_ratio.borrow()
}
pub fn get_row_main_ratio(&self) -> f32 {
*self.row_main_ratio.borrow()
}
pub fn set_platform(&self, platform: Platform) {
self.ui.global::<Theme>().set_platform(platform.as_str().into());
*self.platform.borrow_mut() = platform;
}
pub fn get_platform(&self) -> Platform {
self.platform.borrow().clone()
}
}