Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/toolbar.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2009-01-20 10:16:48 (GMT)
committer Simon Schampijer <simon@schampijer.de>2009-01-20 10:16:48 (GMT)
commit2c8e80c30d9967c1536bb5afed5690aa19096bf0 (patch)
tree9b3ec42ab1740aa9ad579bfa31547034451a0cf9 /toolbar.py
parent76ebc8e36af19978e4ec7236e804aa9f9f6647c7 (diff)
Make use of the ColorToolButton that benzea landed in sugar-toolkit
Diffstat (limited to 'toolbar.py')
-rw-r--r--toolbar.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/toolbar.py b/toolbar.py
index 4a6940c..5625adc 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -27,6 +27,7 @@ from sugar.graphics.icon import Icon
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.toggletoolbutton import ToggleToolButton
from sugar.graphics.combobox import ComboBox
+from sugar.graphics.colorbutton import ColorToolButton
from sugar.graphics.toolcombobox import ToolComboBox
from sugar.graphics.objectchooser import ObjectChooser
from sugar.graphics import iconentry
@@ -280,7 +281,7 @@ class TextToolbar(gtk.Toolbar):
self.insert(self._underline, -1)
self._underline.show()
- self._text_color = gtk.ColorButton()
+ self._text_color = ColorToolButton()
self._text_color_id = self._text_color.connect('color-set', self._text_color_cb)
tool_item = gtk.ToolItem()
tool_item.add(self._text_color)
@@ -395,7 +396,9 @@ class TextToolbar(gtk.Toolbar):
def _text_color_cb(self, button):
newcolor = self._text_color.get_color()
- self._abiword_canvas.set_text_color(newcolor.red // 256.0, newcolor.green // 256.0, newcolor.blue // 256.0)
+ self._abiword_canvas.set_text_color(int(newcolor.red / 256.0),
+ int(newcolor.green / 256.0),
+ int(newcolor.blue / 256.0))
def _font_size_cb(self, abi, size):
for i, s in enumerate(self._font_sizes):