Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
Diffstat (limited to 'sugar')
-rw-r--r--sugar/chat/Chat.py10
-rw-r--r--sugar/chat/ChatToolbar.py1
-rw-r--r--sugar/chat/ChatWindow.py10
-rw-r--r--sugar/chat/richtext.py4
-rw-r--r--sugar/chat/sketchpad/Toolbox.py5
5 files changed, 18 insertions, 12 deletions
diff --git a/sugar/chat/Chat.py b/sugar/chat/Chat.py
index 325fa7f..51f24f9 100644
--- a/sugar/chat/Chat.py
+++ b/sugar/chat/Chat.py
@@ -64,6 +64,16 @@ class Chat(gtk.VBox):
self.pack_start(self._editor, False)
self._editor.show()
+ self.connect("key-press-event", self.__key_press_event_cb)
+
+ def __key_press_event_cb(self, window, event):
+ if event.keyval == gtk.keysyms.s and \
+ event.state & gtk.gdk.CONTROL_MASK:
+ if self.get_mode() == Chat.SKETCH_MODE:
+ self.set_mode(Chat.TEXT_MODE)
+ elif self.get_mode() == Chat.TEXT_MODE:
+ self.set_mode(Chat.SKETCH_MODE)
+
def get_mode(self):
return self._mode
diff --git a/sugar/chat/ChatToolbar.py b/sugar/chat/ChatToolbar.py
index 3e33c0c..d69cc55 100644
--- a/sugar/chat/ChatToolbar.py
+++ b/sugar/chat/ChatToolbar.py
@@ -22,6 +22,7 @@ class ChatToolbar(gtk.HBox):
toolbox.show()
item = gtk.Button()
+ item.unset_flags(gtk.CAN_FOCUS)
e_hbox = gtk.HBox(False, 6)
diff --git a/sugar/chat/ChatWindow.py b/sugar/chat/ChatWindow.py
index 59cb02c..b06175d 100644
--- a/sugar/chat/ChatWindow.py
+++ b/sugar/chat/ChatWindow.py
@@ -8,7 +8,6 @@ class ChatWindow(gtk.Window):
def __init__(self):
gtk.Window.__init__(self)
self._chat = None
- self.connect("key-press-event", self.__key_press_event_cb)
def set_chat(self, chat):
if self._chat != None:
@@ -17,12 +16,3 @@ class ChatWindow(gtk.Window):
self._chat = chat
self.add(self._chat)
self._chat.show()
-
- def __key_press_event_cb(self, window, event):
- if event.keyval == gtk.keysyms.s and \
- event.state & gtk.gdk.CONTROL_MASK:
- if self._chat.get_mode() == Chat.SKETCH_MODE:
- self._chat.set_mode(Chat.TEXT_MODE)
- elif self._chat.get_mode() == Chat.TEXT_MODE:
- self._chat.set_mode(Chat.SKETCH_MODE)
-
diff --git a/sugar/chat/richtext.py b/sugar/chat/richtext.py
index 08a5f44..efd39c0 100644
--- a/sugar/chat/richtext.py
+++ b/sugar/chat/richtext.py
@@ -169,6 +169,7 @@ class RichTextToolbox(gtk.HBox):
item = gtk.ToggleButton()
item.set_image(image)
item.connect("toggled", self.__toggle_style_cb, "bold")
+ item.unset_flags(gtk.CAN_FOCUS)
self.pack_start(item, False)
item.show()
@@ -179,6 +180,7 @@ class RichTextToolbox(gtk.HBox):
item = gtk.ToggleButton()
item.set_image(image)
+ item.unset_flags(gtk.CAN_FOCUS)
item.connect("toggled", self.__toggle_style_cb, "italic")
self.pack_start(item, False)
item.show()
@@ -188,6 +190,7 @@ class RichTextToolbox(gtk.HBox):
self._font_size_up = gtk.Button()
self._font_size_up.set_image(image)
+ self._font_size_up.unset_flags(gtk.CAN_FOCUS)
self._font_size_up.connect("clicked", self.__font_size_up_cb)
self.pack_start(self._font_size_up, False)
self._font_size_up.show()
@@ -199,6 +202,7 @@ class RichTextToolbox(gtk.HBox):
self._font_size_down = gtk.Button()
self._font_size_down.set_image(image)
+ self._font_size_down.unset_flags(gtk.CAN_FOCUS)
self._font_size_down.connect("clicked", self.__font_size_down_cb)
self.pack_start(self._font_size_down, False)
self._font_size_down.show()
diff --git a/sugar/chat/sketchpad/Toolbox.py b/sugar/chat/sketchpad/Toolbox.py
index 9428e42..0b0605a 100644
--- a/sugar/chat/sketchpad/Toolbox.py
+++ b/sugar/chat/sketchpad/Toolbox.py
@@ -14,7 +14,7 @@ class ColorButton(gtk.RadioButton):
drawing_area = gtk.DrawingArea()
drawing_area.set_size_request(24, 24)
- drawing_area.connect('expose_event', self.expose)
+ drawing_area.connect_after('expose_event', self.expose)
self.add(drawing_area)
drawing_area.show()
@@ -26,7 +26,7 @@ class ColorButton(gtk.RadioButton):
ctx = widget.window.cairo_create()
ctx.set_source_rgb(self._rgb[0], self._rgb[1] , self._rgb[2])
- ctx.rectangle(0, 0, rect.width, rect.height)
+ ctx.rectangle(4, 4, rect.width - 8, rect.height - 8)
ctx.fill()
return False
@@ -49,6 +49,7 @@ class Toolbox(gtk.HBox):
def _add_color(self, rgb):
color = ColorButton(self._colors_group, rgb)
+ color.unset_flags(gtk.CAN_FOCUS)
color.connect('clicked', self.__color_clicked_cb, rgb)
self.pack_start(color, False)