mirror of
https://github.com/brl/mutter.git
synced 2025-02-09 18:04:09 +00:00
text: Notify :position when it changes
The :position property is not notified when changed. http://bugzilla.openedhand.com/show_bug.cgi?id=1830
This commit is contained in:
parent
bc424fb56c
commit
2ff31dfbaa
@ -671,6 +671,7 @@ clutter_text_delete_selection (ClutterText *self)
|
|||||||
ClutterTextPrivate *priv;
|
ClutterTextPrivate *priv;
|
||||||
gint start_index;
|
gint start_index;
|
||||||
gint end_index;
|
gint end_index;
|
||||||
|
gint old_position, old_selection;
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE);
|
g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE);
|
||||||
|
|
||||||
@ -692,11 +693,20 @@ clutter_text_delete_selection (ClutterText *self)
|
|||||||
end_index = temp;
|
end_index = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
old_position = priv->position;
|
||||||
|
old_selection = priv->selection_bound;
|
||||||
|
|
||||||
clutter_text_delete_text (self, start_index, end_index);
|
clutter_text_delete_text (self, start_index, end_index);
|
||||||
|
|
||||||
priv->position = start_index;
|
priv->position = start_index;
|
||||||
priv->selection_bound = start_index;
|
priv->selection_bound = start_index;
|
||||||
|
|
||||||
|
if (priv->position != old_position)
|
||||||
|
g_object_notify (G_OBJECT (self), "position");
|
||||||
|
|
||||||
|
if (priv->selection_bound != old_selection)
|
||||||
|
g_object_notify (G_OBJECT (self), "selection-bound");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3964,6 +3974,9 @@ clutter_text_set_cursor_position (ClutterText *self,
|
|||||||
|
|
||||||
priv = self->priv;
|
priv = self->priv;
|
||||||
|
|
||||||
|
if (priv->position == position)
|
||||||
|
return;
|
||||||
|
|
||||||
len = priv->n_chars;
|
len = priv->n_chars;
|
||||||
|
|
||||||
if (position < 0 || position >= len)
|
if (position < 0 || position >= len)
|
||||||
@ -3977,6 +3990,8 @@ clutter_text_set_cursor_position (ClutterText *self,
|
|||||||
|
|
||||||
if (CLUTTER_ACTOR_IS_VISIBLE (self))
|
if (CLUTTER_ACTOR_IS_VISIBLE (self))
|
||||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
|
clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
|
||||||
|
|
||||||
|
g_object_notify (G_OBJECT (self), "position");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user