From 576028bdec90b27a42e8a65755dc0b2e235cdf5a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 9 Dec 2015 23:00:35 -0500 Subject: [PATCH] frame: Convert to gadgets As part of this conversion, remove the hardcoded padding around the label. Unfortunately, we cannot use the main gadget for drawing the frame decoration, since we want to draw a custom border instead of the stock css border that gadgets insist on drawing for us. Therefore, add an extra gadget with name border and use it just for rendering the frame. --- gtk/gtkframe.c | 527 +++++++++++++---------- gtk/theme/Adwaita/_common.scss | 7 +- gtk/theme/Adwaita/gtk-contained-dark.css | 13 +- gtk/theme/Adwaita/gtk-contained.css | 13 +- 4 files changed, 314 insertions(+), 246 deletions(-) diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index a875e58d1d..c50c1df01f 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -31,6 +31,13 @@ #include "gtkintl.h" #include "gtkbuildable.h" #include "gtkwidgetpath.h" +#include "gtkcssnodeprivate.h" +#include "gtkcsscustomgadgetprivate.h" +#include "gtkwidgetprivate.h" +#include "gtkcontainerprivate.h" +#include "gtkstylecontextprivate.h" +#include "gtkcssstylepropertyprivate.h" +#include "gtklabel.h" #include "a11y/gtkframeaccessible.h" @@ -65,9 +72,17 @@ * * # CSS nodes * - * GtkFrame has a single CSS node with name frame. The style class - * .flat can appear with it. In the #GtkShortcutsWindow, frames - * are used with the .keycap style class. + * |[ + * frame + * ├── border + * ├──