From 29e807a7b037595d4f60d3d1de7e2abd9024209b Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Thu, 23 Jan 2025 14:06:30 +0100 Subject: [PATCH] edit/crop: Implement crop apply as overlay --- data/resources/edit_crop.css | 5 -- src/widgets/edit/crop_selection.rs | 7 ++ src/widgets/edit/crop_selection.ui | 138 +++++++++++++++-------------- 3 files changed, 78 insertions(+), 72 deletions(-) diff --git a/data/resources/edit_crop.css b/data/resources/edit_crop.css index 4e810dc..8aa7219 100644 --- a/data/resources/edit_crop.css +++ b/data/resources/edit_crop.css @@ -45,9 +45,4 @@ lpcrop { .discarded-area { background: var(--discarded-background); -} - -.apply-button { - margin-right: 12px; - margin-top: -6px; } \ No newline at end of file diff --git a/src/widgets/edit/crop_selection.rs b/src/widgets/edit/crop_selection.rs index 425b655..d0ea260 100644 --- a/src/widgets/edit/crop_selection.rs +++ b/src/widgets/edit/crop_selection.rs @@ -214,6 +214,13 @@ mod imp { let obj = self.obj(); obj.set_direction(gtk::TextDirection::Ltr); + self.selection.set_direction(gtk::TextDirection::Ltr); + self.handle_bottom_left + .set_direction(gtk::TextDirection::Ltr); + self.handle_bottom_right + .set_direction(gtk::TextDirection::Ltr); + self.handle_top_left.set_direction(gtk::TextDirection::Ltr); + self.handle_top_right.set_direction(gtk::TextDirection::Ltr); // List of widgets that are drag handles let drag_corners = std::collections::BTreeMap::from([ diff --git a/src/widgets/edit/crop_selection.ui b/src/widgets/edit/crop_selection.ui index 8f9a5a3..bd7f3df 100644 --- a/src/widgets/edit/crop_selection.ui +++ b/src/widgets/edit/crop_selection.ui @@ -98,55 +98,22 @@ - + true true 1 1 - - - - start - start - - 0 - 0 - - - - - - - end - true - - 0 - 2 - - - - - + - true - - 1 - 2 - + end + start + 12 + 12 edit-crop.apply-crop apply-crop - end - start + Crop Selection - - - end - true - - 2 - 0 - + + + true + true + + + start + start + + 0 + 0 + + + + + + + end + true + + 0 + 1 + + + + + + + end + true + + 1 + 0 + + + + + + + end + true + end + true + + 1 + 1 + + + + - - - - end - true - end - true - - 2 - 2 - - - - +