[gnome-shell/wip/carlosg/reuse-paint-volumes: 22/24] st: Clip StEntry to allocation



commit 86a520b880808ad18d397ab8e7a7a05b1a8b4e4c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 15 14:23:21 2018 +0200

    st: Clip StEntry to allocation
    
    The default get_paint_volume() implementation will do the union
    of children, and the child ClutterText paint volume may expand
    beyond StEntry size when text overflows.
    
    We actually want all content to be clipped to the StEntry, so
    implement get_paint_volume() and tell it so.

 src/st/st-entry.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index e1a23ca29..c7e946d90 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -905,6 +905,13 @@ st_entry_unmap (ClutterActor *actor)
   CLUTTER_ACTOR_CLASS (st_entry_parent_class)->unmap (actor);
 }
 
+static gboolean
+st_entry_get_paint_volume (ClutterActor       *actor,
+                           ClutterPaintVolume *volume)
+{
+  return clutter_paint_volume_set_from_allocation (volume, actor);
+}
+
 static void
 st_entry_class_init (StEntryClass *klass)
 {
@@ -922,6 +929,7 @@ st_entry_class_init (StEntryClass *klass)
   actor_class->allocate = st_entry_allocate;
   actor_class->paint = st_entry_paint;
   actor_class->unmap = st_entry_unmap;
+  actor_class->get_paint_volume = st_entry_get_paint_volume;
 
   actor_class->key_press_event = st_entry_key_press_event;
   actor_class->key_focus_in = st_entry_key_focus_in;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]