From 26254d27170e2ea2b6cce1664562ebfaa9f74cb5 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 12 Jan 2009 22:06:59 +0000 Subject: [PATCH] Use the bgcolor configuration option --- cb-openbox-logout.py | 10 ++++++++-- openbox-logout.conf | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cb-openbox-logout.py b/cb-openbox-logout.py index fb45c14..a2f0c53 100755 --- a/cb-openbox-logout.py +++ b/cb-openbox-logout.py @@ -128,9 +128,15 @@ class OpenboxLogout(): # Validate configuration if not os.path.exists('img/%s/' % self.button_theme): - logging.debug("Button theme %s not found, reverting to default" % self.button_theme) + logging.warning("Button theme %s not found, reverting to default" % self.button_theme) self.button_theme = 'default' + try: + self.bgcolor = gtk.gdk.Color(self.parser.get("looks", "bgcolor")) + except ValueError: + logging.warning("Color %s is not a valid color, defaulting to black" % self.parser.get("looks", "bgcolor")) + self.bgcolor = gtk.gdk.Color("black") + def on_expose(self, widget, event): cr = widget.window.cairo_create() @@ -145,7 +151,7 @@ class OpenboxLogout(): cr.paint() (width, height) = widget.get_size() - cr.set_source_rgba(0, 0, 0, float(self.opacity)/100) + cr.set_source_rgba(self.bgcolor.red, self.bgcolor.green, self.bgcolor.blue, float(self.opacity)/100) cr.rectangle(0, 0, width, height) cr.fill() diff --git a/openbox-logout.conf b/openbox-logout.conf index a25079f..0807a1b 100644 --- a/openbox-logout.conf +++ b/openbox-logout.conf @@ -1,7 +1,7 @@ [looks] blur = False -opacity = 50 buttontheme = default +opacity = 50 bgcolor = black [buttons]