Add setlineheight function
This commit is contained in:
parent
f2776a39aa
commit
0988babd15
|
@ -1015,6 +1015,8 @@ bind:
|
|||
- Set lines to passed argument
|
||||
- `setcolumns`
|
||||
- Set columns to passed argument
|
||||
- `setlineheight`
|
||||
- Set line height to passed argument
|
||||
- `setprofile`
|
||||
- Open profile menu if available
|
||||
- `switchmode`
|
||||
|
|
|
@ -395,6 +395,12 @@ out:
|
|||
free(history);
|
||||
}
|
||||
|
||||
void setlineheight(Arg *arg) {
|
||||
lineheight += arg->i;
|
||||
sp.bh = MAX(draw->font->h, draw->font->h + 2 + lineheight);
|
||||
resizeclient();
|
||||
}
|
||||
|
||||
void setimgsize(Arg *arg) {
|
||||
#if USEIMAGE
|
||||
setimagesize(img.imagewidth + arg->i, img.imageheight + arg->i);
|
||||
|
|
|
@ -56,6 +56,7 @@ static void spawn(Arg *arg);
|
|||
static void screenshot(Arg *arg);
|
||||
static void switchmode(Arg *arg);
|
||||
static void setprofile(Arg *arg);
|
||||
static void setlineheight(Arg *arg);
|
||||
static void quit(Arg *arg);
|
||||
|
||||
/* toggle */
|
||||
|
|
|
@ -392,6 +392,7 @@ static FuncList fl[] = {
|
|||
{ "toggleregex", toggleregex },
|
||||
{ "toggleimg", toggleimg },
|
||||
{ "setprofile", setprofile },
|
||||
{ "setlineheight", setlineheight },
|
||||
{ "switchmode", switchmode },
|
||||
{ "spawn", spawn },
|
||||
};
|
||||
|
|
|
@ -540,7 +540,6 @@ void resizeclient_wl(struct state *state) {
|
|||
for (item = items; item && item->text; item++)
|
||||
ic++;
|
||||
|
||||
sp.bh = MAX(draw->font->h, draw->font->h + 2 + lineheight);
|
||||
lines = MIN(ic, MAX(lines, 0));
|
||||
#if USEIMAGE
|
||||
img.setlines = lines;
|
||||
|
|
|
@ -79,7 +79,6 @@ void resizeclient_x11(void) {
|
|||
for (item = items; item && item->text; item++)
|
||||
ic++;
|
||||
|
||||
sp.bh = MAX(draw->font->h, draw->font->h + 2 + lineheight);
|
||||
lines = MIN(ic, MAX(lines, 0));
|
||||
#if USEIMAGE
|
||||
img.setlines = lines;
|
||||
|
|
Loading…
Reference in a new issue