breadhelp/src/ui/guide_view.rs
Breadway 54e765afd0 Rename .title CSS class to .page-title to avoid libadwaita collision
bread-theme's shared .title rule (1.4em bold) was a bare class selector
that also matched libadwaita's internal row/window-title labels, which
carry the same "title" class. That's what inflated breadman's settings
row titles to ~24px. Scoping the name to .page-title here (the only
consumer of the old class) and bumping bread-theme to the dev branch
where the rename lives.
2026-07-30 20:01:33 +08:00

20 lines
733 B
Rust

use gtk4::prelude::*;
use gtk4::{Box as GBox, Label, Orientation, ScrolledWindow, Widget};
use crate::content::{keybinds::Keybind, markdown, ContentStore, Guide};
pub fn build(store: &ContentStore, guide: &Guide, simplified: bool, binds: &[Keybind]) -> Widget {
let vbox = GBox::new(Orientation::Vertical, 12);
vbox.add_css_class("view-content");
let title = Label::new(Some(&guide.meta.title));
title.add_css_class("page-title");
title.set_xalign(0.0);
vbox.append(&title);
let body = store.body(guide, simplified);
let blocks = markdown::parse(&body);
vbox.append(&markdown::render(&blocks, binds));
ScrolledWindow::builder().child(&vbox).vexpand(true).hexpand(true).build().upcast()
}