mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 03:17:43 +00:00
ui-panels, ui-widgets: opener visibility, muted shade, key type, unused import
This commit is contained in:
@@ -3,13 +3,12 @@
|
||||
use super::prompt::{Prompt, Reply, buttons};
|
||||
use super::words::DialogWords;
|
||||
use crate::contract::{Bind, Props as _, Show as _, ShowContainer as _};
|
||||
use crate::display::{Progress, Text};
|
||||
use crate::display::{Progress, Shade, Text};
|
||||
use crate::layout_components::Row;
|
||||
use crate::runtime::env::{Env, Label};
|
||||
use crate::runtime::words::CommonWords;
|
||||
use crate::sections::DialogRole;
|
||||
use crate::style::TypeRole;
|
||||
use craft_theme::variant::Tone;
|
||||
use egui::{Response, Ui};
|
||||
|
||||
/// Modal progress window for a running job: a progress bar (or an indeterminate one), counts and the percentage, the
|
||||
@@ -82,7 +81,7 @@ impl JobProgress {
|
||||
if counts.is_some() || percent.is_some() {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
for text in counts.iter().cloned().chain(percent.iter().cloned().map(Label::from)) {
|
||||
Text::new(text).role(TypeRole::Caption).tone(Tone::Muted).show(ui);
|
||||
Text::new(text).role(TypeRole::Caption).shade(Shade::Muted).show(ui);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ const GRID_OPTIONS: &str = "Grid Options…";
|
||||
|
||||
/// The open state a story's dialog binds, behind the button that opens it: dialogs start closed, and the button opens
|
||||
/// the real one.
|
||||
fn opener<'d>(ui: &mut Ui, data: &'d mut StoryData, label: &'static str) -> &'d mut bool {
|
||||
pub(super) fn opener<'d>(ui: &mut Ui, data: &'d mut StoryData, label: &'static str) -> &'d mut bool {
|
||||
let open = data.value("open", false);
|
||||
if clicked(&Button::new(label).show(ui)) {
|
||||
*open = true;
|
||||
|
||||
@@ -820,7 +820,7 @@ impl Component for FooterBar {
|
||||
let Some(pass) = frame::running(&ctx) else { return };
|
||||
let focused = WindowHost::of(&ctx).facts(pass.viewport).is_some_and(|facts| facts.focused);
|
||||
let held = !crate::runtime::pointer::frame(&ctx).buttons.is_empty()
|
||||
|| keys::held(&ctx).iter().any(|key| matches!(key, egui::Key::Enter | egui::Key::Space));
|
||||
|| keys::held(&ctx).iter().any(|key| matches!(key, Key::Enter | Key::Space));
|
||||
let arming = cx.keep::<Arming>();
|
||||
let continues = arming.frame.is_some_and(|last| pass.frame_nr == last || pass.frame_nr == last + 1);
|
||||
if !(continues && focused) {
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::runtime::env::Label;
|
||||
use crate::style::{StyleColor, TypeRole};
|
||||
use craft_behavior::{ColumnKey, Flow, PartKey};
|
||||
use craft_theme::ControlSize;
|
||||
use egui::{Rect, Vec2, pos2, vec2};
|
||||
use egui::{Rect, Vec2, vec2};
|
||||
use smallvec::SmallVec;
|
||||
|
||||
/// The chevron of the up half of a step strip.
|
||||
|
||||
Reference in New Issue
Block a user