ui-panels, ui-widgets: opener visibility, muted shade, key type, unused import

This commit is contained in:
bflatastic
2026-11-21 21:38:28 +07:00
parent 081a6ac235
commit 159842ccb1
4 changed files with 5 additions and 6 deletions
+2 -3
View File
@@ -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);
}
});
}
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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.