edit/crop: Implement crop apply as overlay
This commit is contained in:
parent
02f22816b8
commit
29e807a7b0
3 changed files with 78 additions and 72 deletions
|
|
@ -45,9 +45,4 @@ lpcrop {
|
||||||
|
|
||||||
.discarded-area {
|
.discarded-area {
|
||||||
background: var(--discarded-background);
|
background: var(--discarded-background);
|
||||||
}
|
|
||||||
|
|
||||||
.apply-button {
|
|
||||||
margin-right: 12px;
|
|
||||||
margin-top: -6px;
|
|
||||||
}
|
}
|
||||||
|
|
@ -214,6 +214,13 @@ mod imp {
|
||||||
let obj = self.obj();
|
let obj = self.obj();
|
||||||
|
|
||||||
obj.set_direction(gtk::TextDirection::Ltr);
|
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
|
// List of widgets that are drag handles
|
||||||
let drag_corners = std::collections::BTreeMap::from([
|
let drag_corners = std::collections::BTreeMap::from([
|
||||||
|
|
|
||||||
|
|
@ -98,55 +98,22 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid" id="selection">
|
<object class="GtkOverlay">
|
||||||
<property name="hexpand-set">true</property>
|
<property name="hexpand-set">true</property>
|
||||||
<property name="vexpand-set">true</property>
|
<property name="vexpand-set">true</property>
|
||||||
<layout>
|
<layout>
|
||||||
<property name="row">1</property>
|
<property name="row">1</property>
|
||||||
<property name="column">1</property>
|
<property name="column">1</property>
|
||||||
</layout>
|
</layout>
|
||||||
<style>
|
<child type="overlay">
|
||||||
<class name="selection" />
|
|
||||||
</style>
|
|
||||||
<child>
|
|
||||||
<object class="AdwBin" id="handle_top_left">
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="valign">start</property>
|
|
||||||
<layout>
|
|
||||||
<property name="row">0</property>
|
|
||||||
<property name="column">0</property>
|
|
||||||
</layout>
|
|
||||||
<style>
|
|
||||||
<class name="handle" />
|
|
||||||
<class name="handle-top-left" />
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="AdwBin" id="handle_top_right">
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="hexpand">true</property>
|
|
||||||
<layout>
|
|
||||||
<property name="row">0</property>
|
|
||||||
<property name="column">2</property>
|
|
||||||
</layout>
|
|
||||||
<style>
|
|
||||||
<class name="handle" />
|
|
||||||
<class name="handle-top-right" />
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="apply_button">
|
<object class="GtkButton" id="apply_button">
|
||||||
<property name="hexpand">true</property>
|
<property name="halign">end</property>
|
||||||
<layout>
|
<property name="valign">start</property>
|
||||||
<property name="row">1</property>
|
<property name="margin-end">12</property>
|
||||||
<property name="column">2</property>
|
<property name="margin-top">12</property>
|
||||||
</layout>
|
|
||||||
<property name="action-name">edit-crop.apply-crop</property>
|
<property name="action-name">edit-crop.apply-crop</property>
|
||||||
<property name="icon-name">apply-crop</property>
|
<property name="icon-name">apply-crop</property>
|
||||||
<property name="halign">end</property>
|
<property name="tooltip-text" translatable="yes">Crop Selection</property>
|
||||||
<property name="valign">start</property>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="circular" />
|
<class name="circular" />
|
||||||
<class name="osd" />
|
<class name="osd" />
|
||||||
|
|
@ -154,36 +121,73 @@
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<property name="child">
|
||||||
<object class="AdwBin" id="handle_bottom_left">
|
<object class="GtkGrid" id="selection">
|
||||||
<property name="valign">end</property>
|
<property name="hexpand-set">true</property>
|
||||||
<property name="vexpand">true</property>
|
<property name="vexpand-set">true</property>
|
||||||
<layout>
|
|
||||||
<property name="row">2</property>
|
|
||||||
<property name="column">0</property>
|
|
||||||
</layout>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="handle" />
|
<class name="selection" />
|
||||||
<class name="handle-bottom-left" />
|
|
||||||
</style>
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="AdwBin" id="handle_top_left">
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="valign">start</property>
|
||||||
|
<layout>
|
||||||
|
<property name="row">0</property>
|
||||||
|
<property name="column">0</property>
|
||||||
|
</layout>
|
||||||
|
<style>
|
||||||
|
<class name="handle" />
|
||||||
|
<class name="handle-top-left" />
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="AdwBin" id="handle_top_right">
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="hexpand">true</property>
|
||||||
|
<layout>
|
||||||
|
<property name="row">0</property>
|
||||||
|
<property name="column">1</property>
|
||||||
|
</layout>
|
||||||
|
<style>
|
||||||
|
<class name="handle" />
|
||||||
|
<class name="handle-top-right" />
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="AdwBin" id="handle_bottom_left">
|
||||||
|
<property name="valign">end</property>
|
||||||
|
<property name="vexpand">true</property>
|
||||||
|
<layout>
|
||||||
|
<property name="row">1</property>
|
||||||
|
<property name="column">0</property>
|
||||||
|
</layout>
|
||||||
|
<style>
|
||||||
|
<class name="handle" />
|
||||||
|
<class name="handle-bottom-left" />
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="AdwBin" id="handle_bottom_right">
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="hexpand">true</property>
|
||||||
|
<property name="valign">end</property>
|
||||||
|
<property name="vexpand">true</property>
|
||||||
|
<layout>
|
||||||
|
<property name="row">1</property>
|
||||||
|
<property name="column">1</property>
|
||||||
|
</layout>
|
||||||
|
<style>
|
||||||
|
<class name="handle" />
|
||||||
|
<class name="handle-bottom-right" />
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
<child>
|
|
||||||
<object class="AdwBin" id="handle_bottom_right">
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="hexpand">true</property>
|
|
||||||
<property name="valign">end</property>
|
|
||||||
<property name="vexpand">true</property>
|
|
||||||
<layout>
|
|
||||||
<property name="row">2</property>
|
|
||||||
<property name="column">2</property>
|
|
||||||
</layout>
|
|
||||||
<style>
|
|
||||||
<class name="handle" />
|
|
||||||
<class name="handle-bottom-right" />
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue