aboutsummaryrefslogtreecommitdiffstats
path: root/community/giara/0e6d5cab96e7b3f8db15739a3e00b9d1a3a48fb1.patch
blob: 5296d82d79459244d42863b69b0582827ae3be28 (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
From 0e6d5cab96e7b3f8db15739a3e00b9d1a3a48fb1 Mon Sep 17 00:00:00 2001
From: Gabriele Musco <gabmus@disroot.org>
Date: Wed, 13 Oct 2021 08:24:43 +0200
Subject: [PATCH] updated to libadwaita 1 alpha 3; related fixes

---
 data/ui/gtk_style.css                       | 10 +++++-----
 data/ui/headerbar.ui                        | 14 ++-----------
 data/ui/headerbar_with_back_and_squeezer.ui | 22 +--------------------
 data/ui/post_details_headerbar.ui           | 14 ++-----------
 data/ui/subreddit_view_headerbar.ui         | 21 +++-----------------
 dist/flatpak/org.gabmus.giara.json          | 17 ++++++++--------
 giara/app_window.py                         | 12 +++++++----
 giara/inbox_view.py                         |  2 +-
 giara/squeezing_viewswitcher_headerbar.py   |  2 +-
 9 files changed, 31 insertions(+), 83 deletions(-)

diff --git a/data/ui/gtk_style.css b/data/ui/gtk_style.css
index f49b2f5..c6ecf12 100644
--- a/data/ui/gtk_style.css
+++ b/data/ui/gtk_style.css
@@ -7,7 +7,7 @@
     padding-left: 12px;
     margin-top: 6px;
     margin-bottom: 6px;
-    margin-left: 6px
+    margin-left: 6px;
 }
 
 .nested-0 {
@@ -130,8 +130,8 @@
     font-size: .6em;
     border-radius: .6em;
     background-color: #ed333b;
-	  color: black;
-	  margin-top: 3px;
+	color: black;
+	margin-top: 3px;
 }
 
 .collapse-icon {
@@ -169,8 +169,8 @@
     opacity: .8;
 }
 
