[caribou] Added GTK+ CSS classes for Antler widgets.



commit 175ecaa24b5e20633a2a6a08ae520f6448b8f37c
Author: Eitan Isaacson <eitan monotonous org>
Date:   Thu May 5 15:16:13 2011 -0400

    Added GTK+ CSS classes for Antler widgets.

 caribou/antler/keyboard_view.py |   13 ++++++++++++-
 caribou/antler/window.py        |    3 +++
 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]