From 52c5592a6f6d55897a03bb9691031c3cf8c71b46 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 4 May 2019 11:01:09 +0200 Subject: [ListView|Textbox] Add user-settable ellipsize mode. Fixes: #917 --- include/keyb.h | 1 + include/widgets/listview.h | 6 ++++++ include/widgets/textbox.h | 9 +++++++++ 3 files changed, 16 insertions(+) (limited to 'include') diff --git a/include/keyb.h b/include/keyb.h index fef1ad52..bc8628b9 100644 --- a/include/keyb.h +++ b/include/keyb.h @@ -126,6 +126,7 @@ typedef enum CUSTOM_18, CUSTOM_19, SCREENSHOT, + CHANGE_ELLIPSIZE, TOGGLE_SORT, SELECT_ELEMENT_1, SELECT_ELEMENT_2, diff --git a/include/widgets/listview.h b/include/widgets/listview.h index abb9b02e..ec5861e1 100644 --- a/include/widgets/listview.h +++ b/include/widgets/listview.h @@ -238,6 +238,12 @@ void listview_set_fixed_num_lines ( listview *lv ); */ void listview_set_max_lines ( listview *lv, unsigned int max_lines ); +/** + * @param lv Handler to the listview object. + * + * Set ellipsize modee. + */ +void listview_toggle_ellipsizing ( listview *lv ); /* @} */ #endif // ROFI_LISTVIEW_H diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h index 550fc3fc..6d666ff0 100644 --- a/include/widgets/textbox.h +++ b/include/widgets/textbox.h @@ -68,6 +68,7 @@ typedef struct double xalign; PangoFontMetrics *metrics; + PangoEllipsizeMode emode; int left_offset; // const char *theme_name; @@ -334,5 +335,13 @@ int textbox_get_desired_width ( widget *wid ); * Move the cursor to the end of the string. */ void textbox_cursor_end ( textbox *tb ); + +/** + * @param tb Handle to the textbox + * @param mode The PangoEllipsizeMode to use displaying the text in the textbox + * + * Set the ellipsizing mode used on the string. + */ +void textbox_set_ellipsize ( textbox *tb, PangoEllipsizeMode mode ); /*@}*/ #endif //ROFI_TEXTBOX_H -- cgit v1.2.3