diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-07-01 21:13:58 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-07-01 21:13:58 (GMT) |
commit | fa70f97317d775beeafa6c2b9d1e201895a0a7c4 (patch) | |
tree | e66c79121c58922c41a4cd870e08215bb16247a1 | |
parent | 8a120276b39d1a7443e9f1ef6d589d2478550c2e (diff) |
Moving image contrast scale to palette
-rw-r--r-- | icons/contrast-high.svg | 6 | ||||
-rw-r--r-- | icons/contrast-slow.svg | 6 | ||||
-rw-r--r-- | icons/contrast.svg | 7 | ||||
-rw-r--r-- | widgets.py | 30 |
4 files changed, 20 insertions, 29 deletions
diff --git a/icons/contrast-high.svg b/icons/contrast-high.svg deleted file mode 100644 index da3836a..0000000 --- a/icons/contrast-high.svg +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" -"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="32"> - <path d="M 2,4 C 15,7 15,25 2,28 L 2,4" fill="white" stroke="black"/> -</svg> diff --git a/icons/contrast-slow.svg b/icons/contrast-slow.svg deleted file mode 100644 index ed7c929..0000000 --- a/icons/contrast-slow.svg +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" -"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="32"> - <path d="M 14,4 C 1,7 1,25 14,28 L14,4" stroke="white"/> -</svg> diff --git a/icons/contrast.svg b/icons/contrast.svg new file mode 100644 index 0000000..b6d8c5c --- /dev/null +++ b/icons/contrast.svg @@ -0,0 +1,7 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" +"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="32" height="32"> + <path d="M 15,4 C 1,7 1,25 15,28 L15,4" stroke="white"/> + <path d="M 15,4 C 31,7 31,25 15,28 L 15,4" fill="white" stroke="black"/> +</svg> @@ -81,27 +81,23 @@ class ImageEditor(gtk.VBox): rotate_button.connect("clicked", self.rotate_image) rotate_button.show() self.toolbar.insert(rotate_button, -1) - separator = gtk.SeparatorToolItem() - separator.show() - self.toolbar.insert(separator, -1) - contrast_box = gtk.HBox() - slow_contrast_image = gtk.image_new_from_icon_name("contrast-slow", - gtk.ICON_SIZE_LARGE_TOOLBAR) - slow_contrast_image.show() - contrast_box.pack_start(slow_contrast_image, False, False) + + contrast_item = ToolButton("contrast") + contrast_item.set_tooltip("Contrast") + contrast_palette = contrast_item.get_palette() + eventbox = gtk.EventBox() contrast_scale = gtk.HScale(gtk.Adjustment(0, -1, 1, 0.1)) contrast_scale.set_draw_value(False) contrast_scale.show() - contrast_box.pack_start(contrast_scale, True, True) - high_contrast_image = gtk.image_new_from_icon_name("contrast-high", - gtk.ICON_SIZE_LARGE_TOOLBAR) - high_contrast_image.show() - contrast_box.pack_start(high_contrast_image, False, False) - contrast_item = gtk.ToolItem() - contrast_item.set_expand(True) - contrast_item.add(contrast_box) - contrast_box.show() + eventbox.add(contrast_scale) + eventbox.set_size_request(500, -1) + contrast_palette.set_content(eventbox) + contrast_palette.set_size_request(300, -1) + contrast_item.connect('clicked', + lambda w: contrast_palette.popup(immediate=True, + state=1)) contrast_item.show() + eventbox.show() self.toolbar.insert(contrast_item, -1) brightness_box = gtk.HBox() slow_brightness_image = gtk.image_new_from_icon_name("brightness-slow", |