Fix mouse in the search bar

This commit is contained in:
Přemysl Eric Janouch 2016-09-28 05:27:22 +02:00
parent 30345ec8d4
commit 1f60d096ea
Signed by: p
GPG Key ID: B715679E3A361BE6

View File

@ -1671,12 +1671,13 @@ app_process_left_mouse_click (Application *self, int line, int column)
; // At the moment there's nothing useful for us to do
else if (line == 1)
{
// FIXME: this is only an approximation
gsize label_len = g_utf8_strlen (self->search_label, -1);
gint pos = column - label_len;
if (pos >= 0)
{
self->input_pos = MIN ((guint) pos, self->input->len);
move (0, label_len + self->input_pos);
move (1, label_len + self->input_pos);
refresh ();
}
}