Make the inspector toggle work reliably
This commit is contained in:
parent
28fe9b757f
commit
8e381f9e2f
@ -34,6 +34,7 @@ class HTMLActivity(Gtk.Window):
|
|||||||
self._activity_id = handle.activity_id
|
self._activity_id = handle.activity_id
|
||||||
self._bundle_id = os.environ["SUGAR_BUNDLE_ID"]
|
self._bundle_id = os.environ["SUGAR_BUNDLE_ID"]
|
||||||
self._bundle_path = os.environ["SUGAR_BUNDLE_PATH"]
|
self._bundle_path = os.environ["SUGAR_BUNDLE_PATH"]
|
||||||
|
self._inspector_visible = False
|
||||||
|
|
||||||
self.set_decorated(False)
|
self.set_decorated(False)
|
||||||
self.maximize()
|
self.maximize()
|
||||||
@ -84,10 +85,14 @@ class HTMLActivity(Gtk.Window):
|
|||||||
event.get_state() & Gdk.ModifierType.SHIFT_MASK:
|
event.get_state() & Gdk.ModifierType.SHIFT_MASK:
|
||||||
if key_name == "I":
|
if key_name == "I":
|
||||||
inspector = self._web_view.get_inspector()
|
inspector = self._web_view.get_inspector()
|
||||||
if inspector.is_attached():
|
if self._inspector_visible:
|
||||||
inspector.close()
|
inspector.close()
|
||||||
|
self._inspector_visible = False
|
||||||
else:
|
else:
|
||||||
inspector.show()
|
inspector.show()
|
||||||
|
self._inspector_visible = True
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def _app_scheme_cb(self, request, user_data):
|
def _app_scheme_cb(self, request, user_data):
|
||||||
path = os.path.join(self._bundle_path,
|
path = os.path.join(self._bundle_path,
|
||||||
|
Loading…
Reference in New Issue
Block a user