mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-29 17:54:59 +01:00
prod merge: look round 17: text box Done/Discard bar compact with the catalogue's close icon (every app x icon is close); flat note Reply (NoteReplyLook::Flat); Split stacks its ways with each setting under its way; Background's colour well beside From colour; percent rows read 100.0%; Enhance's range has no Subset
This commit is contained in:
1 parent
d30169ce01
commit
1d456d58a3
9 files changed
+29
-16
No files matched your search
@@ -548,12 +548,14 @@ impl PdfCraftApp {
|
||||
// Every parameter dialog lays out as a document dialog: inline captions, shaded groups, buttons across the foot.
|
||||
root.values.set(craft::ui::patterns::form_dialogs::DialogLayout(craft::ui::patterns::form_dialogs::ParamLayout::Document));
|
||||
// PdfCraft's looks, opt-in over the framework's defaults: the filled dropdown triangle, shrinking document
|
||||
// tabs with the modified dot, quiet (ghost) Cancel and Don't Save, and the theme's page insets.
|
||||
// tabs with the modified dot, quiet (ghost) Cancel and Don't Save, the theme's page insets and the note
|
||||
// pop-up's flat Reply button.
|
||||
root.values
|
||||
.set(craft::ui::controls::disclosure::DropdownArrow::Triangle)
|
||||
.set(craft::ui::tabs::DocumentTabLook::Shrinking)
|
||||
.set(craft::ui::sections::DialogButtonLook::Quiet)
|
||||
.set(craft::pages::ui::PageInsets::Theme);
|
||||
.set(craft::pages::ui::PageInsets::Theme)
|
||||
.set(craft::review::ui::thread::NoteReplyLook::Flat);
|
||||
root.motion = self.animation_effects;
|
||||
// Today is the session's day, the one its date formats and Fill & Sign's Date tool use: the calendars ring it
|
||||
// and pick it.
|
||||
|
||||
@@ -168,7 +168,7 @@ pub(super) fn organize_grid(view: &mut DocView, doc: &pdfcraft_engine::Document,
|
||||
// PLAN: assumed `Props::tooltip(impl Into<Tooltip>)` and `TooltipSpec -> Tooltip`.
|
||||
let hint = craft::ui::contract::TooltipSpec::new(tl!("Save these pages as one PDF")).disabled_text(tl!("No changes to save"));
|
||||
save |= Button::new(tl!("Save pages")).variant(Variant::PRIMARY).enabled(dirty).tooltip(hint).show(ui).clicked();
|
||||
close |= Button::new(tl!("Close")).variant(Variant::GHOST).icon(IconId::new("x")).show(ui).clicked();
|
||||
close |= Button::new(tl!("Close")).variant(Variant::GHOST).icon(IconId::new("close")).show(ui).clicked();
|
||||
})
|
||||
.show(cx.ui, |ui, _| {
|
||||
Text::new(label.clone()).show(ui);
|
||||
|
||||
@@ -515,8 +515,9 @@ fn choice(options: impl IntoIterator<Item = (String, String)>, default: &str) ->
|
||||
ParamKind::choice(options.into_iter().map(|(id, label)| (id, label.into())).collect(), Some(default.to_string()))
|
||||
}
|
||||
|
||||
/// A percent row: production shows one decimal and the sign ("100.0%").
|
||||
fn percent(key: &str, label: &'static str, default: f64) -> Param {
|
||||
Param::new(key, label, ParamKind::range(0.0, 100.0, default, Default::default()))
|
||||
Param::new(key, label, ParamKind::range(0.0, 100.0, default, Default::default())).decimals(1).unit(UnitKind::Percent)
|
||||
}
|
||||
|
||||
/// The six text boxes of Header & Footer: the box with focus is kept under `hf.focused`, which
|
||||
@@ -623,8 +624,12 @@ fn rows(kind: MarkKind, g: &Geometry) -> Vec<Param> {
|
||||
}
|
||||
MarkKind::Background => {
|
||||
let source = [("colour".to_string(), tl!("From colour").to_string()), ("file".to_string(), tl!("File").to_string())];
|
||||
rows.push(Param::new("source", tl!("Source"), ParamKind::radio(source.map(|(i, l)| (i, l.into())).to_vec(), Some("colour".into()))));
|
||||
rows.push(Param::new("marks.bg.colour", tl!("Colour"), ParamKind::color(None)).enabled_when("source", "colour"));
|
||||
// Production's line: From colour with its well right after it, then File; no caption over the options.
|
||||
rows.push(
|
||||
Param::new("source", tl!("Source"), ParamKind::radio(source.map(|(i, l)| (i, l.into())).to_vec(), Some("colour".into())))
|
||||
.options_in_row(),
|
||||
);
|
||||
rows.push(Param::new("marks.bg.colour", tl!("Colour"), ParamKind::color(None)).enabled_when("source", "colour").under_option("colour"));
|
||||
file_rows(&mut rows);
|
||||
rows.push(percent("bg.opacity", tl!("Opacity"), 100.0));
|
||||
// Offered only once the backdrop check finds a white backdrop: its label names the pages, and the pass
|
||||
|
||||
@@ -97,9 +97,15 @@ impl SplitFacts {
|
||||
Some("pages".into()),
|
||||
),
|
||||
)
|
||||
.disabled_options(unavailable),
|
||||
Param::new("pages", tl!("Pages per file"), ParamKind::int(Some(1), Some(self.count.max(1) as i64), 1)).enabled_when("mode", "pages"),
|
||||
Param::new("size", tl!("At most (MB)"), ParamKind::number(Some(0.05), Some(2000.0), 2.0, 0.1, 2)).enabled_when("mode", "size"),
|
||||
.disabled_options(unavailable)
|
||||
// Production stacks the ways with no caption, each one's setting under it.
|
||||
.stacked_options(),
|
||||
Param::new("pages", tl!("Pages per file"), ParamKind::int(Some(1), Some(self.count.max(1) as i64), 1))
|
||||
.enabled_when("mode", "pages")
|
||||
.under_option("pages"),
|
||||
Param::new("size", tl!("At most (MB)"), ParamKind::number(Some(0.05), Some(2000.0), 2.0, 0.1, 2))
|
||||
.enabled_when("mode", "size")
|
||||
.under_option("size"),
|
||||
];
|
||||
ParamDialog::new(SPLIT, tl!("Split document"), params)
|
||||
.ok_label(tl!("Split").into())
|
||||
|
||||
@@ -94,7 +94,7 @@ impl ItemSource<usize> for Tools {
|
||||
fn tool_tile(g: &'static ToolGroup, unpinnable: bool) -> Tile<'static> {
|
||||
let hue = DataColor::new(egui::Color32::from_rgb(g.hue[0], g.hue[1], g.hue[2]));
|
||||
let tile = Tile::new(tl!(g.label).to_string()).icon(IconId::new(g.icon)).hue(hue);
|
||||
if unpinnable { tile.action(IconId::new("x"), CommandRef::new("home.unpin_tool")) } else { tile }
|
||||
if unpinnable { tile.action(IconId::new("close"), CommandRef::new("home.unpin_tool")) } else { tile }
|
||||
}
|
||||
|
||||
/// A grid of the tools `groups`; a click selects a tool and, with `unpinnable`, the hover action unpins it.
|
||||
@@ -167,7 +167,7 @@ pub fn show(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
brand::mark(ui, PictureSize::Thumb(ThumbSize::Medium));
|
||||
let _ = Text::new(tl!("Join the ArtCraft community").to_string()).role(TypeRole::Heading).show(ui);
|
||||
if clicked(&IconButton::new(IconId::new("x")).id_salt("community-close").label(tl!("Close")).show(ui)) {
|
||||
if clicked(&IconButton::new(IconId::new("close")).id_salt("community-close").label(tl!("Close")).show(ui)) {
|
||||
asked.borrow_mut().push(Asked::CloseCommunityCard);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -486,7 +486,7 @@ impl DockPanels<PanelId> for Panels<'_> {
|
||||
crate::calc_order_ui::header(ui);
|
||||
} else if crate::organize_panel::showing(self.app) {
|
||||
IconButton::command(IconSpec::svg(IconId::new("chevron-left")), CommandRef::new("tools.all")).show(ui);
|
||||
IconButton::command(IconSpec::svg(IconId::new("x")), CommandRef::new("page.organize")).label(tl!("Close panel")).show(ui);
|
||||
IconButton::command(IconSpec::svg(IconId::new("close")), CommandRef::new("page.organize")).label(tl!("Close panel")).show(ui);
|
||||
} else if self.app.left == LeftPanel::AllTools {
|
||||
IconButton::command(IconSpec::svg(IconId::new("maximize-2")), CommandRef::new("tools.expand")).show(ui);
|
||||
}
|
||||
|
||||
@@ -1050,12 +1050,12 @@ fn draft_session(
|
||||
// Hung below the box (above when there is no room), in place of production's bar beside it; the
|
||||
// warning for text the fonts can't draw is its first member.
|
||||
let corners = [paper.left_top(), paper.right_top(), paper.right_bottom(), paper.left_bottom()].map(|p| body.view.to_doc(p));
|
||||
let _ = TaskBar::fixed(tl!("Text box actions"), &corners).show(ui, body.rect, |ui, _| {
|
||||
let _ = TaskBar::fixed(tl!("Text box actions"), &corners).compact(true).show(ui, body.rect, |ui, _| {
|
||||
if let Some(c) = blocked {
|
||||
let _ = Text::new(undrawable_message(c)).tone(Tone::Bad).show(ui);
|
||||
}
|
||||
done = IconButton::new(IconId::new("check")).label(tl!("Done adding text")).show(ui).clicks > 0;
|
||||
discard = IconButton::new(IconId::new("x")).label(tl!("Discard this text (Esc)")).show(ui).clicks > 0;
|
||||
discard = IconButton::new(IconId::new("close")).label(tl!("Discard this text (Esc)")).show(ui).clicks > 0;
|
||||
});
|
||||
if discard || ended == Some(EditorEnd::Cancel) {
|
||||
cv.draft = None;
|
||||
|
||||
@@ -550,7 +550,7 @@ pub(crate) fn signature_entries(ui: &mut egui::Ui, app: &mut crate::PdfCraftApp)
|
||||
cx.with_draw(|draw| paint_signature(cx.painter.ctx(), draw, rect, saved, DataColor::new(cx.ink())));
|
||||
})
|
||||
.action_named(IconId::new("pencil"), CommandRef::new(slot.change_id), ctx_less_label("Change {what}", slot.what))
|
||||
.action_named(IconId::new("x"), CommandRef::new(slot.remove_id), ctx_less_label("Remove saved {what}", slot.what))
|
||||
.action_named(IconId::new("close"), CommandRef::new(slot.remove_id), ctx_less_label("Remove saved {what}", slot.what))
|
||||
});
|
||||
for event in out.response.events {
|
||||
command = match event {
|
||||
|
||||
@@ -55,7 +55,7 @@ fn build_dialog(fields: &mut DialogFields, base: ScanCleanSettings, count: usize
|
||||
)
|
||||
.full_width(),
|
||||
Param::section(tl!("Pages")),
|
||||
PageRangeOptions::param("pages", tl!("Pages"), count, current, PageRangeChoices::Current),
|
||||
PageRangeOptions::param("pages", tl!("Pages"), count, current, PageRangeChoices::CurrentFromTo),
|
||||
Param::section(tl!("Filters")),
|
||||
Param::new("level", tl!("Background removal"), ParamKind::range(0.0, max, f64::from(base.level), SliderScale::Linear))
|
||||
.decimals(0)
|
||||
|
||||
Reference in new issue
Block a user