]> Dogcows Code - chaz/openbox/commitdiff
make the framerender_frame() code a bit less crazy
authorMikael Magnusson <mikachu@comhem.se>
Thu, 14 Jul 2005 20:46:31 +0000 (20:46 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 14 Jul 2005 20:46:31 +0000 (20:46 +0000)
openbox/framerender.c

index 7356a3833d99446f9796d1965fba11c34839d18d..e2c5ffd2bed8eb57cd2def3c701f77a039c826e1 100644 (file)
@@ -45,99 +45,99 @@ void framerender_frame(ObFrame *self)
 
     if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
         RrAppearance *t, *l, *m, *n, *i, *d, *s, *c;
+        if (self->focused) {
 
-        t = (self->focused ?
-             self->a_focused_title : self->a_unfocused_title);
-        l = (self->focused ?
-             self->a_focused_label : self->a_unfocused_label);
-        m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ?
-             (self->focused ?
+          t = self->a_focused_title;
+          l = self->a_focused_label;
+          m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ?
               ob_rr_theme->a_disabled_focused_max :
-              ob_rr_theme->a_disabled_unfocused_max) :
-             (self->focused ?
               (self->client->max_vert || self->client->max_horz ?
                ob_rr_theme->a_toggled_focused_max :
                (self->max_press ?
                 ob_rr_theme->a_focused_pressed_max :
                 (self->max_hover ?
                  ob_rr_theme->a_hover_focused_max : 
-                 ob_rr_theme->a_focused_unpressed_max))) :
-              (self->client->max_vert || self->client->max_horz ?
-               ob_rr_theme->a_toggled_unfocused_max :
-               (self->max_press ?
-                ob_rr_theme->a_unfocused_pressed_max :
-                (self->max_hover ?
-                 ob_rr_theme->a_hover_unfocused_max : 
-                 ob_rr_theme->a_unfocused_unpressed_max)))));
-        n = self->a_icon;
-        i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ?
-             (self->focused ?
+                 ob_rr_theme->a_focused_unpressed_max))));
+          n = self->a_icon;
+          i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ?
               ob_rr_theme->a_disabled_focused_iconify :
-              ob_rr_theme->a_disabled_unfocused_iconify) :
-             (self->focused ?
               (self->iconify_press ?
                ob_rr_theme->a_focused_pressed_iconify :
                (self->iconify_hover ?
                 ob_rr_theme->a_hover_focused_iconify : 
-                ob_rr_theme->a_focused_unpressed_iconify)) :
-              (self->iconify_press ?
-               ob_rr_theme->a_unfocused_pressed_iconify :
-               (self->iconify_hover ?
-                ob_rr_theme->a_hover_unfocused_iconify : 
-                ob_rr_theme->a_unfocused_unpressed_iconify))));
-        d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ?
-             (self->focused ?
+                ob_rr_theme->a_focused_unpressed_iconify)));
+          d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ?
               ob_rr_theme->a_disabled_focused_desk :
-              ob_rr_theme->a_disabled_unfocused_desk) :
-             (self->focused ?
               (self->client->desktop == DESKTOP_ALL ?
                ob_rr_theme->a_toggled_focused_desk :
                (self->desk_press ?
                 ob_rr_theme->a_focused_pressed_desk :
                 (self->desk_hover ?
                  ob_rr_theme->a_hover_focused_desk : 
-                 ob_rr_theme->a_focused_unpressed_desk))) :
-              (self->client->desktop == DESKTOP_ALL ?
-               ob_rr_theme->a_toggled_unfocused_desk :
-               (self->desk_press ?
-                ob_rr_theme->a_unfocused_pressed_desk :
-                (self->desk_hover ?
-                 ob_rr_theme->a_hover_unfocused_desk : 
-                 ob_rr_theme->a_unfocused_unpressed_desk)))));
-        s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ?
-             (self->focused ?
+                 ob_rr_theme->a_focused_unpressed_desk))));
+          s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ?
               ob_rr_theme->a_disabled_focused_shade :
