summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQball Cow <qball@gmpclient.nl>2014-05-15 16:54:35 +0200
committerQball Cow <qball@gmpclient.nl>2014-05-15 16:54:35 +0200
commit82bdb5f348688c7427a77fcfaed91881b2e2d84a (patch)
tree8f6171071eff142e39efd12d09c71735b334bd39
parent1b9d4fb3250df87379a35519b97ffa62e04aa53a (diff)
Add a y-offset.
-rw-r--r--config/config.c3
-rw-r--r--include/rofi.h2
-rw-r--r--source/rofi.c2
-rw-r--r--source/xrmoptions.c3
4 files changed, 8 insertions, 2 deletions
diff --git a/config/config.c b/config/config.c
index 7b282256..14e13ee4 100644
--- a/config/config.c
+++ b/config/config.c
@@ -67,5 +67,6 @@ Settings config = {
.wmode = VERTICAL,
// Padding of the window.
.padding = 5,
- .show_title = 1
+ .show_title = 1,
+ .y_offset = 0
};
diff --git a/include/rofi.h b/include/rofi.h
index 9b0c4b52..cb586620 100644
--- a/include/rofi.h
+++ b/include/rofi.h
@@ -101,8 +101,10 @@ typedef struct _Settings
WindowLocation location;
WindowMode wmode;
unsigned int padding;
+ int y_offset;
unsigned int show_title;
+
} Settings;
extern Settings config;
diff --git a/source/rofi.c b/source/rofi.c
index 3fcfb837..ca9f3105 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -1227,6 +1227,8 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
default:
break;
}
+ // Apply offset.
+ y+= config.y_offset;
XMoveResizeWindow ( display, box, x, y, w, h );
diff --git a/source/xrmoptions.c b/source/xrmoptions.c
index 0ddde0f2..f6f3d50f 100644
--- a/source/xrmoptions.c
+++ b/source/xrmoptions.c
@@ -63,7 +63,8 @@ XrmOption xrmOptions[] = {
{ xrm_Number, "padding", { .num = &config.padding } },
{ xrm_Number, "borderwidth", { .num = &config.menu_bw } },
{ xrm_String, "terminal", { .str = &config.terminal_emulator } },
- { xrm_Number, "location", { .num = &config.location} },
+ { xrm_Number, "location", { .num = &config.location } },
+ { xrm_Number, "yoffset", { .num = &config.y_offset } },
};