1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-03-03 16:05:20 -05:00

Set ellipsizing in the middle for edit boxes.

This commit is contained in:
QC 2014-08-02 20:25:43 +02:00
parent 6a45a18a4e
commit 7bebd1d7dd

View file

@ -178,7 +178,11 @@ void textbox_moveresize ( textbox *tb, int x, int y, int w, int h )
} }
else { else {
// set ellipsize // set ellipsize
pango_layout_set_ellipsize ( tb->layout, PANGO_ELLIPSIZE_END ); if( (tb->flags & TB_EDITABLE) == TB_EDITABLE ) {
pango_layout_set_ellipsize ( tb->layout, PANGO_ELLIPSIZE_MIDDLE );
}else{
pango_layout_set_ellipsize ( tb->layout, PANGO_ELLIPSIZE_END );
}
} }
if ( x != tb->x || y != tb->y || w != tb->w || h != tb->h ) { if ( x != tb->x || y != tb->y || w != tb->w || h != tb->h ) {
@ -263,9 +267,7 @@ void textbox_draw ( textbox *tb )
x = ( tb->w - line_width ) / 2; x = ( tb->w - line_width ) / 2;
} }
// draw the text. // Render the layout.
// XftDrawStringUtf8 ( draw, &tb->color_fg, tb->font, x, y, ( unsigned char * ) text, length );
pango_xft_render_layout ( draw, &( tb->color_fg ), tb->layout, x, y ); pango_xft_render_layout ( draw, &( tb->color_fg ), tb->layout, x, y );
// draw the cursor // draw the cursor