Remove redundant output label and raise the viewport toolbar
This commit is contained in:
parent
573c44e8db
commit
dc5c4f14fe
|
|
@ -1272,10 +1272,10 @@ impl Editor {
|
|||
let ink = Ink::new(ui, r);
|
||||
let output = self.layout.formats().output;
|
||||
let [sw, sh] = output.map(|v| v as f32);
|
||||
ink.card(24.0, 65.0, 36.0, 36.0, FIELD, LINE);
|
||||
ink.card(24.0, 20.0, 36.0, 36.0, FIELD, LINE);
|
||||
if toolbar_icon(
|
||||
ui,
|
||||
Rect::from_min_size(ink.point(26.0, 67.0), Vec2::splat(32.0)),
|
||||
Rect::from_min_size(ink.point(26.0, 22.0), Vec2::splat(32.0)),
|
||||
"Output format",
|
||||
ToolbarIcon::Output,
|
||||
)
|
||||
|
|
@ -1283,23 +1283,16 @@ impl Editor {
|
|||
{
|
||||
self.output_draft = Some(OutputDraft::new(output));
|
||||
}
|
||||
ink.text(
|
||||
24.0,
|
||||
30.0,
|
||||
&format!("{} × {} px", output[0], output[1]),
|
||||
12.0,
|
||||
MUTED,
|
||||
);
|
||||
// A single compact strip: view tools, then history tools.
|
||||
ink.card(72.0, 65.0, 150.0, 36.0, FIELD, LINE);
|
||||
ink.line([147.0, 73.0], [147.0, 93.0], LINE);
|
||||
ink.card(72.0, 20.0, 150.0, 36.0, FIELD, LINE);
|
||||
ink.line([147.0, 28.0], [147.0, 48.0], LINE);
|
||||
for (x, text, icon) in [
|
||||
(76.0, "Fit screen", ToolbarIcon::Screen),
|
||||
(110.0, "Fit selected", ToolbarIcon::Selection),
|
||||
(152.0, "Undo", ToolbarIcon::Undo),
|
||||
(186.0, "Redo", ToolbarIcon::Redo),
|
||||
] {
|
||||
let rect = Rect::from_min_size(ink.point(x, 67.0), Vec2::splat(32.0));
|
||||
let rect = Rect::from_min_size(ink.point(x, 22.0), Vec2::splat(32.0));
|
||||
if toolbar_icon(ui, rect, text, icon).clicked() {
|
||||
match text {
|
||||
"Fit screen" => {
|
||||
|
|
@ -1329,7 +1322,7 @@ impl Editor {
|
|||
ui.scope_builder(
|
||||
egui::UiBuilder::new()
|
||||
.max_rect(Rect::from_min_size(
|
||||
ink.point(232.0, 66.0),
|
||||
ink.point(232.0, 21.0),
|
||||
Vec2::new(36.0, 34.0),
|
||||
))
|
||||
.layout(egui::Layout::left_to_right(egui::Align::Center)),
|
||||
|
|
@ -1367,7 +1360,7 @@ impl Editor {
|
|||
ui.scope_builder(
|
||||
egui::UiBuilder::new()
|
||||
.max_rect(Rect::from_min_size(
|
||||
ink.point(280.0, 66.0),
|
||||
ink.point(280.0, 21.0),
|
||||
Vec2::new(154.0, 34.0),
|
||||
))
|
||||
.layout(egui::Layout::left_to_right(egui::Align::Center)),
|
||||
|
|
@ -1426,7 +1419,7 @@ impl Editor {
|
|||
},
|
||||
);
|
||||
ui.put(
|
||||
Rect::from_min_size(ink.point(24.0, 108.0), Vec2::new(310.0, 20.0)),
|
||||
Rect::from_min_size(ink.point(24.0, 63.0), Vec2::new(310.0, 20.0)),
|
||||
egui::Checkbox::new(
|
||||
&mut self.keep_aspect_ratio,
|
||||
"Keep aspect ratio when resizing",
|
||||
|
|
@ -1455,11 +1448,11 @@ impl Editor {
|
|||
)
|
||||
};
|
||||
ui.put(
|
||||
Rect::from_min_size(ink.point(24.0, 135.0), Vec2::new(r.width() - 48.0, 52.0)),
|
||||
Rect::from_min_size(ink.point(24.0, 90.0), Vec2::new(r.width() - 48.0, 52.0)),
|
||||
egui::Label::new(egui::RichText::new(text).color(color)).wrap(),
|
||||
);
|
||||
let area = Rect::from_min_max(
|
||||
r.min + Vec2::new(20.0, 204.0),
|
||||
r.min + Vec2::new(20.0, 159.0),
|
||||
r.max - Vec2::new(20.0, 85.0),
|
||||
);
|
||||
let base = ((area.width() - 48.0) / sw).min((area.height() - 48.0) / sh);
|
||||
|
|
@ -3372,7 +3365,7 @@ mod tests {
|
|||
}
|
||||
fn open_alignment_test_menu(app: &mut Editor, ctx: &egui::Context) -> egui::FullOutput {
|
||||
frame(app, ctx, vec![]);
|
||||
let pos = Pos2::new(248.0, 127.0);
|
||||
let pos = Pos2::new(248.0, 82.0);
|
||||
frame(
|
||||
app,
|
||||
ctx,
|
||||
|
|
|
|||
Loading…
Reference in New Issue