diff --git a/widget.c b/widget.c index 32771a14..b5c4d318 100644 --- a/widget.c +++ b/widget.c @@ -261,15 +261,6 @@ widget_render(widget_node_array_t *widgets, draw_context_t *ctx, xcb_gcontext_t } } -/** Common function for creating a widget. - * \param widget The allocated widget. - */ -void -widget_common_new(widget_t *widget) -{ - widget->align_supported = AlignLeft | AlignRight; -} - /** Invalidate widgets which should be refresh depending on their types. * \param screen Virtual screen number. * \param type Widget type to invalidate. @@ -354,6 +345,8 @@ luaA_widget_new(lua_State *L) w->type = wc; + w->align_supported |= AlignLeft | AlignRight; + /* Set visible by default. */ w->isvisible = true; diff --git a/widget.h b/widget.h index 34cfda4d..73f79e55 100644 --- a/widget.h +++ b/widget.h @@ -37,7 +37,6 @@ void widget_delete(widget_t **); DO_RCNT(widget_t, widget, widget_delete) int widget_calculate_offset(int, int, int, int); -void widget_common_new(widget_t *); void widget_render(widget_node_array_t *, draw_context_t *, xcb_gcontext_t, xcb_drawable_t, int, orientation_t, int, int, wibox_t *); int luaA_widget_userdata_new(lua_State *, widget_t *); diff --git a/widgets/graph.c b/widgets/graph.c index d0cbc5c0..731db5e3 100644 --- a/widgets/graph.c +++ b/widgets/graph.c @@ -588,7 +588,6 @@ graph_new(alignment_t align) graph_data_t *d; w = p_new(widget_t, 1); - widget_common_new(w); w->draw = graph_draw; w->index = luaA_graph_index; diff --git a/widgets/imagebox.c b/widgets/imagebox.c index 046d4dfe..518ccae3 100644 --- a/widgets/imagebox.c +++ b/widgets/imagebox.c @@ -218,7 +218,6 @@ imagebox_new(alignment_t align) { widget_t *w = p_new(widget_t, 1); imagebox_data_t *d; - widget_common_new(w); w->align = align; w->draw = imagebox_draw; w->index = luaA_imagebox_index; diff --git a/widgets/progressbar.c b/widgets/progressbar.c index 3a5546f6..c6adb7fb 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -646,7 +646,6 @@ progressbar_new(alignment_t align) progressbar_data_t *d; w = p_new(widget_t, 1); - widget_common_new(w); w->align = align; w->draw = progressbar_draw; w->index = luaA_progressbar_index; diff --git a/widgets/systray.c b/widgets/systray.c index ef12ff71..7383bf02 100644 --- a/widgets/systray.c +++ b/widgets/systray.c @@ -80,7 +80,6 @@ systray_new(alignment_t align) widget_t *w; w = p_new(widget_t, 1); - widget_common_new(w); w->align = align; w->draw = systray_draw; w->geometry = systray_geometry; diff --git a/widgets/textbox.c b/widgets/textbox.c index 43b4f1cc..28a494a8 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -241,7 +241,6 @@ textbox_new(alignment_t align) textbox_data_t *d; w = p_new(widget_t, 1); - widget_common_new(w); w->align = align; w->align_supported |= AlignFlex; w->draw = textbox_draw;