Allow xoffset, fix bottom/right edge.

This commit is contained in:
QC 2014-05-15 21:55:23 +02:00
parent 82bdb5f348
commit 3ebd0d9001
4 changed files with 9 additions and 5 deletions

View File

@ -68,5 +68,6 @@ Settings config = {
// Padding of the window.
.padding = 5,
.show_title = 1,
.y_offset = 0
.y_offset = 0,
.x_offset = 0
};

View File

@ -102,6 +102,7 @@ typedef struct _Settings
WindowMode wmode;
unsigned int padding;
int y_offset;
int x_offset;
unsigned int show_title;

View File

@ -1206,18 +1206,18 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
y = mon.y;
case WL_EAST:
x = mon.x + mon.w - w;
x = mon.x + mon.w - w-config.menu_bw*2;
break;
case WL_EAST_SOUTH:
x = mon.x + mon.w - w;
x = mon.x + mon.w - w-config.menu_bw*2;
case WL_SOUTH:
y = mon.y + mon.h - h;
y = mon.y + mon.h - h-config.menu_bw*2;
break;
case WL_SOUTH_WEST:
y = mon.y + mon.h - h;
y = mon.y + mon.h - h-config.menu_bw*2;
case WL_WEST:
x = mon.x;
@ -1229,6 +1229,7 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
}
// Apply offset.
y+= config.y_offset;
x+= config.x_offset;
XMoveResizeWindow ( display, box, x, y, w, h );

View File

@ -65,6 +65,7 @@ XrmOption xrmOptions[] = {
{ xrm_String, "terminal", { .str = &config.terminal_emulator } },
{ xrm_Number, "location", { .num = &config.location } },
{ xrm_Number, "yoffset", { .num = &config.y_offset } },
{ xrm_Number, "xoffset", { .num = &config.x_offset } },
};