diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h index ec6f85f0..b330045b 100644 --- a/include/widgets/textbox.h +++ b/include/widgets/textbox.h @@ -313,5 +313,12 @@ PangoAttrList *textbox_get_pango_attributes ( textbox *tb ); */ const char *textbox_get_visible_text ( const textbox *tb ); int textbox_get_desired_width ( widget *wid ); + +/** + * @param tb Handle to the textbox + * + * Move the cursor to the end of the string. + */ +void textbox_cursor_end ( textbox *tb ); /*@}*/ #endif //ROFI_TEXTBOX_H diff --git a/source/view.c b/source/view.c index 9f3b3c59..476a3085 100644 --- a/source/view.c +++ b/source/view.c @@ -1696,6 +1696,7 @@ RofiViewState *rofi_view_create ( Mode *sw, if ( state->text && input ) { textbox_text ( state->text, input ); + textbox_cursor_end ( state->text ); } state->overlay = textbox_create ( WIDGET_TYPE_TEXTBOX_TEXT, "window.overlay", TB_AUTOWIDTH | TB_AUTOHEIGHT, URGENT, "blaat", 0.5, 0 ); diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 64d4fa5a..a2854ff3 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -49,13 +49,6 @@ static int textbox_get_width ( widget * ); static int _textbox_get_height ( widget * ); static void __textbox_update_pango_text ( textbox *tb ); -/** - * @param tb Handle to the textbox - * - * Move the cursor to the end of the string. - */ -static void textbox_cursor_end ( textbox *tb ); - /** Default pango context */ static PangoContext *p_context = NULL; /** The pango font metrics */ @@ -585,7 +578,7 @@ static void textbox_cursor_dec_word ( textbox *tb ) } // end of line -static void textbox_cursor_end ( textbox *tb ) +void textbox_cursor_end ( textbox *tb ) { if ( tb->text == NULL ) { tb->cursor = 0;