use super::AppModel;
use crate::keymap::ZoomStep;
use crate::transcript::AutoExpand;
const ZOOM_STEP: f32 = 0.1;
impl AppModel {
pub fn transcript_auto_expand(&self) -> AutoExpand {
AutoExpand {
responses: self.ui.transcript_expand_responses(),
others: self.ui.transcript_expand_others(),
}
}
pub fn set_transcript_expand_responses(&mut self, expand: bool) {
self.ui.set_transcript_expand_responses(expand);
}
pub fn set_transcript_expand_others(&mut self, expand: bool) {
self.ui.set_transcript_expand_others(expand);
}
pub fn notify_unfocused(&self) -> bool {
self.ui.notify_unfocused()
}
pub fn zoom(&self) -> f32 {
self.ui.zoom()
}
pub fn zoom_nudge(&mut self, step: ZoomStep) {
let zoom = match step {
ZoomStep::In => self.ui.zoom() + ZOOM_STEP,
ZoomStep::Out => self.ui.zoom() - ZOOM_STEP,
ZoomStep::Reset => 1.0,
};
self.ui.set_zoom(zoom);
}
}