diff --git a/crates/ui-shell/src/shell/start.rs b/crates/ui-shell/src/shell/start.rs index 311e10148..29def29c5 100644 --- a/crates/ui-shell/src/shell/start.rs +++ b/crates/ui-shell/src/shell/start.rs @@ -6,29 +6,33 @@ mod stories; use super::recent::{RecentFile, RecentSort, RecentView, Template, ThumbKey, sort_recent}; use super::words::ShellWords; +use crate::buttons::button::ButtonStyleKey; use crate::buttons::{Button, Link}; use crate::choice::Segmented; use crate::contract::{ ActivateOn, Bind, BodyCx, CollectionEvent, Entry, Gap, NoValue, Outcome, Pad, Pattern, Props, Remember as _, Scroll, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing, clicked, }; -use crate::display::{Divider, Icon}; +use crate::display::{Divider, Icon, Text}; use crate::layout_components::{Row, Stack}; use crate::list::{List, ListRow, RowEvent, ThumbAspect, ThumbSize, TrailingFace, TrailingPart}; use crate::menu::{Menu, MenuItem}; use crate::notices::{Notice, NoticeLayout}; use crate::pickers::Select; -use crate::primitives::{CheckerArea, ContentPainterCx, IconSpec, Priority, ThumbPaint, ThumbRequest, ThumbSource, Thumbnails, paint_surround}; +use crate::primitives::{ + CheckerArea, ContentPainterCx, HAlign, IconSpec, Priority, RectSide, Rule, RuleKind, ThumbPaint, ThumbRequest, ThumbSource, Thumbnails, + paint_surround, +}; use crate::runtime::commands::{self, CommandRef, FireSource}; use crate::runtime::commands::{CommandSet as _, Commands as _}; use crate::runtime::env::{AgeStyle, Env, Label}; use crate::sections::Section; -use crate::style::{Corners, SurfaceKind, SurroundLook}; +use crate::style::{Corners, StyleCx, SurfaceKind, SurroundLook, TypeRole}; use crate::tile_grid::{CaptionPlace, Tile, TileGrid, TilePartEvent}; use craft_behavior::{IconId, Proposal, SelectionChange, keyed}; -use craft_theme::Variant; -use craft_theme::variant::Tone; -use egui::{CornerRadius, Rect, Response, Ui, Vec2}; +use craft_theme::variant::{CustomVariant, Emphasis, RadiusStep, Tone, VariantLook}; +use craft_theme::{Rgba, Tokens, Variant}; +use egui::{CornerRadius, Rect, Response, Ui, Vec2, pos2, vec2}; use std::borrow::Cow; use std::cell::RefCell; use std::path::{Path, PathBuf}; @@ -43,6 +47,13 @@ const PICTURE_HIGH: u16 = 9; /// The number of recent files shown until `max_recent` says otherwise. const RECENT_SHOWN: usize = 12; +const HOME_BREAKPOINT: f32 = 640.0; +const HOME_RAIL_WIDTH: f32 = 170.0; +const HOME_COMPACT_WIDTH: f32 = 520.0; +const HOME_DROP_WIDTH: f32 = 540.0; +const HOME_DROP_HEIGHT: f32 = 200.0; +const HOME_DROP_LOOK: CustomVariant = CustomVariant::new::("craft_ui.home-drop", home_drop_look); + /// The revealed part of a recent row that takes the file off the list. const REMOVE: TrailingPart = TrailingPart::new(0); @@ -172,6 +183,12 @@ pub struct StartScreen<'a> { /// With no recent files, the Recent body is a drop card with this hint that opens a file on a click. #[prop(into)] drop_hint: Option