Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJRG 2 <jrg2@ubuntu.(none)>2013-12-14 15:01:41 (GMT)
committer JRG 2 <jrg2@ubuntu.(none)>2013-12-14 15:01:41 (GMT)
commitc28887bb0839d3c9a4dcb3068b5b53099f0e4935 (patch)
tree69867aaf910f008b90d37f8e612d266de7f5cf05
parent086c5a1ce1bb243ca798ba1e7beb6a97ca05a027 (diff)
Modify palettes.pyno_palette_svg_img
-rw-r--r--palettes.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/palettes.py b/palettes.py
index fedf9be..d34d862 100644
--- a/palettes.py
+++ b/palettes.py
@@ -117,6 +117,8 @@ class ContentInvoker(Invoker):
return True
def _handle_event(self, event):
+ svg_url = str(self._browser.get_uri()).lower()
+
hit_test = self._browser.get_hit_test_result(event)
hit_context = hit_test.props.context
hit_info = {
@@ -152,10 +154,13 @@ class ContentInvoker(Invoker):
hit_info['is selection']):
self.palette = BrowsePalette(self._browser, title, url, hit_info)
self.notify_right_click()
+ elif svg_url.endswith(".svg"):
+ self.palette = BrowsePalette(self._browser, title, svg_url, hit_info, True)
+ self.notify_right_click()
class BrowsePalette(Palette):
- def __init__(self, browser, title, url, hit_info):
+ def __init__(self, browser, title, url, hit_info, svg=False):
Palette.__init__(self)
self._browser = browser
@@ -207,7 +212,7 @@ class BrowsePalette(Palette):
menu_box.pack_start(menu_item, False, False, 0)
menu_item.show()
- if hit_info['is image']:
+ if hit_info['is image'] or svg:
if not first_section_added:
first_section_added = True
else: