]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkframe.c
gtkenums: correct various documentation typos
[~andy/gtk] / gtk / gtkframe.c
index 275c6ea4ca9eed6be96e0605dec847eed1d35f6c..9b81631394c455e6d3adefe903861ab7a14d012c 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -32,6 +30,7 @@
 #include "gtktypebuiltins.h"
 #include "gtkintl.h"
 #include "gtkbuildable.h"
+#include "gtkwidgetpath.h"
 
 #include "a11y/gtkframeaccessible.h"
 
@@ -709,6 +708,9 @@ gtk_frame_draw (GtkWidget *widget,
           height += height_extra;
 
           x2 = padding.left + (priv->child_allocation.width - priv->label_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
+
+          gtk_render_background (context, cr, x, y, width, height);
+
           /* If the label is completely over or under the frame we can omit the gap */
           if (priv->label_yalign == 0.0 || priv->label_yalign == 1.0)
             gtk_render_frame (context, cr, x, y, width, height);
@@ -719,7 +721,14 @@ gtk_frame_draw (GtkWidget *widget,
                                   x2 + priv->label_allocation.width + 2 * LABEL_PAD);
         }
       else
-        gtk_render_frame (context, cr, x, y, width, height);
+        {
+          gtk_render_background (context, cr, x, y, width, height);
+          gtk_render_frame (context, cr, x, y, width, height);
+        }
+    }
+  else
+    {
+      gtk_render_background (context, cr, x, y, width, height);
     }
 
   GTK_WIDGET_CLASS (gtk_frame_parent_class)->draw (widget, cr);
@@ -835,10 +844,10 @@ gtk_frame_real_compute_child_allocation (GtkFrame      *frame,
 
   child_allocation->x = border_width + padding.left;
   child_allocation->y = border_width + top_margin;
-  child_allocation->width = MAX (1, (gint) allocation.width - (border_width * 2) -
-                                 padding.left - padding.right);
-  child_allocation->height = MAX (1, ((gint) allocation.height - child_allocation->y -
-                                      border_width - padding.bottom));
+  child_allocation->width = MAX (1, (gint) (allocation.width - (border_width * 2) -
+                                           padding.left - padding.right));
+  child_allocation->height = MAX (1, (gint) (allocation.height - child_allocation->y -
+                                            border_width - padding.bottom));
 
   child_allocation->x += allocation.x;
   child_allocation->y += allocation.y;
@@ -860,6 +869,9 @@ gtk_frame_get_preferred_size (GtkWidget      *request,
   gint minimum, natural;
   guint border_width;
 
+  get_padding_and_border (frame, &padding);
+  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
   if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
     {
       if (orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -902,9 +914,6 @@ gtk_frame_get_preferred_size (GtkWidget      *request,
         }
     }
 
-  get_padding_and_border (frame, &padding);
-  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-
   if (orientation == GTK_ORIENTATION_HORIZONTAL)
     {
       minimum += (border_width * 2) + padding.left + padding.right;