JFLib

ui/office_gallery.rs#

Source: lib/ui/office_gallery.rs

Reusable document-theme thumbnails drawn with the shared UI rasterizer.
This is a visual chooser, independent of an application's document commands or formats.

impl Ui

  • fn preview_card(&mut self, id: u32, label: &str, draw: Option<crate::DrawRef>, user: usize, version: u32) -> u32 Focusable document/template preview card, naturally 150×194 DIP. The supplied drawing is inset into a white page; its document colors never follow the UI theme. Hover and selection use the style accent. The full label is exposed to agents.
  • fn ribbon_theme_tile( &mut self, id: u32, label: &str, theme_color: u32, variant: u32, ) -> u32 A 56×66-DIP theme chooser containing a 52×50-DIP miniature page. theme_color is a document color, independent of the interface theme. variant selects one of seven sample arrangements (0..=6); larger values wrap. next_flags(ST_DISABLED | ST_CHECKED) controls behavior and selection, while the document sample remains fully readable. The caller applies its own theme on EV_ACT.
  • fn ribbon_image_tile(&mut self, id: u32, label: &str, sf: &alloc::rc::Rc<gfx::Surface>, ver: u32) -> u32 (JFDiagrammer JD11) a gallery tile with a picture the app made: the theme chooser's 56 x 66 DIP button (or next_size) with sf inside a page frame of 52 x 50 DIP, scaled to fit and centred; ver stands for the picture's version. next_flags(ST_CHECKED) marks the current choice (accent frame), ST_DISABLED disables it. EV_HOVER lets the caller show a live preview, EV_ACT applies; the label is the tooltip and the name the screen reader reads.

Source: docs/API.md in the JFLib repository.