Trying to clena the mess opened by plugins

This commit is contained in:
2026-02-21 01:03:55 +01:00
parent 5ef988382b
commit e9bca2548c
67 changed files with 1246 additions and 69 deletions

View File

@@ -113,7 +113,7 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, area: Rect) {
let onboarding_str = format!("{}/6 dismissed", app.ui.onboarding_dismissed.len());
let hue_str = format!("{}°", app.ui.hue_rotation as i32);
let lines: Vec<Line> = vec![
let mut lines: Vec<Line> = vec![
render_section_header("DISPLAY", &theme),
render_divider(content_width, &theme),
render_option_line(
@@ -168,7 +168,31 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, area: Rect) {
focus == OptionsFocus::ShowPreview,
&theme,
),
Line::from(""),
];
let zoom_str = format!("{:.0}%", app.ui.zoom_factor * 100.0);
let window_str = format!("{}x{}", app.ui.window_width, app.ui.window_height);
if app.plugin_mode {
lines.push(render_option_line(
"Font",
&app.ui.font,
focus == OptionsFocus::Font,
&theme,
));
lines.push(render_option_line(
"Zoom",
&zoom_str,
focus == OptionsFocus::ZoomFactor,
&theme,
));
lines.push(render_option_line(
"Window",
&window_str,
focus == OptionsFocus::WindowSize,
&theme,
));
}
lines.push(Line::from(""));
lines.extend([
link_header,
render_divider(content_width, &theme),
render_option_line(
@@ -217,12 +241,12 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, area: Rect) {
focus == OptionsFocus::ResetOnboarding,
&theme,
),
];
]);
let total_lines = lines.len();
let max_visible = padded.height as usize;
let focus_line = focus.line_index();
let focus_line = focus.line_index(app.plugin_mode);
let scroll_offset = if total_lines <= max_visible {
0