Go to the documentation of this file.
39 #define DEFAULT_SPACING 2
130 g_free ( lv->
boxes );
178 unsigned int offset = 0;
209 unsigned int offset = 0;
227 for (
unsigned int i = 0; i < max && width > 0; i++ ) {
230 if ( twidth >= width ) {
239 width -= twidth + spacing_hori;
240 left_offset += twidth + spacing_hori;
246 for (
unsigned int i = 0; i < lv->
cur_elements && width > 0 && i <= offset; i++ ) {
249 if ( twidth >= width ) {
255 right_offset -= twidth;
259 width -= twidth + spacing_hori;
260 right_offset -= spacing_hori;
267 void * temp = lv->
boxes[i];
270 lv->
boxes[sw] = temp;
286 unsigned int offset = 0;
321 width -= spacing_hori;
324 unsigned int element_width = ( width ) / lv->
cur_columns;
325 for (
unsigned int i = 0; i < max; i++ ) {
326 unsigned int ex = left_offset + ( ( i ) / lv->
max_rows ) * ( element_width + spacing_hori );
342 for (
unsigned int i = 0; i < max; i++ ) {
364 unsigned int newne = 0;
376 for (
unsigned int i = newne; i < lv->
cur_elements; i++ ) {
381 for (
unsigned int i = lv->
cur_elements; i < newne; i++ ) {
463 for ( i = 0; i < max && target == NULL; i++ ) {
501 for ( i = 0; i < max &&
WIDGET ( lv->
boxes[i] ) != wid; i++ ) {
507 gboolean custom = FALSE;
537 lv->
emode = PANGO_ELLIPSIZE_END;
840 PangoEllipsizeMode mode = lv->
emode;
841 if ( mode == PANGO_ELLIPSIZE_START ) {
842 mode = PANGO_ELLIPSIZE_MIDDLE;
843 }
else if ( mode == PANGO_ELLIPSIZE_MIDDLE ) {
844 mode = PANGO_ELLIPSIZE_END;
845 }
else if ( mode == PANGO_ELLIPSIZE_END ) {
846 mode = PANGO_ELLIPSIZE_START;
static void listview_nav_up_int(listview *lv)
void listview_toggle_ellipsizing(listview *lv)
unsigned int cur_elements
int textbox_get_desired_width(widget *wid)
void listview_nav_up(listview *lv)
@ LISTVIEW_SCROLL_CONTINIOUS
void listview_nav_page_prev(listview *lv)
void(* listview_update_callback)(textbox *tb, unsigned int entry, void *udata, TextBoxFontType type, gboolean full)
void listview_set_num_elements(listview *lv, unsigned int rows)
static void listview_nav_down_int(listview *lv)
static unsigned int scroll_continious(listview *lv)
listview * listview_create(widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
listview_update_callback callback
@ ROFI_ORIENTATION_VERTICAL
static WidgetTriggerActionResult listview_trigger_action(widget *wid, MouseBindingListviewAction action, G_GNUC_UNUSED gint x, G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data)
void listview_set_scroll_type(listview *lv, ScrollType type)
static widget * listview_find_mouse_target(widget *wid, WidgetType type, gint x, gint y)
int distance_get_pixel(RofiDistance d, RofiOrientation ori)
unsigned int listview_get_num_lines(listview *lv)
RofiDistance rofi_theme_get_distance(const widget *widget, const char *property, int def)
static void update_element(listview *lv, unsigned int tb, unsigned int index, gboolean full)
int rofi_theme_get_boolean(const widget *widget, const char *property, int def)
unsigned int max_elements
int rofi_theme_get_integer(const widget *widget, const char *property, int def)
void listview_set_show_scrollbar(listview *lv, gboolean enabled)
static void listview_nav_page_prev_int(listview *lv)
static void listview_recompute_elements(listview *lv)
void listview_set_mouse_activated_cb(listview *lv, listview_mouse_activated_cb cb, void *udata)
RofiOrientation rofi_theme_get_orientation(const widget *widget, const char *property, RofiOrientation def)
xcb_timestamp_t last_click
static void listview_nav_page_next_int(listview *lv)
void listview_nav_right(listview *lv)
void listview_set_num_lines(listview *lv, unsigned int num_lines)
static void _listview_draw(widget *wid, cairo_t *draw)
unsigned int listview_get_selected(listview *lv)
static void barview_draw(widget *wid, cairo_t *draw)
static unsigned int scroll_per_page_barview(listview *lv)
static int listview_get_desired_height(widget *wid)
unsigned int fixed_num_lines
unsigned int element_height
void(* listview_mouse_activated_cb)(listview *, gboolean, void *)
unsigned int req_elements
static void listview_resize(widget *wid, short w, short h)
static void listview_free(widget *wid)
void textbox_set_ellipsize(textbox *tb, PangoEllipsizeMode mode)
listview_mouse_activated_cb mouse_activated
void listview_set_multi_select(listview *lv, gboolean enable)
void listview_nav_page_next(listview *lv)
MouseBindingListviewElementAction
void listview_set_fixed_num_lines(listview *lv)
unsigned int menu_columns
int textbox_get_estimated_height(const textbox *tb, int eh)
void listview_set_max_lines(listview *lv, unsigned int max_lines)
static unsigned int scroll_per_page(listview *lv)
void * mouse_activated_data
static void listview_draw(widget *wid, cairo_t *draw)
gboolean listview_get_fixed_num_lines(listview *lv)
void listview_nav_left(listview *lv)
struct _listview::@1 barview
unsigned int max_displayed_lines
void textbox_moveresize(textbox *tb, int x, int y, int w, int h)
unsigned int menu_columns
@ ROFI_ORIENTATION_HORIZONTAL
void listview_set_selected(listview *lv, unsigned int selected)
void listview_nav_down(listview *lv)
static WidgetTriggerActionResult listview_element_trigger_action(widget *wid, MouseBindingListviewElementAction action, gint x, gint y, void *user_data)
unsigned int fixed_num_lines
MouseBindingListviewAction
gboolean scrollbar_scroll
textbox * textbox_create(widget *parent, WidgetType type, const char *name, TextboxFlags flags, TextBoxFontType tbft, const char *text, double xalign, double yalign)