From 1126a34353877a5d0bcf06067e6bf129b48632e8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 21 Aug 2014 00:02:29 +0200 Subject: [PATCH] label: Respect box-shadow when computing clip Testclase included. Also reorder headers to be alphabetic. --- gtk/gtklabel.c | 24 +++++++++---------- testsuite/reftests/Makefile.am | 3 +++ testsuite/reftests/label-box-shadow-clip.css | 9 +++++++ .../reftests/label-box-shadow-clip.ref.ui | 23 ++++++++++++++++++ testsuite/reftests/label-box-shadow-clip.ui | 23 ++++++++++++++++++ 5 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 testsuite/reftests/label-box-shadow-clip.css create mode 100644 testsuite/reftests/label-box-shadow-clip.ref.ui create mode 100644 testsuite/reftests/label-box-shadow-clip.ui diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 906d56e9f5..bf8d101bfd 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -30,28 +30,28 @@ #include "gtklabel.h" #include "gtklabelprivate.h" #include "gtkaccellabel.h" +#include "gtkbindings.h" +#include "gtkbuildable.h" +#include "gtkclipboard.h" #include "gtkcssshadowsvalueprivate.h" #include "gtkdnd.h" -#include "gtkmarshalers.h" -#include "gtkpango.h" -#include "gtkwindow.h" -#include "gtkclipboard.h" +#include "gtkimage.h" #include "gtkintl.h" -#include "gtkseparatormenuitem.h" -#include "gtktextutil.h" #include "gtkmain.h" +#include "gtkmarshalers.h" #include "gtkmenuitem.h" #include "gtkmenushellprivate.h" #include "gtknotebook.h" -#include "gtkbindings.h" -#include "gtkbuildable.h" -#include "gtkimage.h" +#include "gtkpango.h" +#include "gtkprivate.h" +#include "gtkseparatormenuitem.h" #include "gtkshow.h" #include "gtkstylecontextprivate.h" +#include "gtktextutil.h" #include "gtktooltip.h" -#include "gtkprivate.h" #include "gtktypebuiltins.h" -#include "gtkmain.h" +#include "gtkwidgetprivate.h" +#include "gtkwindow.h" #include "a11y/gtklabelaccessibleprivate.h" @@ -3997,7 +3997,7 @@ gtk_label_size_allocate (GtkWidget *widget, gtk_label_get_ink_rect (label, &clip_rect); gdk_rectangle_union (&clip_rect, allocation, &clip_rect); - gtk_widget_set_clip (widget, &clip_rect); + _gtk_widget_set_simple_clip (widget, &clip_rect); } static void diff --git a/testsuite/reftests/Makefile.am b/testsuite/reftests/Makefile.am index 336a507c48..0b39b41dfd 100644 --- a/testsuite/reftests/Makefile.am +++ b/testsuite/reftests/Makefile.am @@ -252,6 +252,9 @@ testdata = \ label-background.css \ label-background.ref.ui \ label-background.ui \ + label-box-shadow-clip.css \ + label-box-shadow-clip.ref.ui \ + label-box-shadow-clip.ui \ label-clipping.css \ label-clipping.ref.ui \ label-clipping.ui \ diff --git a/testsuite/reftests/label-box-shadow-clip.css b/testsuite/reftests/label-box-shadow-clip.css new file mode 100644 index 0000000000..1aa8006031 --- /dev/null +++ b/testsuite/reftests/label-box-shadow-clip.css @@ -0,0 +1,9 @@ +@import "reset-to-defaults.css"; + +.test { + box-shadow: 0 0 0 1px red; +} + +.reference { + border: 1px solid red; +} diff --git a/testsuite/reftests/label-box-shadow-clip.ref.ui b/testsuite/reftests/label-box-shadow-clip.ref.ui new file mode 100644 index 0000000000..31f744d3a9 --- /dev/null +++ b/testsuite/reftests/label-box-shadow-clip.ref.ui @@ -0,0 +1,23 @@ + + + + + + 100 + 100 + False + popup + + + True + False + center + center + X + + + + + diff --git a/testsuite/reftests/label-box-shadow-clip.ui b/testsuite/reftests/label-box-shadow-clip.ui new file mode 100644 index 0000000000..03741621b7 --- /dev/null +++ b/testsuite/reftests/label-box-shadow-clip.ui @@ -0,0 +1,23 @@ + + + + + + 100 + 100 + False + popup + + + True + False + center + center + X + + + + +