Slide show bar and grid: the framework's over_picture() and ColumnRule::fit_to_view

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dylan M. Taylor
2026-11-29 15:23:22 +00:00
co-authored by Claude Opus 5.5
parent 08a631ad03
commit cbd3c49c8e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
use super::Show;
use super::commands::ShowCommands;
use craft::behavior::IconId;
use craft::ui::bars::{Bar, BarBackgroundPress, BarKind, BarLook};
use craft::ui::bars::{Bar, BarBackgroundPress, BarKind};
use craft::ui::buttons::{Button, IconButton, ToggleButton};
use craft::ui::contract::{Props as _, Show as _, ShowContainer as _};
use craft::ui::display::Text;
@@ -42,7 +42,7 @@ pub(crate) fn show(ui: &mut Ui, show: &Show, doc: &Presentation, room: Rect) {
} else if !show.grid && (show.pointer_awake(frame::clock(ui.ctx())) || show.zoom_arm) {
let rect = Rect::from_min_size(pos2(room.min.x + 16.0, room.max.y - 50.0), vec2((room.width() - 32.0).clamp(32.0, 520.0), STRIP_HEIGHT));
let mut child = ui.new_child(UiBuilder::new().id_salt("show.floating.bar").max_rect(rect));
Bar::new(Word::plain("Slide show controls"), BarKind::Tool).look(BarLook::OverPicture).background_press(BarBackgroundPress::Absorb).show(
Bar::new(Word::plain("Slide show controls"), BarKind::Tool).over_picture().background_press(BarBackgroundPress::Absorb).show(
&mut child,
|ui, _| {
IconButton::command(IconId::new("chevron_left"), ShowCommands::Previous).show(ui);
+1 -1
View File
@@ -29,7 +29,7 @@ pub enum GridSource<'a> {
fn grid<'a>(aspect: f32) -> TileGrid<'a, usize> {
TileGrid::new(Word::plain("All slides"))
.column_rule(ColumnRule::FitToView { most_columns: 8 })
.column_rule(ColumnRule::fit_to_view(8))
.aspect(aspect)
.select(SelectMode::Single)
.activate(ActivateOn::Click)