css: Clipping changes don't need a queue_allocate() anymore

Now that queue_draw() isn't restricted to clip anymore, we don't need to
care about clip in the CSS engine either.

We do keep GTK_CSS_AFFECTS_CLIP around though because GtkWindow does
care for the window's size.
This commit is contained in:
Benjamin Otte 2018-04-09 20:19:17 +02:00
parent 78a9b5d1ed
commit 0afdd84a2a
6 changed files with 10 additions and 13 deletions

View File

@ -1173,7 +1173,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_TEXT_SHADOW,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_CLIP,
GTK_CSS_AFFECTS_TEXT_CONTENT,
shadow_value_parse,
NULL,
_gtk_css_shadows_value_new_none ());

View File

@ -103,7 +103,8 @@ typedef guint64 GtkCssChange;
* @GTK_CSS_AFFECTS_ICON_SIZE: Icon size is affected.
* @GTK_CSS_AFFECTS_TEXT_ATTRS: Text attributes are affected.
* @GTK_CSS_AFFECTS_TEXT_SIZE: Text size is affected.
* @GTK_CSS_AFFECTS_TEXT_CLIP: Text clipping is affected.
* @GTK_CSS_AFFECTS_TEXT_CONTENT: Text rendering is affected, but size or
* attributes are not.
* @GTK_CSS_AFFECTS_ICON: Fullcolor icons and their rendering is affected.
* @GTK_CSS_AFFECTS_SYMBOLIC_ICON: Symbolic icons and their rendering is affected.
* @GTK_CSS_AFFECTS_OUTLINE: The outline styling is affected. Outlines
@ -130,7 +131,7 @@ typedef enum {
GTK_CSS_AFFECTS_ICON_SIZE = (1 << 3),
GTK_CSS_AFFECTS_TEXT_ATTRS = (1 << 4),
GTK_CSS_AFFECTS_TEXT_SIZE = (1 << 5),
GTK_CSS_AFFECTS_TEXT_CLIP = (1 << 6),
GTK_CSS_AFFECTS_TEXT_CONTENT = (1 << 6),
GTK_CSS_AFFECTS_ICON = (1 << 7),
GTK_CSS_AFFECTS_SYMBOLIC_ICON = (1 << 8),
GTK_CSS_AFFECTS_OUTLINE = (1 << 9),
@ -148,7 +149,7 @@ typedef enum {
GTK_CSS_AFFECTS_POSTEFFECT)
#define GTK_CSS_AFFECTS_TEXT (GTK_CSS_AFFECTS_TEXT_SIZE | \
GTK_CSS_AFFECTS_TEXT_CLIP)
GTK_CSS_AFFECTS_TEXT_CONTENT)
enum { /*< skip >*/

View File

@ -260,7 +260,7 @@ node_style_changed_cb (GtkCssNode *node,
GtkCssStyleChange *change,
GtkWidget *widget)
{
if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP))
if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE))
gtk_widget_queue_resize (widget);
else
gtk_widget_queue_draw (widget);

View File

@ -8897,7 +8897,7 @@ node_style_changed_cb (GtkCssNode *node,
GtkCssStyleChange *change,
GtkWidget *widget)
{
if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP))
if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE))
gtk_widget_queue_resize (widget);
else
gtk_widget_queue_draw (widget);

View File

@ -8268,7 +8268,7 @@ gtk_tree_view_style_updated (GtkWidget *widget)
style_context = gtk_widget_get_style_context (widget);
change = gtk_style_context_get_change (style_context);
if (change == NULL || gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP))
if (change == NULL || gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE))
{
for (list = tree_view->priv->columns; list; list = list->next)
{

View File

@ -5771,12 +5771,8 @@ gtk_widget_real_style_updated (GtkWidget *widget)
{
gtk_widget_queue_resize (widget);
}
else if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_CLIP) ||
(has_text && gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_CLIP)))
{
gtk_widget_queue_allocate (widget);
}
else if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_REDRAW))
else if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_REDRAW) ||
(has_text && gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_CONTENT)))
{
gtk_widget_queue_draw (widget);
}