widget: remove common_new()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
e7abdd5cc0
commit
f556c04868
11
widget.c
11
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;
|
||||
|
||||
|
|
1
widget.h
1
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 *);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue