Added shade/unshade using mouse wheel to title bar actions.

SVN revision: 12088
This commit is contained in:
Kim Woelders 2004-10-30 14:24:13 +00:00
parent 444fb149c0
commit 97964e8559
2 changed files with 25 additions and 7 deletions

View File

@ -73,7 +73,7 @@ __ACLASS __BGN
__NEXT_ACTION __NEXT_ACTION
__TOOLTIP_ACTION_TEXT "Toggle the shaded (rolled-up) state of this window." __TOOLTIP_ACTION_TEXT "Toggle the shaded (rolled-up) state of this window."
__EVENT __DOUBLE_CLICK __EVENT __DOUBLE_CLICK
__ALLOW_ANY_BUTTON __ON __BUTTON 1
__ACTION __A_SHADE __ACTION __A_SHADE
__NEXT_ACTION __NEXT_ACTION
__TOOLTIP_ACTION_TEXT "Show/Hide group borders." __TOOLTIP_ACTION_TEXT "Show/Hide group borders."
@ -99,6 +99,20 @@ __ACLASS __BGN
__BUTTON 1 __BUTTON 1
__MODIFIER_KEY __CTRL_SHIFT __MODIFIER_KEY __CTRL_SHIFT
__ACTION __A_BREAK_GROUP __ACTION __A_BREAK_GROUP
__NEXT_ACTION
__TOOLTIP_ACTION_TEXT "Shade."
__EVENT __MOUSE_PRESS
__BUTTON 4
__ALLOW_ANY_MODIFIER_KEYS __ON
__ACTION __A_SHADE on
__NEXT_ACTION
__TOOLTIP_ACTION_TEXT "Unshade."
__EVENT __MOUSE_PRESS
__BUTTON 5
__ALLOW_ANY_MODIFIER_KEYS __ON
__ACTION __A_SHADE off
__END __END
__ACLASS __BGN __ACLASS __BGN

View File

@ -2380,24 +2380,29 @@ DoShade(EWin * ewin, const void *params, int nogroup)
{ {
EWin **gwins = NULL; EWin **gwins = NULL;
Group *curr_group = NULL; Group *curr_group = NULL;
int i, num; int i, num, shade;
char shaded;
EDBUG(6, "doShade"); EDBUG(6, "doShade");
gwins = ListWinGroupMembersForEwin(ewin, ACTION_SHADE, nogroup, &num); gwins = ListWinGroupMembersForEwin(ewin, ACTION_SHADE, nogroup, &num);
shaded = ewin->shaded; if (!params)
shade = !ewin->shaded;
else if (!strcmp(params, "on"))
shade = 1;
else if (!strcmp(params, "off"))
shade = 0;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
curr_group = EwinsInGroup(ewin, gwins[i]); curr_group = EwinsInGroup(ewin, gwins[i]);
if (gwins[i]->shaded if (gwins[i]->shaded
&& ((curr_group && !curr_group->cfg.mirror) || shaded)) && ((curr_group && !curr_group->cfg.mirror) || !shade))
{ {
SoundPlay("SOUND_UNSHADE"); SoundPlay("SOUND_UNSHADE");
EwinUnShade(gwins[i]); EwinUnShade(gwins[i]);
} }
else if (!gwins[i]->shaded else if (!gwins[i]->shaded
&& ((curr_group && !curr_group->cfg.mirror) || !shaded)) && ((curr_group && !curr_group->cfg.mirror) || shade))
{ {
SoundPlay("SOUND_SHADE"); SoundPlay("SOUND_SHADE");
EwinShade(gwins[i]); EwinShade(gwins[i]);
@ -2406,7 +2411,6 @@ DoShade(EWin * ewin, const void *params, int nogroup)
} }
Efree(gwins); Efree(gwins);
EDBUG_RETURN(0); EDBUG_RETURN(0);
params = NULL;
} }
static int static int