Skip to content

Commit 1076e00

Browse files
committed
meldwindow: Move the spinner to our HeaderBar
1 parent bb38fcc commit 1076e00

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

data/ui/meldapp.ui

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
<property name="pack-type">end</property>
2828
</packing>
2929
</child>
30+
<child>
31+
<object class="GtkSpinner" id="spinner">
32+
<property name="visible">false</property>
33+
<property name="can_focus">False</property>
34+
</object>
35+
<packing>
36+
<property name="pack-type">end</property>
37+
</packing>
38+
</child>
3039
</object>
3140
</child>
3241

meld/meldwindow.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,14 @@ def __init__(self):
173173
self.appvbox.pack_start(self.menubar, False, True, 0)
174174
self.toolbar_holder.pack_start(self.toolbar, True, True, 0)
175175

176-
# Double toolbars to work around UIManager integration issues
176+
# This double toolbar works around integrating non-UIManager widgets
177+
# into the toolbar. It's no longer used, but kept as a possible
178+
# GAction porting helper.
177179
self.secondary_toolbar = Gtk.Toolbar()
178180
self.secondary_toolbar.get_style_context().add_class(
179181
Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
180182
self.toolbar_holder.pack_end(self.secondary_toolbar, False, True, 0)
183+
self.secondary_toolbar.show_all()
181184

182185
# Manually handle GAction additions
183186
actions = (
@@ -188,18 +191,10 @@ def __init__(self):
188191
action.connect('activate', callback)
189192
self.widget.add_action(action)
190193

191-
# Create a secondary toolbar, just to hold our progress spinner
192-
toolbutton = Gtk.ToolItem()
193-
self.spinner = Gtk.Spinner()
194194
# Fake out the spinner on Windows. See Gitlab issue #133.
195195
if os.name == 'nt':
196196
for attr in ('stop', 'hide', 'show', 'start'):
197197
setattr(self.spinner, attr, lambda *args: True)
198-
toolbutton.add(self.spinner)
199-
self.secondary_toolbar.insert(toolbutton, -1)
200-
# Set a minimum size because the spinner requests nothing
201-
self.secondary_toolbar.set_size_request(30, -1)
202-
self.secondary_toolbar.show_all()
203198

204199
self.widget.drag_dest_set(
205200
Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT |

0 commit comments

Comments
 (0)