-.gallery-picture {
-}
+/* .gallery-picture { */
+/* } */
 
 .picture-rounded:focus {
     border-color: @theme_selected_bg_color;
diff --git a/data/ui/headerbar.ui b/data/ui/headerbar.ui
index a8f10d0..b3f1ab3 100644
--- a/data/ui/headerbar.ui
+++ b/data/ui/headerbar.ui
@@ -212,13 +212,8 @@
       <object class="GtkButton" id="refresh_btn">
         <property name="visible">True</property>
         <property name="receives-default">True</property>
+        <property name="icon-name">view-refresh-symbolic</property>
         <property name="tooltip-text" translatable="yes">Refresh</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon-name">view-refresh-symbolic</property>
-          </object>
-        </child>
       </object>
     </child>
     <child type="end">
@@ -236,12 +231,7 @@
         <property name="visible">True</property>
         <property name="receives-default">True</property>
         <property name="tooltip-text" translatable="yes">Search</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon-name">system-search-symbolic</property>
-          </object>
-        </child>
+        <property name="icon-name">system-search-symbolic</property>
       </object>
     </child>
     <child>
diff --git a/data/ui/headerbar_with_back_and_squeezer.ui b/data/ui/headerbar_with_back_and_squeezer.ui
index af1d167..b43f5d9 100644
--- a/data/ui/headerbar_with_back_and_squeezer.ui
+++ b/data/ui/headerbar_with_back_and_squeezer.ui
@@ -9,9 +9,6 @@
       <object class="AdwSqueezer" id="squeezer">
         <property name="visible">True</property>
         <property name="homogeneous">True</property>
-        <child>
-          <placeholder/>
-        </child>
       </object>
     </child>
     <child>
@@ -19,25 +16,8 @@
         <property name="visible">True</property>
         <property name="receives_default">True</property>
         <property name="tooltip_text" translatable="yes">Back</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon_name">go-previous-symbolic</property>
-          </object>
-        </child>
+        <property name="icon_name">go-previous-symbolic</property>
       </object>
     </child>
-    <child>
-      <placeholder/>
-    </child>
-    <child>
-      <placeholder/>
-    </child>
-    <child>
-      <placeholder/>
-    </child>
-    <child>
-      <placeholder/>
-    </child>
   </object>
 </interface>
diff --git a/data/ui/post_details_headerbar.ui b/data/ui/post_details_headerbar.ui
index 822c592..d840eff 100644
--- a/data/ui/post_details_headerbar.ui
+++ b/data/ui/post_details_headerbar.ui
@@ -9,12 +9,7 @@
         <property name="visible">True</property>
         <property name="receives_default">True</property>
         <property name="tooltip_text" translatable="yes">Back</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon_name">go-previous-symbolic</property>
-          </object>
-        </child>
+        <property name="icon_name">go-previous-symbolic</property>
       </object>
     </child>
     <child>
@@ -22,12 +17,7 @@
         <property name="visible">True</property>
         <property name="receives_default">True</property>
         <property name="tooltip_text" translatable="yes">Refresh</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon_name">view-refresh-symbolic</property>
-          </object>
-        </child>
+        <property name="icon_name">view-refresh-symbolic</property>
       </object>
     </child>
   </object>
diff --git a/data/ui/subreddit_view_headerbar.ui b/data/ui/subreddit_view_headerbar.ui
index bf6ee17..a1a52c0 100644
--- a/data/ui/subreddit_view_headerbar.ui
+++ b/data/ui/subreddit_view_headerbar.ui
@@ -18,12 +18,7 @@
         <property name="visible">True</property>
         <property name="receives-default">True</property>
         <property name="tooltip-text" translatable="yes">Back</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon-name">go-previous-symbolic</property>
-          </object>
-        </child>
+        <property name="icon-name">go-previous-symbolic</property>
       </object>
     </child>
     <child>
@@ -31,12 +26,7 @@
         <property name="visible">True</property>
         <property name="receives-default">True</property>
         <property name="tooltip-text" translatable="yes">Refresh</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon-name">view-refresh-symbolic</property>
-          </object>
-        </child>
+        <property name="icon-name">view-refresh-symbolic</property>
       </object>
     </child>
     <child>
@@ -50,12 +40,7 @@
         <property name="visible">True</property>
         <property name="receives-default">True</property>
         <property name="tooltip-text" translatable="yes">Search</property>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon-name">system-search-symbolic</property>
-          </object>
-        </child>
+        <property name="icon-name">system-search-symbolic</property>
       </object>
     </child>
   </object>
diff --git a/giara/app_window.py b/giara/app_window.py
index a0e3976..1070199 100644
--- a/giara/app_window.py
+++ b/giara/app_window.py
@@ -19,7 +19,7 @@ class AppWindow(Adw.ApplicationWindow):
         self.main_ui = MainUI()
         self.main_box.append(self.main_ui)
 
-        self.set_child(self.main_box)
+        self.set_content(self.main_box)
 
         def toggle_popover(*args):
             self.main_ui.deck.left_stack.get_headerbar().menu_btn.popup()
@@ -50,10 +50,14 @@ class AppWindow(Adw.ApplicationWindow):
         self.on_dark_mode_changed()
 
     def on_dark_mode_changed(self, *args):
-        Gtk.Settings.get_default().set_property(
-            'gtk-application-prefer-dark-theme',
-            self.confman.conf['dark_mode']
+        Adw.StyleManager.get_default().set_color_scheme(
+            Adw.ColorScheme.FORCE_DARK if self.confman.conf['dark_mode']
+            else Adw.ColorScheme.DEFAULT
         )
+        # Gtk.Settings.get_default().set_property(
+        #     'gtk-application-prefer-dark-theme',
+        #     self.confman.conf['dark_mode']
+        # )
 
     def emit_destroy(self, *args):
         self.emit('destroy')
diff --git a/giara/inbox_view.py b/giara/inbox_view.py
index cbba98d..5139cb7 100644
--- a/giara/inbox_view.py
+++ b/giara/inbox_view.py
@@ -31,7 +31,7 @@ class InboxItemView(Gtk.Box):
         self.avatar_container = self.builder.get_object('avatar_container')
         self.avatar = SimpleAvatar(
             42,
-            self.item.author.name,
+            self.item.author.name if self.item.author else _('Author unknown'),
             self.get_author_img
         )
         self.avatar_container.append(self.avatar)
diff --git a/giara/squeezing_viewswitcher_headerbar.py b/giara/squeezing_viewswitcher_headerbar.py
index 2829e21..5fc58f4 100644
--- a/giara/squeezing_viewswitcher_headerbar.py
+++ b/giara/squeezing_viewswitcher_headerbar.py
@@ -31,7 +31,7 @@ class SqueezingViewSwitcherHeaderbar(Gtk.WindowHandle):
         if view_switcher and stack is not None:
             self.squeezer = self.builder.get_object('squeezer')
             self.view_switcher = Adw.ViewSwitcher()
-            self.view_switcher.set_policy(Adw.ViewSwitcherPolicy.AUTO)
+            # self.view_switcher.set_policy(Adw.ViewSwitcherPolicy.AUTO)
             self.squeezer.add(self.view_switcher)
             self.squeezer.add(Gtk.Label())
             self.squeezer.connect(
-- 
GitLab