-              ob_rr_theme->a_disabled_unfocused_shade) :
-             (self->focused ?
               (self->client->shaded ?
                ob_rr_theme->a_toggled_focused_shade :
                (self->shade_press ?
                 ob_rr_theme->a_focused_pressed_shade :
                 (self->shade_hover ?
                  ob_rr_theme->a_hover_focused_shade : 
-                 ob_rr_theme->a_focused_unpressed_shade))) :
+                 ob_rr_theme->a_focused_unpressed_shade))));
+          c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ?
+              ob_rr_theme->a_disabled_focused_close :
+              (self->close_press ?
+               ob_rr_theme->a_focused_pressed_close :
+               (self->close_hover ?
+                ob_rr_theme->a_hover_focused_close : 
+                ob_rr_theme->a_focused_unpressed_close)));
+        } else {
+
+          t = self->a_unfocused_title;
+          l = self->a_unfocused_label;
+          m = (!(self->decorations & OB_FRAME_DECOR_MAXIMIZE) ?
+              ob_rr_theme->a_disabled_unfocused_max :
+              (self->client->max_vert || self->client->max_horz ?
+               ob_rr_theme->a_toggled_unfocused_max :
+               (self->max_press ?
+                ob_rr_theme->a_unfocused_pressed_max :
+                (self->max_hover ?
+                 ob_rr_theme->a_hover_unfocused_max : 
+                 ob_rr_theme->a_unfocused_unpressed_max))));
+          n = self->a_icon;
+          i = (!(self->decorations & OB_FRAME_DECOR_ICONIFY) ?
+              ob_rr_theme->a_disabled_unfocused_iconify :
+              (self->iconify_press ?
+               ob_rr_theme->a_unfocused_pressed_iconify :
+               (self->iconify_hover ?
+                ob_rr_theme->a_hover_unfocused_iconify : 
+                ob_rr_theme->a_unfocused_unpressed_iconify)));
+          d = (!(self->decorations & OB_FRAME_DECOR_ALLDESKTOPS) ?
+              ob_rr_theme->a_disabled_unfocused_desk :
+              (self->client->desktop == DESKTOP_ALL ?
+               ob_rr_theme->a_toggled_unfocused_desk :
+               (self->desk_press ?
+                ob_rr_theme->a_unfocused_pressed_desk :
+                (self->desk_hover ?
+                 ob_rr_theme->a_hover_unfocused_desk : 
+                 ob_rr_theme->a_unfocused_unpressed_desk))));
+          s = (!(self->decorations & OB_FRAME_DECOR_SHADE) ?
+              ob_rr_theme->a_disabled_unfocused_shade :
               (self->client->shaded ?
                ob_rr_theme->a_toggled_unfocused_shade :
                (self->shade_press ?
                 ob_rr_theme->a_unfocused_pressed_shade :
                 (self->shade_hover ?
                  ob_rr_theme->a_hover_unfocused_shade : 
-                 ob_rr_theme->a_unfocused_unpressed_shade)))));
-        c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ?
-             (self->focused ?
-              ob_rr_theme->a_disabled_focused_close :
-              ob_rr_theme->a_disabled_unfocused_close) :
-             (self->focused ?
-              (self->close_press ?
-               ob_rr_theme->a_focused_pressed_close :
-               (self->close_hover ?
-                ob_rr_theme->a_hover_focused_close : 
-                ob_rr_theme->a_focused_unpressed_close)) :
+                 ob_rr_theme->a_unfocused_unpressed_shade))));
+          c = (!(self->decorations & OB_FRAME_DECOR_CLOSE) ?
+              ob_rr_theme->a_disabled_unfocused_close :
               (self->close_press ?
                ob_rr_theme->a_unfocused_pressed_close :
                (self->close_hover ?
                 ob_rr_theme->a_hover_unfocused_close : 
-                ob_rr_theme->a_unfocused_unpressed_close))));
+                ob_rr_theme->a_unfocused_unpressed_close)));
+        }
 
         RrPaint(t, self->title, self->width, ob_rr_theme->title_height);
 
This page took 0.027202 seconds and 4 git commands to generate.