Make the inspector toggle work reliably

This commit is contained in:
Daniel Narvaez 2013-05-11 23:01:17 +02:00
parent 28fe9b757f
commit 8e381f9e2f

View File

@ -34,6 +34,7 @@ class HTMLActivity(Gtk.Window):
self._activity_id = handle.activity_id
self._bundle_id = os.environ["SUGAR_BUNDLE_ID"]
self._bundle_path = os.environ["SUGAR_BUNDLE_PATH"]
self._inspector_visible = False
self.set_decorated(False)
self.maximize()
@ -84,10 +85,14 @@ class HTMLActivity(Gtk.Window):
event.get_state() & Gdk.ModifierType.SHIFT_MASK:
if key_name == "I":
inspector = self._web_view.get_inspector()
if inspector.is_attached():
if self._inspector_visible:
inspector.close()
self._inspector_visible = False
else:
inspector.show()
self._inspector_visible = True
return True
def _app_scheme_cb(self, request, user_data):
path = os.path.join(self._bundle_path,