window: Use custom overlay visual for drop target

Closes #59

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/258>
This commit is contained in:
FineFindus 2023-06-25 21:13:56 +02:00 • committed by Sophie Herold
parent 3111efdd94
commit 78b16518e5
6 changed files with 171 additions and 74 deletions

View file

@ -97,7 +97,7 @@
<child type="top">
<object class="AdwHeaderBar" id="headerbar">
<property name="show-end-title-buttons" bind-source="LpWindow" bind-property="fullscreened" bind-flags="sync-create|invert-boolean"/>
<property name="show-start-title-buttons" bind-source="LpWindow" bind-property="fullscreened" bind-flags="sync-create|invert-boolean"/>"
<property name="show-start-title-buttons" bind-source="LpWindow" bind-property="fullscreened" bind-flags="sync-create|invert-boolean"/>
<style>
<class name="fullscreen-osd"/>
</style>
@ -168,19 +168,28 @@
<property name="locked">True</property>
<property name="reveal-flap" bind-source="properties_button" bind-property="active" bind-flags="bidirectional|sync-create"/>
<property name="content">
<object class="GtkOverlay" id="drop_area_overlay">
<style>
<class name="custom-drag-n-drop-highlight"/>
</style>
<child>
<object class="GtkDropTarget" id="drop_target">
<property name="actions">copy</property>
<object class="LpDragOverlay" id="drag_overlay">
<property name="overlayed">
<object class="AdwBin">
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<property name="margin-start">24</property>
<property name="margin-end">24</property>
<property name="can-target">false</property>
<style>
<class name="lp-dragging-area-highlight"/>
</style>
</object>
</child>
<child>
</property>
<property name="child">
<object class="GtkStack" id="stack">
<property name="visible-child">status_page</property>
<property name="vexpand">True</property>
<child>
<object class="GtkDropTarget" id="drop_target">
<property name="actions">copy</property>
</object>
</child>
<child>
<object class="AdwStatusPage" id="status_page">
<property name="title" translatable="yes">View Images</property>
@ -214,7 +223,7 @@
</object>
</child>
</object>
</child>
</property>
</object>
</property>
<property name="separator">

View file

@ -8,7 +8,9 @@ button.osd.circular {
background: rgba(0, 0, 0, 0.65);
}
shadow, border, outline {
shadow,
border,
outline {
background: none;
}
@ -32,14 +34,14 @@ row.property label.subtitle {
.custom-drag-n-drop-highlight {
box-shadow: none;
}
.lp-dragging-area-highlight {
border-radius: 8px;
background-color: alpha(@accent_color, 0.35);
border: 2px @accent_color solid;
background-color: alpha(@blue_2, 0.35);
}
lpprintpreview {
background-color: rgb(240, 240, 240);
border-radius: 4px;
box-shadow: 0 0 14px 1px black;
}
}