]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkarrow.c
filechooser: Also convert get_uris() to returning native paths
[~andy/gtk] / gtk / gtkarrow.c
index e3dde7cfc2b491fe0115a0196c1b5a20a5fe5996..fedf544b5e9e59fc6c2297ae12f7d1b7cd3f1d8b 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/>.
  */
 
 /*
@@ -207,15 +205,15 @@ gtk_arrow_get_preferred_width (GtkWidget *widget,
                                gint      *minimum_size,
                                gint      *natural_size)
 {
-  gint xpad;
+  GtkBorder border;
 
-  gtk_misc_get_padding (GTK_MISC (widget), &xpad, NULL);
+  _gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
 
   if (minimum_size)
-    *minimum_size = MIN_ARROW_SIZE + xpad * 2;
+    *minimum_size = MIN_ARROW_SIZE + border.left + border.right;
 
   if (natural_size)
-    *natural_size = MIN_ARROW_SIZE + xpad * 2;
+    *natural_size = MIN_ARROW_SIZE + border.left + border.right;
 }
 
 static void
@@ -223,18 +221,17 @@ gtk_arrow_get_preferred_height (GtkWidget *widget,
                                 gint      *minimum_size,
                                 gint      *natural_size)
 {
-  gint ypad;
+  GtkBorder border;
 
-  gtk_misc_get_padding (GTK_MISC (widget), NULL, &ypad);
+  _gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
 
   if (minimum_size)
-    *minimum_size = MIN_ARROW_SIZE + ypad * 2;
+    *minimum_size = MIN_ARROW_SIZE + border.top + border.bottom;
 
   if (natural_size)
-    *natural_size = MIN_ARROW_SIZE + ypad * 2;
+    *natural_size = MIN_ARROW_SIZE + border.top + border.bottom;
 }
 
-
 /**
  * gtk_arrow_new:
  * @arrow_type: a valid #GtkArrowType.
@@ -306,19 +303,17 @@ gtk_arrow_set (GtkArrow      *arrow,
     }
 }
 
-
 static gboolean
 gtk_arrow_draw (GtkWidget *widget,
                 cairo_t   *cr)
 {
   GtkArrow *arrow = GTK_ARROW (widget);
   GtkArrowPrivate *priv = arrow->priv;
-  GtkMisc *misc = GTK_MISC (widget);
   GtkStyleContext *context;
   gdouble x, y;
   gint width, height;
   gint extent;
-  gint xpad, ypad;
+  GtkBorder border;
   gfloat xalign, yalign;
   GtkArrowType effective_arrow_type;
   gfloat arrow_scaling;
@@ -330,11 +325,11 @@ gtk_arrow_draw (GtkWidget *widget,
   context = gtk_widget_get_style_context (widget);
   gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
 
-  gtk_misc_get_padding (misc, &xpad, &ypad);
-  gtk_misc_get_alignment (misc, &xalign, &yalign);
+  _gtk_misc_get_padding_and_border (GTK_MISC (widget), &border);
+  gtk_misc_get_alignment (GTK_MISC (widget), &xalign, &yalign);
 
-  width = gtk_widget_get_allocated_width (widget) - 2 * xpad;
-  height = gtk_widget_get_allocated_height (widget) - 2 * ypad;
+  width = gtk_widget_get_allocated_width (widget) - border.left - border.right;
+  height = gtk_widget_get_allocated_height (widget) - border.top - border.bottom;
 
   extent = MIN (width, height) * arrow_scaling;
   effective_arrow_type = priv->arrow_type;
@@ -348,8 +343,8 @@ gtk_arrow_draw (GtkWidget *widget,
         effective_arrow_type = GTK_ARROW_LEFT;
     }
 
-  x = xpad + ((width - extent) * xalign);
-  y = ypad + ((height - extent) * yalign);
+  x = border.left + ((width - extent) * xalign);
+  y = border.top + ((height - extent) * yalign);
 
   switch (effective_arrow_type)
     {