Fix TOC issues: add ScrollArea, fix section jump mechanism
This commit is contained in:
25
src/app.rs
25
src/app.rs
@@ -367,15 +367,24 @@ BgType::Custom(ref path) if !path.is_empty() => {
|
||||
}
|
||||
|
||||
if action.toggle_theme {
|
||||
self.settings.theme = match self.settings.theme {
|
||||
theme::Theme::Light => theme::Theme::Dark,
|
||||
theme::Theme::Dark => theme::Theme::Sepia,
|
||||
theme::Theme::Sepia => theme::Theme::Light,
|
||||
};
|
||||
ctx.set_style(theme::create_style(&self.settings.theme));
|
||||
}
|
||||
self.settings.theme = match self.settings.theme {
|
||||
theme::Theme::Light => theme::Theme::Dark,
|
||||
theme::Theme::Dark => theme::Theme::Sepia,
|
||||
theme::Theme::Sepia => theme::Theme::Light,
|
||||
};
|
||||
ctx.set_style(theme::create_style(&self.settings.theme));
|
||||
}
|
||||
|
||||
if action.page_prev {
|
||||
if action.toggle_sidebar {
|
||||
self.state.sidebar_open = !self.state.sidebar_open;
|
||||
}
|
||||
|
||||
if let Some(section) = action.jump_to_section {
|
||||
self.state.current_section = section;
|
||||
self.state.current_page = 0;
|
||||
}
|
||||
|
||||
if action.page_prev {
|
||||
self.state.prev_page();
|
||||
}
|
||||
if action.page_next {
|
||||
|
||||
Reference in New Issue
Block a user