diff options
author | Simon Schampijer <simon@schampijer.de> | 2007-08-30 17:16:09 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2007-08-30 17:16:09 (GMT) |
commit | d891133552c7697d6c96d00057ab53e9d579a4e8 (patch) | |
tree | 1979bdab655a2bb18401c396406501069a03d411 | |
parent | 59ac2eda7c33bf33417ddef123928b168720e012 (diff) |
Visual design for shared links
Fix for #2919
-rw-r--r-- | icons/buddy-link.svg | 23 | ||||
-rw-r--r-- | icons/link.svg | 12 | ||||
-rw-r--r-- | linkbutton.py | 30 | ||||
-rwxr-xr-x | webactivity.py | 4 |
4 files changed, 29 insertions, 40 deletions
diff --git a/icons/buddy-link.svg b/icons/buddy-link.svg deleted file mode 100644 index 7e79838..0000000 --- a/icons/buddy-link.svg +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ - <!ENTITY ns_svg "http://www.w3.org/2000/svg"> - <!ENTITY ns_xlink "http://www.w3.org/1999/xlink"> - <!ENTITY stroke_color "#020202"> - <!ENTITY fill_color "#0000ff"> - <!ENTITY b_fill "#B2B2B2"> - <!ENTITY b_stroke "#000000"> -]> - -<svg version="1.1" id="Icon" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="64" height="64" - viewBox="0 0 64 64" overflow="visible" enable-background="new 0 0 64 64" xml:space="preserve"> - - <rect fill="&b_fill;" stroke="&b_stroke;" stroke-width="3px" x="3" y="2" width="60" height="60" rx="8"/> - - <path - d="M 38.404455,39.235864 L 48.504455,49.335864 C 49.256455,50.085864 49.721455,51.120864 49.721455,52.267864 C 49.721455,54.554864 47.866455,56.410864 45.575455,56.410864 C 44.430455,56.410864 43.397455,55.947864 42.643455,55.199864 L 32.543455,45.097864 L 22.443455,55.197864 C 21.693455,55.947864 20.656455,56.408864 19.510455,56.408864 C 17.225455,56.408864 15.368455,54.554864 15.368455,52.267864 C 15.368455,51.121864 15.833455,50.083864 16.580455,49.333864 L 26.683455,39.233864 L 16.580455,29.131864 C 15.833455,28.382864 15.368455,27.346864 15.368455,26.201864 C 15.368455,23.912864 17.221455,22.056864 19.513455,22.056864 C 20.656455,22.056864 21.693455,22.521864 22.443455,23.270864 L 32.542455,33.371864 L 42.642455,23.269864 C 43.396455,22.520864 44.429455,22.055864 45.576455,22.055864 C 47.865455,22.055864 49.722455,23.911864 49.722455,26.200864 C 49.722455,27.345864 49.255455,28.379864 48.505455,29.130864 L 38.404455,39.235864 z " - fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" /> - - <circle cx="18.924999" cy="9.8719997" r="8.1219997" transform="translate(13.617455,5.111864)" - fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5" /> - -</svg> diff --git a/icons/link.svg b/icons/link.svg new file mode 100644 index 0000000..230f1d1 --- /dev/null +++ b/icons/link.svg @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY ns_svg "http://www.w3.org/2000/svg"> + <!ENTITY ns_xlink "http://www.w3.org/1999/xlink"> + <!ENTITY stroke_color "#ff0000"> + <!ENTITY fill_color "#0000ff"> +]> + +<svg version="1.1" id="Icon" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="120" height="110" + overflow="visible" xml:space="preserve" viewBox="0 0 120 110" enable-background="new 0 0 120 110"> + <rect x="0" y="0" width="120" height="110" fill="&fill_color;" stroke="&stroke_color;" stroke-width="10px" /> +</svg> diff --git a/linkbutton.py b/linkbutton.py index 2b628bb..5d6fb65 100644 --- a/linkbutton.py +++ b/linkbutton.py @@ -40,26 +40,26 @@ class LinkButton(gtk.RadioToolButton): pixbuf = loader.get_pixbuf() del loader - xo_buddy = os.path.join(os.path.dirname(__file__), "icons/buddy-link.svg") - pixbuf_xo = self._read_xo_icon(xo_buddy, fill, stroke) - - width = pixbuf_xo.get_width() - height = pixbuf_xo.get_height() - - dest_x = style.zoom(105) - dest_y = style.zoom(65) - w = width*0.7 - h = height*0.7 - scale_x = 0.7 - scale_y = 0.7 + xo_buddy = os.path.join(os.path.dirname(__file__), "icons/link.svg") + pixbuf_bg = self._read_link_background(xo_buddy, fill, stroke) + pixbuf_bg = pixbuf_bg.scale_simple(style.zoom(120), + style.zoom(110), + gtk.gdk.INTERP_BILINEAR) + dest_x = style.zoom(10) + dest_y = style.zoom(20) + w = pixbuf.get_width() + h = pixbuf.get_height() + scale_x = 1 + scale_y = 1 - pixbuf_xo.composite(pixbuf, dest_x, dest_y, w, h, dest_x, dest_y, scale_x, scale_y, gtk.gdk.INTERP_BILINEAR, 255) + pixbuf.composite(pixbuf_bg, dest_x, dest_y, w, h, dest_x, dest_y, + scale_x, scale_y, gtk.gdk.INTERP_BILINEAR, 255) - img.set_from_pixbuf(pixbuf) + img.set_from_pixbuf(pixbuf_bg) self.set_icon_widget(img) img.show() - def _read_xo_icon(self, filename, fill_color, stroke_color): + def _read_link_background(self, filename, fill_color, stroke_color): icon_file = open(filename, 'r') data = icon_file.read() icon_file.close() diff --git a/webactivity.py b/webactivity.py index 90a7726..d76967d 100755 --- a/webactivity.py +++ b/webactivity.py @@ -366,8 +366,8 @@ class WebActivity(activity.Activity): screenshot.get_from_drawable(window, window.get_colormap(), 0, 0, 0, 0, width, height) - screenshot = screenshot.scale_simple(style.zoom(160), - style.zoom(120), + screenshot = screenshot.scale_simple(style.zoom(100), + style.zoom(80), gtk.gdk.INTERP_BILINEAR) buffer = self.get_buffer(screenshot) |