summaryrefslogtreecommitdiffstats
path: root/source/textbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/textbox.c')
-rw-r--r--source/textbox.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/source/textbox.c b/source/textbox.c
index 806b71a9..07a39260 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -35,7 +35,6 @@
#include <X11/Xft/Xft.h>
#include <ctype.h>
-
#include "rofi.h"
#include "textbox.h"
#include "keyb.h"
@@ -51,7 +50,6 @@ extern Display *display;
XVisualInfo *visual_info;
Colormap target_colormap;
-
typedef struct _RowColor
{
XftColor fg;
@@ -62,20 +60,13 @@ typedef struct _RowColor
} RowColor;
#define num_states 3
-RowColor colors[num_states];
-
+RowColor colors[num_states];
PangoContext *p_context = NULL;
-
// Xft text box, optionally editable
-textbox* textbox_create ( Window parent,
- XVisualInfo *vinfo,
- Colormap map,
- TextboxFlags flags,
- short x, short y, short w, short h,
- TextBoxFontType tbft,
- const char *text )
+textbox* textbox_create ( Window parent, XVisualInfo *vinfo, Colormap map, TextboxFlags flags, short x, short y, short w, short h,
+ TextBoxFontType tbft, const char *text )
{
textbox *tb = g_malloc0 ( sizeof ( textbox ) );
@@ -133,8 +124,6 @@ textbox* textbox_create ( Window parent,
// auto height/width modes get handled here
textbox_moveresize ( tb, tb->x, tb->y, tb->w, tb->h );
-
-
// edit mode controls
if ( tb->flags & TB_EDITABLE ) {
tb->xim = XOpenIM ( display, NULL, NULL, NULL );
@@ -194,7 +183,6 @@ void textbox_text ( textbox *tb, const char *text )
textbox_moveresize ( tb, tb->x, tb->y, tb->w, tb->h );
}
-
tb->cursor = MAX ( 0, MIN ( ( int ) strlen ( text ), tb->cursor ) );
}
// set the default text to display
@@ -220,7 +208,6 @@ void textbox_text_markup ( textbox *tb, const char *text )
textbox_moveresize ( tb, tb->x, tb->y, tb->w, tb->h );
}
-
tb->cursor = MAX ( 0, MIN ( ( int ) strlen ( text ), tb->cursor ) );
}
@@ -281,7 +268,6 @@ void textbox_hide ( textbox *tb )
XUnmapWindow ( display, tb->window );
}
-
// will also unmap the window if still displayed
void textbox_free ( textbox *tb )
{
@@ -337,9 +323,6 @@ void textbox_draw ( textbox *tb )
cursor_x = pos.x / PANGO_SCALE;
}
-// pango_layout_set_width ( tb->layout, PANGO_SCALE * ( tb->w - 2 * SIDE_MARGIN ) );
-
-
// Skip the side MARGIN on the X axis.
int x = PANGO_SCALE * SIDE_MARGIN;
int y = 0;
@@ -576,7 +559,6 @@ int textbox_keypress ( textbox *tb, XEvent *ev )
return 0;
}
-
if ( !( tb->flags & TB_EDITABLE ) ) {
return 0;
}
@@ -656,8 +638,6 @@ int textbox_keypress ( textbox *tb, XEvent *ev )
return 0;
}
-
-
/***
* Font setup.
*/