add -txp/--text-padding option
This commit is contained in:
parent
93ce81f05f
commit
dea326e173
|
@ -226,6 +226,9 @@ You may use long, descriptive arguments or the shorter arguments.
|
||||||
`-ig, --image-gaps gaps `
|
`-ig, --image-gaps gaps `
|
||||||
: Set image gaps to gaps
|
: Set image gaps to gaps
|
||||||
|
|
||||||
|
`-txp, --text-padding padding `
|
||||||
|
: Set text padding to padding
|
||||||
|
|
||||||
`-lp, --vertical-padding padding `
|
`-lp, --vertical-padding padding `
|
||||||
: Set the vertical padding
|
: Set the vertical padding
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
!! Fonts
|
!! Fonts
|
||||||
spmenu.font: Noto Sans Mono 8
|
spmenu.font: Noto Sans Mono 8
|
||||||
|
spmenu.textpadding: 0
|
||||||
|
|
||||||
!! Colors
|
!! Colors
|
||||||
spmenu.col_itemnormfg: #bbbbbb
|
spmenu.col_itemnormfg: #bbbbbb
|
||||||
|
|
|
@ -176,6 +176,8 @@ readargs(int argc, char *argv[])
|
||||||
if (columns == 0) columns = 1;
|
if (columns == 0) columns = 1;
|
||||||
} else if (!strcmp(argv[i], "-mw") || (!strcmp(argv[i], "--min-width"))) { // line height
|
} else if (!strcmp(argv[i], "-mw") || (!strcmp(argv[i], "--min-width"))) { // line height
|
||||||
minwidth = atoi(argv[++i]);
|
minwidth = atoi(argv[++i]);
|
||||||
|
} else if (!strcmp(argv[i], "-txp") || (!strcmp(argv[i], "--text-padding"))) { // text padding
|
||||||
|
textpadding = atoi(argv[++i]);
|
||||||
} else if (!strcmp(argv[i], "-lp") || (!strcmp(argv[i], "--vertical-padding"))) { // vertical padding
|
} else if (!strcmp(argv[i], "-lp") || (!strcmp(argv[i], "--vertical-padding"))) { // vertical padding
|
||||||
menupaddingv = atoi(argv[++i]);
|
menupaddingv = atoi(argv[++i]);
|
||||||
} else if (!strcmp(argv[i], "-hp") || (!strcmp(argv[i], "--horizontal-padding"))) { // horizontal padding
|
} else if (!strcmp(argv[i], "-hp") || (!strcmp(argv[i], "--horizontal-padding"))) { // horizontal padding
|
||||||
|
@ -416,6 +418,7 @@ usage(void)
|
||||||
"spmenu -w, --embed <window id> Embed spmenu inside <window id>\n"
|
"spmenu -w, --embed <window id> Embed spmenu inside <window id>\n"
|
||||||
"spmenu -H, --hist-file <hist file> Specify a path to save the history to\n"
|
"spmenu -H, --hist-file <hist file> Specify a path to save the history to\n"
|
||||||
"spmenu -ig, --image-gaps <gaps> Set image gaps to <gaps>\n"
|
"spmenu -ig, --image-gaps <gaps> Set image gaps to <gaps>\n"
|
||||||
|
"spmenu -txp, --text-padding <padding> Set text padding to <padding>\n"
|
||||||
"spmenu -lp, --vertical-padding <padding> Set the vertical padding\n"
|
"spmenu -lp, --vertical-padding <padding> Set the vertical padding\n"
|
||||||
"spmenu -hp, --horizontal-padding <padding> Set the horizontal padding\n"
|
"spmenu -hp, --horizontal-padding <padding> Set the horizontal padding\n"
|
||||||
"spmenu -la, --left-arrow-symbol <symbol> Set the left arrow to <symbol>\n"
|
"spmenu -la, --left-arrow-symbol <symbol> Set the left arrow to <symbol>\n"
|
||||||
|
|
|
@ -98,6 +98,7 @@ ResourcePref resources[] = {
|
||||||
{ "menuposition", INTEGER, &menuposition },
|
{ "menuposition", INTEGER, &menuposition },
|
||||||
{ "menupaddingv", INTEGER, &menupaddingv },
|
{ "menupaddingv", INTEGER, &menupaddingv },
|
||||||
{ "menupaddingh", INTEGER, &menupaddingh },
|
{ "menupaddingh", INTEGER, &menupaddingh },
|
||||||
|
{ "textpadding", INTEGER, &textpadding },
|
||||||
{ "indentitems", INTEGER, &indentitems },
|
{ "indentitems", INTEGER, &indentitems },
|
||||||
{ "accuratewidth", INTEGER, &accuratewidth },
|
{ "accuratewidth", INTEGER, &accuratewidth },
|
||||||
{ "alpha", INTEGER, &alpha },
|
{ "alpha", INTEGER, &alpha },
|
||||||
|
|
|
@ -36,6 +36,7 @@ static int borderwidth = 2; /* Width of the border */
|
||||||
|
|
||||||
/* Font options */
|
/* Font options */
|
||||||
static char font[] = "Noto Sans Mono 8"; /* Font to draw text and Pango markup with. */
|
static char font[] = "Noto Sans Mono 8"; /* Font to draw text and Pango markup with. */
|
||||||
|
static int textpadding = 0; /* Text padding (lrpad) */
|
||||||
|
|
||||||
/* Symbol options */
|
/* Symbol options */
|
||||||
static char *leftarrow = "<"; /* Left arrow, used to indicate you can move to the left */
|
static char *leftarrow = "<"; /* Left arrow, used to indicate you can move to the left */
|
||||||
|
|
3
spmenu.1
3
spmenu.1
|
@ -243,6 +243,9 @@ Specify a path to save the history to
|
||||||
\f[V]-ig, --image-gaps gaps\f[R]
|
\f[V]-ig, --image-gaps gaps\f[R]
|
||||||
Set image gaps to gaps
|
Set image gaps to gaps
|
||||||
.TP
|
.TP
|
||||||
|
\f[V]-txp, --text-padding padding\f[R]
|
||||||
|
Set text padding to padding
|
||||||
|
.TP
|
||||||
\f[V]-lp, --vertical-padding padding\f[R]
|
\f[V]-lp, --vertical-padding padding\f[R]
|
||||||
Set the vertical padding
|
Set the vertical padding
|
||||||
.TP
|
.TP
|
||||||
|
|
2
spmenu.c
2
spmenu.c
|
@ -739,7 +739,7 @@ main(int argc, char *argv[])
|
||||||
if (!drw_font_create(drw, fonts, LENGTH(fonts)))
|
if (!drw_font_create(drw, fonts, LENGTH(fonts)))
|
||||||
die("no fonts could be loaded.");
|
die("no fonts could be loaded.");
|
||||||
|
|
||||||
lrpad = drw->font->h;
|
lrpad = drw->font->h + textpadding;
|
||||||
prepare_window_size();
|
prepare_window_size();
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
|
|
Loading…
Reference in a new issue