summaryrefslogtreecommitdiffstats
path: root/source/widgets/widget.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-12-27 22:19:15 +0100
committerDave Davenport <qball@gmpclient.org>2016-12-27 22:19:15 +0100
commit1c611b0eecff798c576771a72c58504579e581c8 (patch)
tree42d36af10625184a0e09b2556624a836fd77d04b /source/widgets/widget.c
parentc5439118a70a8c8370ff3730962752356b3dd466 (diff)
First start at adding 4 sided padding
Diffstat (limited to 'source/widgets/widget.c')
-rw-r--r--source/widgets/widget.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/widgets/widget.c b/source/widgets/widget.c
index 93c14cff..04f52008 100644
--- a/source/widgets/widget.c
+++ b/source/widgets/widget.c
@@ -1,6 +1,16 @@
#include <glib.h>
#include "widgets/widget.h"
#include "widgets/widget-internal.h"
+#include "theme.h"
+
+
+void widget_init ( widget *widget , const char *name, const char *class_name )
+{
+ widget->name = g_strdup(name);
+ widget->class_name = g_strdup(class_name);
+ widget->pad = rofi_theme_get_padding (widget->class_name, widget->name, NULL, "padding", (Padding){0,0,0,0,FALSE});
+
+}
int widget_intersect ( const widget *widget, int x, int y )
{
@@ -72,6 +82,9 @@ void widget_free ( widget *wid )
if ( wid->name ) {
g_free ( wid->name );
}
+ if ( wid->class_name ) {
+ g_free( wid->class_name );
+ }
if ( wid->free ) {
wid->free ( wid );
}