mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 00:57:26 +00:00
fw sync: ui-panels compiles: one Dialog::least_width (the container prop), story commands on CommandStates, tracked rail slots in a trial
This commit is contained in:
@@ -271,14 +271,6 @@ impl<'a> Dialog<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// The least width of the dialog's content from the size role `least`, in place of `size.dialog.least`: a wide
|
||||
/// dialog (`LeastWidth::WideDialog`) whose tabs hold tables.
|
||||
#[must_use]
|
||||
pub fn least_width(mut self, least: crate::contract::LeastWidth) -> Self {
|
||||
self.props = self.props.least_width(least);
|
||||
self
|
||||
}
|
||||
|
||||
/// The dialog reports the alert-dialog role instead of the dialog role.
|
||||
#[must_use]
|
||||
pub(super) fn alert(mut self) -> Self {
|
||||
|
||||
@@ -5,7 +5,7 @@ use super::host::{DialogResult, StackDialog};
|
||||
use super::prompt::{Prompt, Reply, apply_to_all, buttons};
|
||||
use super::stack::{DialogId, DialogStack, dialog_id};
|
||||
use super::words::DialogWords;
|
||||
use crate::contract::{Bind, NoValue, Outcome, Props as _, Show as _};
|
||||
use crate::contract::{Bind, NoValue, Outcome};
|
||||
use crate::runtime::env::{Env, Label};
|
||||
use crate::runtime::overlay::CloseReason;
|
||||
use crate::sections::DialogRole;
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::buttons::Button;
|
||||
use crate::contract::ShowContainer as _;
|
||||
use crate::contract::{Bind, BodyCx, Show as _, Validity};
|
||||
use crate::docking::{ColumnBar, GroupAt, IconicColumn, IconicColumnOutput, IconicMode, PanelSpec};
|
||||
use crate::runtime::commands::{CommandInput, CommandState};
|
||||
use crate::runtime::commands::{CommandState, CommandStates};
|
||||
use crate::runtime::env::{Env, Message};
|
||||
use crate::sections::Panel;
|
||||
use crate::testing::memory::global;
|
||||
@@ -44,11 +44,10 @@ fn toggled(panel: &u8) -> PanelSpec {
|
||||
|
||||
/// Brushes has something to show while it is closed, so its cell carries the marker; Swatches has something to show
|
||||
/// but is open, so its cell carries none; History has nothing to show.
|
||||
fn marked_states(input: CommandInput) -> CommandInput {
|
||||
input
|
||||
.state(PanelToggles::Brushes, CommandState::new().checked(false).marked(true).hint("3 new brushes"))
|
||||
.state(PanelToggles::Swatches, CommandState::new().checked(true).marked(true).hint("2 new swatches"))
|
||||
.state(PanelToggles::History, CommandState::new().checked(false))
|
||||
fn marked_states(states: &mut CommandStates) {
|
||||
states.set(PanelToggles::Brushes, CommandState::new().checked(false).marked(true).hint("3 new brushes"));
|
||||
states.set(PanelToggles::Swatches, CommandState::new().checked(true).marked(true).hint("2 new swatches"));
|
||||
states.set(PanelToggles::History, CommandState::new().checked(false));
|
||||
}
|
||||
|
||||
/// Shows `column` as a dock shows it: at the end edge of a stage, as wide as the rail, its flyouts opening over the
|
||||
|
||||
@@ -176,9 +176,9 @@ fn the_drawer_opens_on_the_side_it_is_given() {
|
||||
#[trial]
|
||||
fn the_edit_toolbar_button_takes_the_apps_icon() {
|
||||
use craft_ui::rails::{LastUsed, ToolRail};
|
||||
let slots = Tracked::new(vec![slot(0, &[UNDO])]);
|
||||
let last = Tracked::new(LastUsed::default());
|
||||
let mut fixture = Fixture::new(move |ui| {
|
||||
let slots = [slot(0, &[UNDO])];
|
||||
let last = LastUsed::default();
|
||||
let _ = ToolRail::new("Tools", &slots, &UNDO, &last)
|
||||
.edit_toolbar("Customize")
|
||||
.edit_icon(craft_behavior::IconId::new("settings"))
|
||||
|
||||
Reference in New Issue
Block a user