Fix chat focus

This commit is contained in:
Marco Pesenti Gritti 2006-06-23 15:08:00 -04:00
parent 92a4708244
commit 3fcfebf112
3 changed files with 8 additions and 2 deletions

View File

@ -22,6 +22,7 @@ class ChatToolbar(gtk.HBox):
toolbox.show() toolbox.show()
item = gtk.Button() item = gtk.Button()
item.unset_flags(gtk.CAN_FOCUS)
e_hbox = gtk.HBox(False, 6) e_hbox = gtk.HBox(False, 6)

View File

@ -166,6 +166,7 @@ class RichTextToolbox(gtk.HBox):
item = gtk.ToggleButton() item = gtk.ToggleButton()
item.set_image(image) item.set_image(image)
item.connect("toggled", self.__toggle_style_cb, "bold") item.connect("toggled", self.__toggle_style_cb, "bold")
item.unset_flags(gtk.CAN_FOCUS)
self.pack_start(item, False) self.pack_start(item, False)
item.show() item.show()
@ -176,6 +177,7 @@ class RichTextToolbox(gtk.HBox):
item = gtk.ToggleButton() item = gtk.ToggleButton()
item.set_image(image) item.set_image(image)
item.unset_flags(gtk.CAN_FOCUS)
item.connect("toggled", self.__toggle_style_cb, "italic") item.connect("toggled", self.__toggle_style_cb, "italic")
self.pack_start(item, False) self.pack_start(item, False)
item.show() item.show()
@ -185,6 +187,7 @@ class RichTextToolbox(gtk.HBox):
self._font_size_up = gtk.Button() self._font_size_up = gtk.Button()
self._font_size_up.set_image(image) 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._font_size_up.connect("clicked", self.__font_size_up_cb)
self.pack_start(self._font_size_up, False) self.pack_start(self._font_size_up, False)
self._font_size_up.show() self._font_size_up.show()
@ -196,6 +199,7 @@ class RichTextToolbox(gtk.HBox):
self._font_size_down = gtk.Button() self._font_size_down = gtk.Button()
self._font_size_down.set_image(image) 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._font_size_down.connect("clicked", self.__font_size_down_cb)
self.pack_start(self._font_size_down, False) self.pack_start(self._font_size_down, False)
self._font_size_down.show() self._font_size_down.show()

View File

@ -14,7 +14,7 @@ class ColorButton(gtk.RadioButton):
drawing_area = gtk.DrawingArea() drawing_area = gtk.DrawingArea()
drawing_area.set_size_request(24, 24) 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) self.add(drawing_area)
drawing_area.show() drawing_area.show()
@ -26,7 +26,7 @@ class ColorButton(gtk.RadioButton):
ctx = widget.window.cairo_create() ctx = widget.window.cairo_create()
ctx.set_source_rgb(self._rgb[0], self._rgb[1] , self._rgb[2]) 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() ctx.fill()
return False return False
@ -49,6 +49,7 @@ class Toolbox(gtk.HBox):
def _add_color(self, rgb): def _add_color(self, rgb):
color = ColorButton(self._colors_group, rgb) color = ColorButton(self._colors_group, rgb)
color.unset_flags(gtk.CAN_FOCUS)
color.connect('clicked', self.__color_clicked_cb, rgb) color.connect('clicked', self.__color_clicked_cb, rgb)
self.pack_start(color, False) self.pack_start(color, False)