Allow clicking and mousewheeling on the battery panel
This commit is the same as vimishor's original [*] except that I have
added middle-click and up/down mousewheel actions. In order to fix a
ftbs I also added guards to panel.c, panel.h & tint.c
The following configuration settings have been created :-
battery_lclick_command
battery_mclick_command
battery_rclick_command
battery_uwheel_command
battery_dwheel_command
[*] c78732c46a
This commit is contained in:
16
src/panel.c
16
src/panel.c
@@ -796,6 +796,22 @@ int click_clock(Panel *panel, int x, int y)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_BATTERY
|
||||
int click_battery(Panel *panel, int x, int y)
|
||||
{
|
||||
Battery bat = panel->battery;
|
||||
if (panel_horizontal) {
|
||||
if (bat.area.on_screen && x >= bat.area.posx && x <= (bat.area.posx + bat.area.width))
|
||||
return TRUE;
|
||||
} else {
|
||||
if (bat.area.on_screen && y >= bat.area.posy && y <= (bat.area.posy + bat.area.height))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Area* click_area(Panel *panel, int x, int y)
|
||||
{
|
||||
Area* result = &panel->area;
|
||||
|
||||
Reference in New Issue
Block a user