1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
From: Marcus Lundblad <ml@dfupdate.se>
Date: Fri, 21 Apr 2023 08:42:06 +0200
Subject: sendToDialog: Unbreak OpenWithRows
Port the missing OpenWithRow to GTK4, this
was broken since the GTK4 port, causing the
dialog to not work when there are installed
apps supporting geo: (and Maps running as non-Flatpak).
(cherry picked from commit fdc6d9f8d4b58b087ddef07cd27d0cdcd76ba939)
Origin: future 43.6
---
data/ui/open-with-row.ui | 19 ++++++++-----------
src/sendToDialog.js | 6 ++----
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/data/ui/open-with-row.ui b/data/ui/open-with-row.ui
index d236a2a..f56afa4 100644
--- a/data/ui/open-with-row.ui
+++ b/data/ui/open-with-row.ui
@@ -1,29 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="3.12"/>
+ <requires lib="gtk" version="4.0"/>
<template class="Gjs_OpenWithRow" parent="GtkListBoxRow">
- <property name="visible">True</property>
- <child>
+ <property name="child">
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="spacing">12</property>
- <property name="margin">6</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">6</property>
<child>
<object class="GtkImage" id="icon">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="pixel-size">32</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="halign">start</property>
</object>
</child>
</object>
- </child>
+ </property>
</template>
</interface>
+
diff --git a/src/sendToDialog.js b/src/sendToDialog.js
index 549d2f5..9996e20 100644
--- a/src/sendToDialog.js
+++ b/src/sendToDialog.js
@@ -246,12 +246,10 @@ GObject.registerClass({
}, SendToDialog);
export class OpenWithRow extends Gtk.ListBoxRow {
- constructor(params) {
- let appinfo = params.appinfo;
- delete params.appinfo;
-
+ constructor({ appinfo, ...params }) {
super(params);
+ this.appinfo = appinfo;
this._label.label = _("Open with %s").format(appinfo.get_name());
this._icon.gicon = appinfo.get_icon();
}
|