summaryrefslogtreecommitdiff
path: root/caribou
diff options
context:
space:
mode:
authorEitan Isaacson <eitan@monotonous.org>2011-05-05 15:16:13 -0400
committerEitan Isaacson <eitan@monotonous.org>2011-05-05 15:30:42 -0400
commit175ecaa24b5e20633a2a6a08ae520f6448b8f37c (patch)
tree41b8bdae7a3b1dcde5f3068cb0b0d0f46499c64b /caribou
parentcec8c785c4c0893581e288db603cb38e235a24e3 (diff)
downloadcaribou-175ecaa24b5e20633a2a6a08ae520f6448b8f37c.tar.gz
Added GTK+ CSS classes for Antler widgets.
Diffstat (limited to 'caribou')
-rw-r--r--caribou/antler/keyboard_view.py13
-rw-r--r--caribou/antler/window.py3
2 files changed, 15 insertions, 1 deletions
diff --git a/caribou/antler/keyboard_view.py b/caribou/antler/keyboard_view.py
index 30d5c02..4953da4 100644
--- a/caribou/antler/keyboard_view.py
+++ b/caribou/antler/keyboard_view.py
@@ -31,6 +31,9 @@ class AntlerKey(Gtk.Button):
label.set_use_markup(True)
label.props.margin = 6
+ ctx = self.get_style_context()
+ ctx.add_class("antler-keyboard-button")
+
if key.props.name == "Caribou_Prefs":
key.connect("key-clicked", self._on_prefs_clicked)
if key.get_extended_keys ():
@@ -78,6 +81,9 @@ class AntlerSubLevel(Gtk.Window):
self.set_position(Gtk.WindowPosition.MOUSE)
self.set_type_hint(Gdk.WindowTypeHint.DIALOG)
+ ctx = self.get_style_context()
+ ctx.add_class("antler-keyboard-window")
+
key.caribou_key.connect("notify::show-subkeys", self._on_show_subkeys)
self._key = key
@@ -104,6 +110,10 @@ class AntlerLayout(Gtk.Grid):
self.set_row_homogeneous(True)
self.set_row_spacing(6)
self.set_column_spacing(6)
+
+ ctx = self.get_style_context()
+ ctx.add_class("antler-keyboard-layout")
+
if level:
self.load_rows(level.get_rows ())
@@ -111,6 +121,8 @@ class AntlerLayout(Gtk.Grid):
col_num = 0
for i, key in enumerate(row):
antler_key = AntlerKey(key)
+ ctx = antler_key.get_style_context()
+ ctx.add_class("antler-keyboard-row%d" % row_num)
self.attach(antler_key,
col_num + int(key.props.margin_left * self.KEY_SPAN),
row_num * self.KEY_SPAN,
@@ -118,7 +130,6 @@ class AntlerLayout(Gtk.Grid):
self.KEY_SPAN)
col_num += int((key.props.width + key.props.margin_left ) * self.KEY_SPAN)
-
def load_rows(self, rows):
for row_num, row in enumerate(rows):
self.add_row(row.get_keys(), row_num)
diff --git a/caribou/antler/window.py b/caribou/antler/window.py
index 973824a..9ad82f2 100644
--- a/caribou/antler/window.py
+++ b/caribou/antler/window.py
@@ -109,6 +109,9 @@ class AntlerWindow(Gtk.Window, Clutter.Animatable, ProximityWindowBase):
self.set_name("AntlerWindow")
+ ctx = self.get_style_context()
+ ctx.add_class("antler-keyboard-window")
+
self._vbox = Gtk.VBox()
self.add(self._vbox)
self.keyboard = text_entry_mech