Skip to content

Commit 886840b

Browse files
committed
Port to gedit 3.12
GEdit version 3.12 changed the API for plugins; in particular, this patch interfaces correctly with the side panel, which is now a GtkStack.
1 parent a506186 commit 886840b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sourcecodebrowser/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def do_activate(self):
330330
self._sourcetree.expand_rows = self.expand_rows
331331
self._sourcetree.sort_list = self.sort_list
332332
panel = self.window.get_side_panel()
333-
panel.add_item(self._sourcetree, "SymbolBrowserPlugin", "Source Code", self.icon)
333+
panel.add_titled(self._sourcetree, "SymbolBrowserPlugin", "Source Code")
334334
self._handlers = []
335335
hid = self._sourcetree.connect("focus", self.on_sourcetree_focus)
336336
self._handlers.append((self._sourcetree, hid))
@@ -353,7 +353,7 @@ def do_deactivate(self):
353353
obj.disconnect(hid)
354354
self._handlers = None
355355
pane = self.window.get_side_panel()
356-
pane.remove_item(self._sourcetree)
356+
pane.remove(self._sourcetree)
357357
self._sourcetree = None
358358

359359
def _has_settings_schema(self):
@@ -393,7 +393,7 @@ def _load_active_document_symbols(self):
393393
self._is_loaded = False
394394
# do not load if not the active tab in the panel
395395
panel = self.window.get_side_panel()
396-
if not panel.item_is_active(self._sourcetree):
396+
if panel.get_visible_child() != self._sourcetree:
397397
return
398398

399399
document = self.window.get_active_document()

0 commit comments

Comments
 (0)