summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-07-10 23:27:02 +0000
committerDana Jansens <danakj@orodu.net>2003-07-10 23:27:02 +0000
commit81af5a8b0caadc0a82ff2304c315f816c9576e93 (patch)
treeccbe40fccf5bd00b6a5cba87c20aec3ad8b6e55a /render
parentb0e8e276e451639689ebc9c58c1afe54897bceb2 (diff)
add disabled buttons, instead of now showing buttons at all when they wont do anything, now show a disabled button instead. this severely breaks compatibility with blackbox themes since there is no good way to automiatically create a disabled button that i can think of, so if they dont exist in the theme you get black and white for the button.
when a window cant be resized, its handle is not removed but its grips are. change allowing the user to disable individual decorations as that is overkill, instead allow a toggle through the client.decorate boolean.
Diffstat (limited to 'render')
-rw-r--r--render/theme.c111
-rw-r--r--render/theme.h12
2 files changed, 85 insertions, 38 deletions
diff --git a/render/theme.c b/render/theme.c
index e41860ed..877d2f12 100644
--- a/render/theme.c
+++ b/render/theme.c
@@ -31,44 +31,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->inst = inst;
- theme->b_color = theme->cb_unfocused_color = theme->cb_focused_color =
- theme->title_unfocused_color = theme->title_focused_color =
- theme->titlebut_unfocused_color = theme->titlebut_focused_color =
- theme->menu_color = theme->menu_title_color =
- theme->menu_disabled_color = theme->menu_hilite_color = NULL;
- theme->winfont = theme->mtitlefont = theme->mfont = NULL;
- theme->title_layout = NULL;
- theme->max_set_mask = theme->max_unset_mask = NULL;
- theme->desk_set_mask = theme->desk_unset_mask = NULL;
- theme->shade_set_mask = theme->shade_unset_mask = NULL;
- theme->iconify_mask = theme->close_mask = NULL;
-
+ theme->a_disabled_focused_max = RrAppearanceNew(inst, 1);
+ theme->a_disabled_unfocused_max = RrAppearanceNew(inst, 1);
theme->a_focused_unpressed_max = RrAppearanceNew(inst, 1);
theme->a_focused_pressed_max = RrAppearanceNew(inst, 1);
theme->a_focused_pressed_set_max = RrAppearanceNew(inst, 1);
theme->a_unfocused_unpressed_max = RrAppearanceNew(inst, 1);
theme->a_unfocused_pressed_max = RrAppearanceNew(inst, 1);
theme->a_unfocused_pressed_set_max = RrAppearanceNew(inst, 1);
- theme->a_focused_unpressed_close = NULL;
- theme->a_focused_pressed_close = NULL;
- theme->a_unfocused_unpressed_close = NULL;
- theme->a_unfocused_pressed_close = NULL;
- theme->a_focused_unpressed_desk = NULL;
- theme->a_focused_pressed_desk = NULL;
- theme->a_focused_pressed_set_desk = NULL;
- theme->a_unfocused_unpressed_desk = NULL;
- theme->a_unfocused_pressed_desk = NULL;
- theme->a_unfocused_pressed_set_desk = NULL;
- theme->a_focused_unpressed_shade = NULL;
- theme->a_focused_pressed_shade = NULL;
- theme->a_focused_pressed_set_shade = NULL;
- theme->a_unfocused_unpressed_shade = NULL;
- theme->a_unfocused_pressed_shade = NULL;
- theme->a_unfocused_pressed_set_shade = NULL;
- theme->a_focused_unpressed_iconify = NULL;
- theme->a_focused_pressed_iconify = NULL;
- theme->a_unfocused_unpressed_iconify = NULL;
- theme->a_unfocused_pressed_iconify = NULL;
theme->a_focused_grip = RrAppearanceNew(inst, 0);
theme->a_unfocused_grip = RrAppearanceNew(inst, 0);
theme->a_focused_title = RrAppearanceNew(inst, 0);
@@ -195,6 +165,15 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
&theme->title_unfocused_color))
theme->title_unfocused_color = RrColorNew(inst, 0xff, 0xff, 0xff);
if (!read_color(db, inst,
+ "window.button.disabled.focus.picColor",
+ &theme->titlebut_disabled_focused_color))
+ theme->titlebut_disabled_focused_color =
+ RrColorNew(inst, 0xff, 0xff, 0xff);
+ if (!read_color(db, inst,
+ "window.button.disabled.unfocus.picColor",
+ &theme->titlebut_disabled_unfocused_color))
+ theme->titlebut_disabled_unfocused_color = RrColorNew(inst, 0, 0, 0);
+ if (!read_color(db, inst,
"window.button.focus.picColor",
&theme->titlebut_focused_color))
theme->titlebut_focused_color = RrColorNew(inst, 0, 0, 0);
@@ -323,6 +302,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
/* read buttons textures */
if (!read_appearance(db, inst,
+ "window.button.disabled.focus",
+ theme->a_disabled_focused_max))
+ set_default_appearance(theme->a_disabled_focused_max);
+ if (!read_appearance(db, inst,
+ "window.button.disabled.unfocus",
+ theme->a_disabled_unfocused_max))
+ set_default_appearance(theme->a_disabled_unfocused_max);
+ if (!read_appearance(db, inst,
"window.button.pressed.focus",
theme->a_focused_pressed_max))
if (!read_appearance(db, inst,
@@ -345,6 +332,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->a_unfocused_unpressed_max))
set_default_appearance(theme->a_unfocused_unpressed_max);
+ theme->a_disabled_focused_close =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_close =
+ RrAppearanceCopy(theme->a_disabled_unfocused_max);
theme->a_unfocused_unpressed_close =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_close =
@@ -353,6 +344,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
RrAppearanceCopy(theme->a_focused_unpressed_max);
theme->a_focused_pressed_close =
RrAppearanceCopy(theme->a_focused_pressed_max);
+ theme->a_disabled_focused_desk =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_desk =
+ RrAppearanceCopy(theme->a_disabled_unfocused_max);
theme->a_unfocused_unpressed_desk =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_desk =
@@ -365,6 +360,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
RrAppearanceCopy(theme->a_focused_pressed_max);
theme->a_focused_pressed_set_desk =
RrAppearanceCopy(theme->a_focused_pressed_max);
+ theme->a_disabled_focused_shade =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_shade =
+ RrAppearanceCopy(theme->a_disabled_unfocused_max);
theme->a_unfocused_unpressed_shade =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_shade =
@@ -377,6 +376,10 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
RrAppearanceCopy(theme->a_focused_pressed_max);
theme->a_focused_pressed_set_shade =
RrAppearanceCopy(theme->a_focused_pressed_max);
+ theme->a_disabled_focused_iconify =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
+ theme->a_disabled_unfocused_iconify =
+ RrAppearanceCopy(theme->a_disabled_focused_max);
theme->a_unfocused_unpressed_iconify =
RrAppearanceCopy(theme->a_unfocused_unpressed_max);
theme->a_unfocused_pressed_iconify =
@@ -437,33 +440,45 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->a_menu_hilite->texture[0].data.text.color =
theme->menu_hilite_color;
- theme->a_focused_unpressed_max->texture[0].type =
+ theme->a_disabled_focused_max->texture[0].type =
+ theme->a_disabled_unfocused_max->texture[0].type =
+ theme->a_focused_unpressed_max->texture[0].type =
theme->a_focused_pressed_max->texture[0].type =
theme->a_focused_pressed_set_max->texture[0].type =
theme->a_unfocused_unpressed_max->texture[0].type =
theme->a_unfocused_pressed_max->texture[0].type =
theme->a_unfocused_pressed_set_max->texture[0].type =
+ theme->a_disabled_focused_close->texture[0].type =
+ theme->a_disabled_unfocused_close->texture[0].type =
theme->a_focused_unpressed_close->texture[0].type =
theme->a_focused_pressed_close->texture[0].type =
theme->a_unfocused_unpressed_close->texture[0].type =
theme->a_unfocused_pressed_close->texture[0].type =
+ theme->a_disabled_focused_desk->texture[0].type =
+ theme->a_disabled_unfocused_desk->texture[0].type =
theme->a_focused_unpressed_desk->texture[0].type =
theme->a_focused_pressed_desk->texture[0].type =
theme->a_focused_pressed_set_desk->texture[0].type =
theme->a_unfocused_unpressed_desk->texture[0].type =
theme->a_unfocused_pressed_desk->texture[0].type =
theme->a_unfocused_pressed_set_desk->texture[0].type =
+ theme->a_disabled_focused_shade->texture[0].type =
+ theme->a_disabled_unfocused_shade->texture[0].type =
theme->a_focused_unpressed_shade->texture[0].type =
theme->a_focused_pressed_shade->texture[0].type =
theme->a_focused_pressed_set_shade->texture[0].type =
theme->a_unfocused_unpressed_shade->texture[0].type =
theme->a_unfocused_pressed_shade->texture[0].type =
theme->a_unfocused_pressed_set_shade->texture[0].type =
+ theme->a_disabled_focused_iconify->texture[0].type =
+ theme->a_disabled_unfocused_iconify->texture[0].type =
theme->a_focused_unpressed_iconify->texture[0].type =
theme->a_focused_pressed_iconify->texture[0].type =
theme->a_unfocused_unpressed_iconify->texture[0].type =
theme->a_unfocused_pressed_iconify->texture[0].type = RR_TEXTURE_MASK;
- theme->a_focused_unpressed_max->texture[0].data.mask.mask =
+ theme->a_disabled_focused_max->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_max->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_max->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_max->texture[0].data.mask.mask =
theme->a_focused_pressed_max->texture[0].data.mask.mask =
theme->a_unfocused_pressed_max->texture[0].data.mask.mask =
@@ -471,12 +486,16 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->a_focused_pressed_set_max->texture[0].data.mask.mask =
theme->a_unfocused_pressed_set_max->texture[0].data.mask.mask =
theme->max_set_mask;
- theme->a_focused_pressed_close->texture[0].data.mask.mask =
+ theme->a_disabled_focused_close->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_close->texture[0].data.mask.mask =
+ theme->a_focused_pressed_close->texture[0].data.mask.mask =
theme->a_unfocused_pressed_close->texture[0].data.mask.mask =
theme->a_focused_unpressed_close->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_close->texture[0].data.mask.mask =
theme->close_mask;
- theme->a_focused_unpressed_desk->texture[0].data.mask.mask =
+ theme->a_disabled_focused_desk->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_desk->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_desk->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_desk->texture[0].data.mask.mask =
theme->a_focused_pressed_desk->texture[0].data.mask.mask =
theme->a_unfocused_pressed_desk->texture[0].data.mask.mask =
@@ -484,7 +503,9 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->a_focused_pressed_set_desk->texture[0].data.mask.mask =
theme->a_unfocused_pressed_set_desk->texture[0].data.mask.mask =
theme->desk_set_mask;
- theme->a_focused_unpressed_shade->texture[0].data.mask.mask =
+ theme->a_disabled_focused_shade->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_shade->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_shade->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_shade->texture[0].data.mask.mask =
theme->a_focused_pressed_shade->texture[0].data.mask.mask =
theme->a_unfocused_pressed_shade->texture[0].data.mask.mask =
@@ -492,11 +513,25 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
theme->a_focused_pressed_set_shade->texture[0].data.mask.mask =
theme->a_unfocused_pressed_set_shade->texture[0].data.mask.mask =
theme->shade_set_mask;
- theme->a_focused_unpressed_iconify->texture[0].data.mask.mask =
+ theme->a_disabled_focused_iconify->texture[0].data.mask.mask =
+ theme->a_disabled_unfocused_iconify->texture[0].data.mask.mask =
+ theme->a_focused_unpressed_iconify->texture[0].data.mask.mask =
theme->a_unfocused_unpressed_iconify->texture[0].data.mask.mask =
theme->a_focused_pressed_iconify->texture[0].data.mask.mask =
theme->a_unfocused_pressed_iconify->texture[0].data.mask.mask =
theme->iconify_mask;
+ theme->a_disabled_focused_max->texture[0].data.mask.color =
+ theme->a_disabled_focused_close->texture[0].data.mask.color =
+ theme->a_disabled_focused_desk->texture[0].data.mask.color =
+ theme->a_disabled_focused_shade->texture[0].data.mask.color =
+ theme->a_disabled_focused_iconify->texture[0].data.mask.color =
+ theme->titlebut_disabled_focused_color;
+ theme->a_disabled_unfocused_max->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_close->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_desk->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_shade->texture[0].data.mask.color =
+ theme->a_disabled_unfocused_iconify->texture[0].data.mask.color =
+ theme->titlebut_disabled_unfocused_color;
theme->a_focused_unpressed_max->texture[0].data.mask.color =
theme->a_focused_pressed_max->texture[0].data.mask.color =
theme->a_focused_pressed_set_max->texture[0].data.mask.color =
diff --git a/render/theme.h b/render/theme.h
index 518c7e72..acf17c3e 100644
--- a/render/theme.h
+++ b/render/theme.h
@@ -27,6 +27,8 @@ struct _RrTheme {
RrColor *cb_unfocused_color;
RrColor *title_focused_color;
RrColor *title_unfocused_color;
+ RrColor *titlebut_disabled_focused_color;
+ RrColor *titlebut_disabled_unfocused_color;
RrColor *titlebut_focused_color;
RrColor *titlebut_unfocused_color;
RrColor *menu_title_color;
@@ -56,28 +58,38 @@ struct _RrTheme {
RrPixmapMask *close_mask;
/* global appearances */
+ RrAppearance *a_disabled_focused_max;
+ RrAppearance *a_disabled_unfocused_max;
RrAppearance *a_focused_unpressed_max;
RrAppearance *a_focused_pressed_max;
RrAppearance *a_focused_pressed_set_max;
RrAppearance *a_unfocused_unpressed_max;
RrAppearance *a_unfocused_pressed_max;
RrAppearance *a_unfocused_pressed_set_max;
+ RrAppearance *a_disabled_focused_close;
+ RrAppearance *a_disabled_unfocused_close;
RrAppearance *a_focused_unpressed_close;
RrAppearance *a_focused_pressed_close;
RrAppearance *a_unfocused_unpressed_close;
RrAppearance *a_unfocused_pressed_close;
+ RrAppearance *a_disabled_focused_desk;
+ RrAppearance *a_disabled_unfocused_desk;
RrAppearance *a_focused_unpressed_desk;
RrAppearance *a_focused_pressed_desk;
RrAppearance *a_focused_pressed_set_desk;
RrAppearance *a_unfocused_unpressed_desk;
RrAppearance *a_unfocused_pressed_desk;
RrAppearance *a_unfocused_pressed_set_desk;
+ RrAppearance *a_disabled_focused_shade;
+ RrAppearance *a_disabled_unfocused_shade;
RrAppearance *a_focused_unpressed_shade;
RrAppearance *a_focused_pressed_shade;
RrAppearance *a_focused_pressed_set_shade;
RrAppearance *a_unfocused_unpressed_shade;
RrAppearance *a_unfocused_pressed_shade;
RrAppearance *a_unfocused_pressed_set_shade;
+ RrAppearance *a_disabled_focused_iconify;
+ RrAppearance *a_disabled_unfocused_iconify;
RrAppearance *a_focused_unpressed_iconify;
RrAppearance *a_focused_pressed_iconify;
RrAppearance *a_unfocused_unpressed_iconify;