[client] Merge vertical and horizontalmax inside togglemax
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
03170abfe1
commit
b75e462223
72
client.c
72
client.c
|
@ -1101,69 +1101,39 @@ client_maximize(client_t *c, area_t geometry)
|
|||
}
|
||||
|
||||
/** Toggle maximization state for the focused client.
|
||||
* \param screen Screen ID
|
||||
* \param arg Unused
|
||||
* \param screen Virtual screen number.
|
||||
* \param arg Either "vertical", "horizontal" or nothing for both.
|
||||
* \ingroup ui_callback
|
||||
*/
|
||||
void
|
||||
uicb_client_togglemax(int screen, char *arg __attribute__ ((unused)))
|
||||
uicb_client_togglemax(int screen, char *arg)
|
||||
{
|
||||
client_t *sel = globalconf.focus->client;
|
||||
area_t area = screen_get_area(screen,
|
||||
area_t area;
|
||||
|
||||
if(!globalconf.focus->client)
|
||||
return;
|
||||
|
||||
area = screen_get_area(screen,
|
||||
globalconf.screens[screen].statusbar,
|
||||
&globalconf.screens[screen].padding);
|
||||
|
||||
if(sel)
|
||||
if(arg[0] == 'v')
|
||||
{
|
||||
area.width -= 2 * sel->border;
|
||||
area.height -= 2 * sel->border;
|
||||
client_maximize(sel, area);
|
||||
area.x = globalconf.focus->client->geometry.x;
|
||||
area.width = globalconf.focus->client->geometry.width;
|
||||
area.height -= 2 * globalconf.focus->client->border;
|
||||
}
|
||||
}
|
||||
|
||||
/** Toggle vertical maximization for the focused client.
|
||||
* \param screen Screen ID
|
||||
* \param arg Unused
|
||||
* \ingroup ui_callback
|
||||
*/
|
||||
void
|
||||
uicb_client_toggleverticalmax(int screen, char *arg __attribute__ ((unused)))
|
||||
else if(arg[0] == 'h')
|
||||
{
|
||||
client_t *sel = globalconf.focus->client;
|
||||
area_t area = screen_get_area(screen,
|
||||
globalconf.screens[screen].statusbar,
|
||||
&globalconf.screens[screen].padding);
|
||||
|
||||
if(sel)
|
||||
{
|
||||
area.x = sel->geometry.x;
|
||||
area.width = sel->geometry.width;
|
||||
area.height -= 2 * sel->border;
|
||||
client_maximize(sel, area);
|
||||
area.y = globalconf.focus->client->geometry.y;
|
||||
area.height = globalconf.focus->client->geometry.height;
|
||||
area.width -= 2 * globalconf.focus->client->border;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Toggle horizontal maximization for the focused client.
|
||||
* \param screen Screen ID
|
||||
* \param arg Unused
|
||||
* \ingroup ui_callback
|
||||
*/
|
||||
void
|
||||
uicb_client_togglehorizontalmax(int screen, char *arg __attribute__ ((unused)))
|
||||
else
|
||||
{
|
||||
client_t *sel = globalconf.focus->client;
|
||||
area_t area = screen_get_area(screen,
|
||||
globalconf.screens[screen].statusbar,
|
||||
&globalconf.screens[screen].padding);
|
||||
|
||||
if(sel)
|
||||
{
|
||||
area.y = sel->geometry.y;
|
||||
area.height = sel->geometry.height;
|
||||
area.width -= 2 * sel->border;
|
||||
client_maximize(sel, area);
|
||||
area.width -= 2 * globalconf.focus->client->border;
|
||||
area.height -= 2 * globalconf.focus->client->border;
|
||||
}
|
||||
client_maximize(globalconf.focus->client, area);
|
||||
}
|
||||
|
||||
/** Move the client to the master area.
|
||||
|
|
2
client.h
2
client.h
|
@ -50,8 +50,6 @@ uicb_t uicb_client_moveresize;
|
|||
uicb_t uicb_client_settrans;
|
||||
uicb_t uicb_client_swap;
|
||||
uicb_t uicb_client_togglemax;
|
||||
uicb_t uicb_client_toggleverticalmax;
|
||||
uicb_t uicb_client_togglehorizontalmax;
|
||||
uicb_t uicb_client_zoom;
|
||||
uicb_t uicb_client_focus;
|
||||
uicb_t uicb_client_togglefloating;
|
||||
|
|
Loading…
Reference in New Issue