summaryrefslogtreecommitdiffstats
path: root/source/x11-helper.c
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-04-06 17:13:26 +0200
committerQC <qball@gmpclient.org>2015-04-06 17:13:26 +0200
commit2590ecf7e5729acf0394d2d3d8e4269f430c7754 (patch)
tree58f03b0104f66ee4cf8c1775450044204db09f62 /source/x11-helper.c
parent95fd6402f3714595ca42af83a4e87a7f24e2b95f (diff)
ADd new coloring scheme.
Diffstat (limited to 'source/x11-helper.c')
-rw-r--r--source/x11-helper.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/source/x11-helper.c b/source/x11-helper.c
index 6ad19af5..7c4435ed 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -43,6 +43,7 @@
#include <X11/XKBlib.h>
#include <X11/extensions/Xinerama.h>
+#include <rofi.h>
#define OVERLAP( a, b, c, d ) ( ( ( a ) == ( c ) && ( b ) == ( d ) ) || MIN ( ( a ) + ( b ), ( c ) + ( d ) ) - MAX ( ( a ), ( c ) ) > 0 )
#define INTERSECT( x, y, w, h, x1, y1, w1, h1 ) ( OVERLAP ( ( x ), ( w ), ( x1 ), ( w1 ) ) && OVERLAP ( ( y ), ( h ), ( y1 ), ( h1 ) ) )
#include "x11-helper.h"
@@ -424,7 +425,6 @@ void create_visual_and_colormap ( Display *display )
map = DefaultColormap ( display, screen );
}
}
-
unsigned int color_get ( Display *display, const char *const name )
{
XColor color = { 0, 0, 0, 0, 0, 0 };
@@ -444,3 +444,33 @@ unsigned int color_get ( Display *display, const char *const name )
return XAllocNamedColor ( display, map, name, &color, &color ) ? color.pixel : None;
}
}
+
+unsigned int color_background ( Display *display )
+{
+ if ( config.menu_bg ) {
+ return color_get ( display, config.menu_bg );
+ }
+ unsigned int retv = 0;
+
+ gchar **vals = g_strsplit ( config.color_window, ",", 2 );
+ if ( vals != NULL && vals[0] != NULL ) {
+ retv = color_get ( display, vals[0] );
+ }
+ g_strfreev ( vals );
+ return retv;
+}
+
+unsigned int color_border ( Display *display )
+{
+ if ( config.menu_bc ) {
+ return color_get ( display, config.menu_bc );
+ }
+ unsigned int retv = 0;
+
+ gchar **vals = g_strsplit ( config.color_window, ",", 2 );
+ if ( vals != NULL && vals[0] != NULL && vals[1] != NULL ) {
+ retv = color_get ( display, vals[1] );
+ }
+ g_strfreev ( vals );
+ return retv;
+}