Add Lightroom's export and copy shortcuts to develop
Ctrl+E opens an export sheet: the export defaults on their own, over the photograph, with an Export button. Ctrl+Shift+E exports straight away on those defaults. There is no per-export copy of the settings, so what is chosen in the sheet is saved as it is on the settings page, and the next Ctrl+Shift+E uses it. To make that one set of controls in two places, the export options move out of the settings page into export.slint: an `ExportOptions` global that Rust writes once, and two panels that read it. The window no longer forwards forty `settings-*` properties to the page. Ctrl+Shift+C opens a copy sheet with the edit-kind chips the preset sheet already uses and a Copy button, which is how a paste leaves each photograph's crop and rotation alone (Compose off). A and D step along the roll beside the arrows. While either sheet is up the develop keys stand down, so A cannot change the photograph behind the form, and Escape closes it.
This commit is contained in:
@@ -328,3 +328,94 @@ export component PresetSheet inherits Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TRACES: FR-DEV-6 | FR-UI-5
|
||||
// Which kinds of edit a copy carries, and the Copy button — what Ctrl+Shift+C
|
||||
// opens, as Lightroom's "Copy Settings" does.
|
||||
//
|
||||
// The same scope the preset sheet and the settings page draw, not a second
|
||||
// one: a paste applies it whenever it happens, so choosing here and pressing
|
||||
// Ctrl+V later mean the same thing. Turning Compose off is how a crop and a
|
||||
// rotation stay behind.
|
||||
export component CopySheet inherits Rectangle {
|
||||
in property <[ScopeKind]> scope-kinds;
|
||||
in property <bool> scope-empty: false;
|
||||
/// What a paste would apply at this scope — "3 adjustments".
|
||||
in property <string> summary;
|
||||
/// False where there is no edit to copy from.
|
||||
in property <bool> can-copy: true;
|
||||
|
||||
callback scope-toggled(string);
|
||||
callback copy();
|
||||
callback dismiss();
|
||||
|
||||
background: #000000CC;
|
||||
|
||||
TouchArea {
|
||||
clicked => { root.dismiss(); }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: min(420px, parent.width - 2 * Theme.gap-lg);
|
||||
height: min(sheet.preferred-height, parent.height - 2 * Theme.gap-lg);
|
||||
x: (parent.width - self.width) / 2;
|
||||
y: (parent.height - self.height) / 2;
|
||||
background: Theme.surface;
|
||||
border-radius: Theme.radius;
|
||||
border-width: 1px;
|
||||
border-color: Theme.rule;
|
||||
|
||||
TouchArea { }
|
||||
|
||||
sheet := VerticalLayout {
|
||||
padding: Theme.gap-lg;
|
||||
spacing: Theme.gap;
|
||||
|
||||
Text {
|
||||
text: "Copy settings";
|
||||
color: Theme.ink;
|
||||
font-size: Theme.text-lg;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
Caption {
|
||||
text: "The kinds of edit a paste carries. Leave Compose off "
|
||||
+ "to keep each photograph's own crop and rotation.";
|
||||
wrap: word-wrap;
|
||||
}
|
||||
|
||||
ScopeChips {
|
||||
kinds: root.scope-kinds;
|
||||
toggled(name) => { root.scope-toggled(name); }
|
||||
}
|
||||
|
||||
// The summary is of what is on the clipboard, so before the first
|
||||
// copy there is none — and an empty line would be a gap that looks
|
||||
// like a missing message.
|
||||
if root.scope-empty || root.summary != "": Caption {
|
||||
text: root.scope-empty
|
||||
? "Nothing chosen, so a paste would change nothing."
|
||||
: root.summary;
|
||||
warn: root.scope-empty;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
spacing: Theme.gap-sm;
|
||||
alignment: end;
|
||||
|
||||
Button {
|
||||
text: "Close";
|
||||
clicked => { root.dismiss(); }
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Copy";
|
||||
primary: true;
|
||||
enabled: root.can-copy && !root.scope-empty;
|
||||
clicked => { root.copy(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user