mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Allow packing order to be set using theme.
This commit is contained in:
parent
8bbf1b36d5
commit
44581fd90b
4 changed files with 7 additions and 19 deletions
|
@ -46,10 +46,11 @@ typedef void ( *listview_mouse_activated_cb )( listview *, xcb_button_press_even
|
|||
* @param cb The update callback.
|
||||
* @param udata The user data to pass to the callback
|
||||
* @param eh The height of one element
|
||||
* @param reverse Reverse the listview order.
|
||||
*
|
||||
* @returns a new listview
|
||||
*/
|
||||
listview *listview_create ( const char *name, listview_update_callback cb, void *udata, unsigned int eh );
|
||||
listview *listview_create ( const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse );
|
||||
|
||||
/**
|
||||
* @param lv The listview handle
|
||||
|
@ -184,13 +185,6 @@ void listview_set_num_lines ( listview *lv, unsigned int num_lines );
|
|||
*/
|
||||
void listview_set_max_lines ( listview *lv, unsigned int max_lines );
|
||||
|
||||
/**
|
||||
* @param lv Handler to the listview object.
|
||||
* @param reverse Reverse the listview order.
|
||||
*
|
||||
* Set reversing the listview.
|
||||
*/
|
||||
void listview_reverse ( listview *lv, gboolean reverse );
|
||||
/* @} */
|
||||
|
||||
#endif // ROFI_LISTVIEW_H
|
||||
|
|
|
@ -1505,10 +1505,7 @@ RofiViewState *rofi_view_create ( Mode *sw,
|
|||
state->overlay = textbox_create ( "overlay.textbox", TB_AUTOWIDTH|TB_AUTOHEIGHT, URGENT, "blaat" );
|
||||
widget_disable ( WIDGET ( state->overlay ) );
|
||||
|
||||
state->list_view = listview_create ( "listview", update_callback, state, config.element_height );
|
||||
if ( end ){
|
||||
listview_reverse ( state->list_view, TRUE );
|
||||
}
|
||||
state->list_view = listview_create ( "listview", update_callback, state, config.element_height, end );
|
||||
// Set configuration
|
||||
listview_set_multi_select ( state->list_view, ( state->menu_flags & MENU_INDICATOR ) == MENU_INDICATOR );
|
||||
listview_set_scroll_type ( state->list_view, config.scroll_method );
|
||||
|
|
|
@ -282,8 +282,8 @@ void box_add ( box *box, widget *child, gboolean expand, gboolean end )
|
|||
height = MAX (height, child->h+widget_padding_get_padding_height ( WIDGET ( box )));
|
||||
box->widget.h = height;
|
||||
}
|
||||
child->expand = expand;
|
||||
child->end = end;
|
||||
child->expand = rofi_theme_get_boolean ( child->class_name, child->name, child->state, "expand", expand);
|
||||
child->end = rofi_theme_get_boolean ( child->class_name, child->name, child->state, "end", end);
|
||||
child->parent = WIDGET ( box );
|
||||
box->children = g_list_append ( box->children, (void *) child );
|
||||
widget_update ( WIDGET ( box ) );
|
||||
|
|
|
@ -336,7 +336,7 @@ static gboolean listview_motion_notify ( widget *wid, xcb_motion_notify_event_t
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
listview *listview_create ( const char *name, listview_update_callback cb, void *udata, unsigned int eh )
|
||||
listview *listview_create ( const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse )
|
||||
{
|
||||
listview *lv = g_malloc0 ( sizeof ( listview ) );
|
||||
|
||||
|
@ -371,6 +371,7 @@ listview *listview_create ( const char *name, listview_update_callback cb, void
|
|||
lv->fixed_num_lines = rofi_theme_get_boolean (lv->widget.class_name, lv->widget.name, NULL, "fixed-height", config.fixed_num_lines );
|
||||
lv->dynamic = rofi_theme_get_boolean (lv->widget.class_name, lv->widget.name, NULL, "dynamic", TRUE );
|
||||
|
||||
lv->reverse = rofi_theme_get_boolean (lv->widget.class_name, lv->widget.name, NULL, "reverse", reverse );
|
||||
listview_set_show_scrollbar ( lv, rofi_theme_get_boolean ( lv->widget.class_name, lv->widget.name, NULL, "scrollbar", !config.hide_scrollbar ));
|
||||
listview_set_scrollbar_width ( lv, rofi_theme_get_integer ( lv->widget.class_name, lv->widget.name, NULL, "scrollbar-width", config.scrollbar_width ));
|
||||
lv->cycle = rofi_theme_get_boolean ( lv->widget.class_name, lv->widget.name, NULL, "cycle", config.cycle );
|
||||
|
@ -580,7 +581,3 @@ void listview_set_max_lines ( listview *lv, unsigned int max_lines )
|
|||
lv->max_displayed_lines = max_lines;
|
||||
}
|
||||
}
|
||||
void listview_reverse ( listview *lv, gboolean reverse )
|
||||
{
|
||||
lv->reverse = reverse;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue