fix some bugs with padding
This commit is contained in:
parent
1d4dd4ccfa
commit
14075e00a3
|
@ -46,8 +46,7 @@ spmenu.col_sgrcolor14: #00ffff
|
|||
spmenu.col_sgrcolor15: #ffffff
|
||||
spmenu.alpha: 1
|
||||
spmenu.accuratewidth: 1
|
||||
spmenu.bordercentered: 1
|
||||
spmenu.borderwidth: 2
|
||||
spmenu.borderwidth: 0
|
||||
spmenu.lineheight: 5
|
||||
spmenu.lines: 0
|
||||
spmenu.columns: 10
|
||||
|
|
|
@ -152,7 +152,6 @@ readargs(int argc, char *argv[])
|
|||
} else if (!strcmp(argv[i], "-m")) /* monitor */
|
||||
mon = atoi(argv[++i]);
|
||||
else if (!strcmp(argv[i], "-bw")) { /* border width */
|
||||
bordercentered = 0;
|
||||
borderwidth = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-H")) /* hist file location */
|
||||
histfile = argv[++i];
|
||||
|
|
|
@ -15,22 +15,11 @@ create_window(int x, int y, int w, int h)
|
|||
swa.colormap = cmap;
|
||||
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask | ButtonPressMask | PointerMotionMask;
|
||||
|
||||
if (!bordercentered) {
|
||||
win = XCreateWindow(dpy, parentwin, x, y, w, h, borderwidth,
|
||||
depth, InputOutput, visual,
|
||||
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &swa);
|
||||
} else {
|
||||
if (!centered) {
|
||||
win = XCreateWindow(dpy, parentwin, x, y, w, h, 0,
|
||||
depth, InputOutput, visual,
|
||||
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &swa);
|
||||
} else {
|
||||
win = XCreateWindow(dpy, parentwin, x, y, w, h, borderwidth,
|
||||
depth, InputOutput, visual,
|
||||
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &swa);
|
||||
}
|
||||
// create client
|
||||
win = XCreateWindow(dpy, parentwin, x, y, w, h, borderwidth,
|
||||
depth, InputOutput, visual,
|
||||
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &swa);
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -204,6 +204,14 @@ drawmenu(void)
|
|||
if (!hidematchcount) {
|
||||
recalculatenumbers();
|
||||
numberWidth = TEXTW(numbers);
|
||||
|
||||
// mode indicator is always going to be at the right
|
||||
if (hidemode) {
|
||||
numberWidth += 2 * sp + borderwidth;
|
||||
} else {
|
||||
modeWidth += 2 * sp + borderwidth;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// draw items and image
|
||||
|
|
|
@ -112,7 +112,6 @@ ResourcePref resources[] = {
|
|||
{ "rightarrow", STRING, &rightarrow },
|
||||
{ "normtext", STRING, &normtext },
|
||||
{ "instext", STRING, &instext },
|
||||
{ "bordercentered", INTEGER, &bordercentered },
|
||||
{ "borderwidth", INTEGER, &borderwidth },
|
||||
{ "lines", INTEGER, &lines },
|
||||
{ "lineheight", INTEGER, &lineheight },
|
||||
|
|
|
@ -30,8 +30,7 @@ static char normtext[] = "Normal"; /* Text to display for normal
|
|||
static char instext[] = "Insert"; /* Text to display for insert mode */
|
||||
|
||||
/* Window border options */
|
||||
static int borderwidth = 2; /* Width of the border */
|
||||
static int bordercentered = 1; /* Draw border only when centered */
|
||||
static int borderwidth = 0; /* Width of the border */
|
||||
|
||||
/* Font options */
|
||||
static char *font[] = {
|
||||
|
|
Loading…
Reference in a new issue