修改ibus的颜色
看久了千篇一律的ibus输入法的输入框总会有点腻了的感觉
so 稍微hack了一下代码改了一下颜色~
原版ibus-pinyin
改版ibus-pinyin
改版ibus-sunpinyin
改版ibus-cloud-pinyin
这下有了点fcitx的感觉了吧~~~
只是自己修改玩玩 所以没有深入研究代码
1 *** candidatepanel.py 2010-09-13 14:08:16.000000000 +0800
2 --- /home/yangguang/Desktop/candidatepanel.py 2010-09-13 12:26:28.000000000 +0800
3 ***************
4 *** 87,98 ****
5 for i in range(0, 16):
6 label1 = Label("%c." % ("1234567890abcdef"[i]))
7 label1.set_alignment(0.0, 0.5)
8 - label1.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color("#013BC5"))
9 label1.show()
10
11 label2 = Label()
12 label2.set_alignment(0.0, 0.5)
13 - label2.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color("#69A0EC"))
14 label1.show()
15
16 if self.__orientation == ibus.ORIENTATION_VERTICAL:
17 --- 87,96 ----
18 ***************
19 *** 100,110 ****
20 label2.set_property("xpad", 8)
21 ebox1 = EventBox()
22 ebox1.set_no_show_all(True)
23 - ebox1.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color("#FFFFFF"))
24 ebox1.add(label1)
25 ebox2 = EventBox()
26 ebox2.set_no_show_all(True)
27 - ebox2.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color("#FFFFFF"))
28 ebox2.add(label2)
29 self.__vbox1.pack_start(ebox1, False, False, 2)
30 self.__vbox2.pack_start(ebox2, False, False, 2)
31 --- 98,106 ----
32 ***************
33 *** 116,122 ****
34 hbox.pack_start(label2, False, False, 1)
35 ebox = EventBox()
36 ebox.set_no_show_all(True)
37 - ebox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color("#FFFFFF"))
38 ebox.add(hbox)
39 self.pack_start(ebox, False, False, 4)
40 self.__candidates.append((ebox,))
41 --- 112,117 ----
42 ***************
43 *** 148,159 ****
44 if i == focus_candidate and show_cursor:
45 if attrs == None:
46 attrs = pango.AttrList()
47 ! #color = self.__labels[i][1].style.base[gtk.STATE_SELECTED]
48 ! #print color
49 end_index = len(text.encode("utf8"))
50 ! #attr = pango.AttrBackground(color.red, color.green, color.blue, 0, end_index)
51 ! #attrs.change(attr)
52 ! color = gtk.gdk.Color("#FF55FF")
53 attr = pango.AttrForeground(color.red, color.green, color.blue, 0, end_index)
54 attrs.insert(attr)
55
56 --- 143,153 ----
57 if i == focus_candidate and show_cursor:
58 if attrs == None:
59 attrs = pango.AttrList()
60 ! color = self.__labels[i][1].style.base[gtk.STATE_SELECTED]
61 end_index = len(text.encode("utf8"))
62 ! attr = pango.AttrBackground(color.red, color.green, color.blue, 0, end_index)
63 ! attrs.change(attr)
64 ! color = self.__labels[i][1].style.text[gtk.STATE_SELECTED]
65 attr = pango.AttrForeground(color.red, color.green, color.blue, 0, end_index)
66 attrs.insert(attr)
67
68 ***************
69 *** 229,236 ****
70 self.__moved_cursor_location = None
71
72 self.__recreate_ui()
73 -
74 - self.__viewport.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color("#FFFFFF"))
75
76 def __handle_move_end_cb(self, handle):
77 # store moved location
78 --- 223,228 ----
79 ***************
80 *** 251,257 ****
81
82 # create aux label
83 self.__aux_label = Label(self.__aux_string)
84 - self.__aux_label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color("#EB50A0"))
85 self.__aux_label.set_attributes(self.__aux_attrs)
86 self.__aux_label.set_alignment(0.0, 0.5)
87 self.__aux_label.set_padding(8, 0)
88 --- 243,248 ----
89 ***************
90 *** 526,532 ****
91 table = ibus.LookupTable()
92 table.append_candidate(ibus.Text("AAA"))
93 table.append_candidate(ibus.Text("BBB"))
94 - table.append_label(ibus.Text("CCC"))
95 cp = CandidatePanel()
96 cp.show_all()
97 cp.update_lookup_table(table, True)
98 --- 517,522 ----