Remove some leftovers of deprecated functionality
There were some vestiges of the gtk_{h,v}button_box_set_default_layout() functionality left. These are gone now. I have also removed the GTK_BUTTONBOX_DEFAULT value in GtkButtonBoxStyle, but the other values have been kept at their numeric values, to avoid more serious ABI change.
This commit is contained in:
231
gtk/gtkbbox.c
231
gtk/gtkbbox.c
@ -54,8 +54,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gtkbbox.h"
|
#include "gtkbbox.h"
|
||||||
#include "gtkhbbox.h"
|
|
||||||
#include "gtkvbbox.h"
|
|
||||||
#include "gtkorientable.h"
|
#include "gtkorientable.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
@ -64,11 +62,6 @@
|
|||||||
struct _GtkButtonBoxPriv
|
struct _GtkButtonBoxPriv
|
||||||
{
|
{
|
||||||
GtkButtonBoxStyle layout_style;
|
GtkButtonBoxStyle layout_style;
|
||||||
|
|
||||||
gint child_ipad_x;
|
|
||||||
gint child_ipad_y;
|
|
||||||
gint child_min_width;
|
|
||||||
gint child_min_height;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -84,13 +77,13 @@ enum {
|
|||||||
#define GTK_BOX_SECONDARY_CHILD "gtk-box-secondary-child"
|
#define GTK_BOX_SECONDARY_CHILD "gtk-box-secondary-child"
|
||||||
|
|
||||||
static void gtk_button_box_set_property (GObject *object,
|
static void gtk_button_box_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gtk_button_box_get_property (GObject *object,
|
static void gtk_button_box_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gtk_button_box_size_request (GtkWidget *widget,
|
static void gtk_button_box_size_request (GtkWidget *widget,
|
||||||
GtkRequisition *requisition);
|
GtkRequisition *requisition);
|
||||||
static void gtk_button_box_size_allocate (GtkWidget *widget,
|
static void gtk_button_box_size_allocate (GtkWidget *widget,
|
||||||
@ -98,20 +91,21 @@ static void gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
static void gtk_button_box_remove (GtkContainer *container,
|
static void gtk_button_box_remove (GtkContainer *container,
|
||||||
GtkWidget *widget);
|
GtkWidget *widget);
|
||||||
static void gtk_button_box_set_child_property (GtkContainer *container,
|
static void gtk_button_box_set_child_property (GtkContainer *container,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gtk_button_box_get_child_property (GtkContainer *container,
|
static void gtk_button_box_get_child_property (GtkContainer *container,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
#define DEFAULT_CHILD_MIN_WIDTH 85
|
#define DEFAULT_CHILD_MIN_WIDTH 85
|
||||||
#define DEFAULT_CHILD_MIN_HEIGHT 27
|
#define DEFAULT_CHILD_MIN_HEIGHT 27
|
||||||
#define DEFAULT_CHILD_IPAD_X 4
|
#define DEFAULT_CHILD_IPAD_X 4
|
||||||
#define DEFAULT_CHILD_IPAD_Y 0
|
#define DEFAULT_CHILD_IPAD_Y 0
|
||||||
|
#define DEFAULT_LAYOUT_STYLE GTK_BUTTONBOX_EDGE
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
|
G_DEFINE_TYPE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
|
||||||
|
|
||||||
@ -140,56 +134,56 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
|
|||||||
* libgobject allows that.
|
* libgobject allows that.
|
||||||
*/
|
*/
|
||||||
gtk_widget_class_install_style_property (widget_class,
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
g_param_spec_int ("child-min-width",
|
g_param_spec_int ("child-min-width",
|
||||||
P_("Minimum child width"),
|
P_("Minimum child width"),
|
||||||
P_("Minimum width of buttons inside the box"),
|
P_("Minimum width of buttons inside the box"),
|
||||||
0,
|
0,
|
||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
DEFAULT_CHILD_MIN_WIDTH,
|
DEFAULT_CHILD_MIN_WIDTH,
|
||||||
GTK_PARAM_READABLE));
|
GTK_PARAM_READABLE));
|
||||||
|
|
||||||
gtk_widget_class_install_style_property (widget_class,
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
g_param_spec_int ("child-min-height",
|
g_param_spec_int ("child-min-height",
|
||||||
P_("Minimum child height"),
|
P_("Minimum child height"),
|
||||||
P_("Minimum height of buttons inside the box"),
|
P_("Minimum height of buttons inside the box"),
|
||||||
0,
|
0,
|
||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
DEFAULT_CHILD_MIN_HEIGHT,
|
DEFAULT_CHILD_MIN_HEIGHT,
|
||||||
GTK_PARAM_READABLE));
|
GTK_PARAM_READABLE));
|
||||||
|
|
||||||
gtk_widget_class_install_style_property (widget_class,
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
g_param_spec_int ("child-internal-pad-x",
|
g_param_spec_int ("child-internal-pad-x",
|
||||||
P_("Child internal width padding"),
|
P_("Child internal width padding"),
|
||||||
P_("Amount to increase child's size on either side"),
|
P_("Amount to increase child's size on either side"),
|
||||||
0,
|
0,
|
||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
DEFAULT_CHILD_IPAD_X,
|
DEFAULT_CHILD_IPAD_X,
|
||||||
GTK_PARAM_READABLE));
|
GTK_PARAM_READABLE));
|
||||||
|
|
||||||
gtk_widget_class_install_style_property (widget_class,
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
g_param_spec_int ("child-internal-pad-y",
|
g_param_spec_int ("child-internal-pad-y",
|
||||||
P_("Child internal height padding"),
|
P_("Child internal height padding"),
|
||||||
P_("Amount to increase child's size on the top and bottom"),
|
P_("Amount to increase child's size on the top and bottom"),
|
||||||
0,
|
0,
|
||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
DEFAULT_CHILD_IPAD_Y,
|
DEFAULT_CHILD_IPAD_Y,
|
||||||
GTK_PARAM_READABLE));
|
GTK_PARAM_READABLE));
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_LAYOUT_STYLE,
|
PROP_LAYOUT_STYLE,
|
||||||
g_param_spec_enum ("layout-style",
|
g_param_spec_enum ("layout-style",
|
||||||
P_("Layout style"),
|
P_("Layout style"),
|
||||||
P_("How to layout the buttons in the box. Possible values are default, spread, edge, start and end"),
|
P_("How to layout the buttons in the box. Possible values are spread, edge, start and end"),
|
||||||
GTK_TYPE_BUTTON_BOX_STYLE,
|
GTK_TYPE_BUTTON_BOX_STYLE,
|
||||||
GTK_BUTTONBOX_DEFAULT_STYLE,
|
DEFAULT_LAYOUT_STYLE,
|
||||||
GTK_PARAM_READWRITE));
|
GTK_PARAM_READWRITE));
|
||||||
|
|
||||||
gtk_container_class_install_child_property (container_class,
|
gtk_container_class_install_child_property (container_class,
|
||||||
CHILD_PROP_SECONDARY,
|
CHILD_PROP_SECONDARY,
|
||||||
g_param_spec_boolean ("secondary",
|
g_param_spec_boolean ("secondary",
|
||||||
P_("Secondary"),
|
P_("Secondary"),
|
||||||
P_("If TRUE, the child appears in a secondary group of children, suitable for, e.g., help buttons"),
|
P_("If TRUE, the child appears in a secondary group of children, suitable for, e.g., help buttons"),
|
||||||
FALSE,
|
FALSE,
|
||||||
GTK_PARAM_READWRITE));
|
GTK_PARAM_READWRITE));
|
||||||
|
|
||||||
g_type_class_add_private (class, sizeof (GtkButtonBoxPriv));
|
g_type_class_add_private (class, sizeof (GtkButtonBoxPriv));
|
||||||
}
|
}
|
||||||
@ -205,24 +199,20 @@ gtk_button_box_init (GtkButtonBox *button_box)
|
|||||||
priv = button_box->priv;
|
priv = button_box->priv;
|
||||||
|
|
||||||
gtk_box_set_spacing (GTK_BOX (button_box), 0);
|
gtk_box_set_spacing (GTK_BOX (button_box), 0);
|
||||||
priv->child_min_width = GTK_BUTTONBOX_DEFAULT;
|
priv->layout_style = DEFAULT_LAYOUT_STYLE;
|
||||||
priv->child_min_height = GTK_BUTTONBOX_DEFAULT;
|
|
||||||
priv->child_ipad_x = GTK_BUTTONBOX_DEFAULT;
|
|
||||||
priv->child_ipad_y = GTK_BUTTONBOX_DEFAULT;
|
|
||||||
priv->layout_style = GTK_BUTTONBOX_DEFAULT_STYLE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_box_set_property (GObject *object,
|
gtk_button_box_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_LAYOUT_STYLE:
|
case PROP_LAYOUT_STYLE:
|
||||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (object),
|
gtk_button_box_set_layout (GTK_BUTTON_BOX (object),
|
||||||
g_value_get_enum (value));
|
g_value_get_enum (value));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
@ -231,10 +221,10 @@ gtk_button_box_set_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_box_get_property (GObject *object,
|
gtk_button_box_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GtkButtonBoxPriv *priv = GTK_BUTTON_BOX (object)->priv;
|
GtkButtonBoxPriv *priv = GTK_BUTTON_BOX (object)->priv;
|
||||||
|
|
||||||
@ -250,17 +240,17 @@ gtk_button_box_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_box_set_child_property (GtkContainer *container,
|
gtk_button_box_set_child_property (GtkContainer *container,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case CHILD_PROP_SECONDARY:
|
case CHILD_PROP_SECONDARY:
|
||||||
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (container), child,
|
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (container), child,
|
||||||
g_value_get_boolean (value));
|
g_value_get_boolean (value));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
||||||
@ -270,17 +260,17 @@ gtk_button_box_set_child_property (GtkContainer *container,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_box_get_child_property (GtkContainer *container,
|
gtk_button_box_get_child_property (GtkContainer *container,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case CHILD_PROP_SECONDARY:
|
case CHILD_PROP_SECONDARY:
|
||||||
g_value_set_boolean (value,
|
g_value_set_boolean (value,
|
||||||
gtk_button_box_get_child_secondary (GTK_BUTTON_BOX (container),
|
gtk_button_box_get_child_secondary (GTK_BUTTON_BOX (container),
|
||||||
child));
|
child));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
||||||
@ -293,7 +283,8 @@ gtk_button_box_remove (GtkContainer *container,
|
|||||||
GtkWidget *widget)
|
GtkWidget *widget)
|
||||||
{
|
{
|
||||||
/* clear is_secondary flag in case the widget
|
/* clear is_secondary flag in case the widget
|
||||||
* is added to another container */
|
* is added to another container
|
||||||
|
*/
|
||||||
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (container),
|
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (container),
|
||||||
widget,
|
widget,
|
||||||
FALSE);
|
FALSE);
|
||||||
@ -315,8 +306,6 @@ gtk_button_box_set_layout (GtkButtonBox *widget,
|
|||||||
GtkButtonBoxPriv *priv;
|
GtkButtonBoxPriv *priv;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
|
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
|
||||||
g_return_if_fail (layout_style >= GTK_BUTTONBOX_DEFAULT_STYLE &&
|
|
||||||
layout_style <= GTK_BUTTONBOX_CENTER);
|
|
||||||
|
|
||||||
priv = widget->priv;
|
priv = widget->priv;
|
||||||
|
|
||||||
@ -339,7 +328,7 @@ gtk_button_box_set_layout (GtkButtonBox *widget,
|
|||||||
GtkButtonBoxStyle
|
GtkButtonBoxStyle
|
||||||
gtk_button_box_get_layout (GtkButtonBox *widget)
|
gtk_button_box_get_layout (GtkButtonBox *widget)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GTK_IS_BUTTON_BOX (widget), GTK_BUTTONBOX_SPREAD);
|
g_return_val_if_fail (GTK_IS_BUTTON_BOX (widget), DEFAULT_LAYOUT_STYLE);
|
||||||
|
|
||||||
return widget->priv->layout_style;
|
return widget->priv->layout_style;
|
||||||
}
|
}
|
||||||
@ -357,7 +346,7 @@ gtk_button_box_get_layout (GtkButtonBox *widget)
|
|||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
gtk_button_box_get_child_secondary (GtkButtonBox *widget,
|
gtk_button_box_get_child_secondary (GtkButtonBox *widget,
|
||||||
GtkWidget *child)
|
GtkWidget *child)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GTK_IS_BUTTON_BOX (widget), FALSE);
|
g_return_val_if_fail (GTK_IS_BUTTON_BOX (widget), FALSE);
|
||||||
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
|
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
|
||||||
@ -387,8 +376,8 @@ gtk_button_box_get_child_secondary (GtkButtonBox *widget,
|
|||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gtk_button_box_set_child_secondary (GtkButtonBox *widget,
|
gtk_button_box_set_child_secondary (GtkButtonBox *widget,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
gboolean is_secondary)
|
gboolean is_secondary)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
|
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
|
||||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||||
@ -399,8 +388,8 @@ gtk_button_box_set_child_secondary (GtkButtonBox *widget,
|
|||||||
is_secondary ? GINT_TO_POINTER (1) : NULL);
|
is_secondary ? GINT_TO_POINTER (1) : NULL);
|
||||||
gtk_widget_child_notify (child, "secondary");
|
gtk_widget_child_notify (child, "secondary");
|
||||||
|
|
||||||
if (gtk_widget_get_visible (GTK_WIDGET (widget))
|
if (gtk_widget_get_visible (GTK_WIDGET (widget)) &&
|
||||||
&& gtk_widget_get_visible (child))
|
gtk_widget_get_visible (child))
|
||||||
gtk_widget_queue_resize (child);
|
gtk_widget_queue_resize (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,7 +417,6 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
|
|||||||
gint height_default;
|
gint height_default;
|
||||||
gint ipad_x_default;
|
gint ipad_x_default;
|
||||||
gint ipad_y_default;
|
gint ipad_y_default;
|
||||||
|
|
||||||
gint child_min_width;
|
gint child_min_width;
|
||||||
gint child_min_height;
|
gint child_min_height;
|
||||||
gint ipad_x;
|
gint ipad_x;
|
||||||
@ -444,16 +432,12 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
|
|||||||
"child-min-height", &height_default,
|
"child-min-height", &height_default,
|
||||||
"child-internal-pad-x", &ipad_x_default,
|
"child-internal-pad-x", &ipad_x_default,
|
||||||
"child-internal-pad-y", &ipad_y_default,
|
"child-internal-pad-y", &ipad_y_default,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
child_min_width = priv->child_min_width != GTK_BUTTONBOX_DEFAULT
|
child_min_width = width_default;
|
||||||
? priv->child_min_width : width_default;
|
child_min_height = height_default;
|
||||||
child_min_height = priv->child_min_height != GTK_BUTTONBOX_DEFAULT
|
ipad_x = ipad_x_default;
|
||||||
? priv->child_min_height : height_default;
|
ipad_y = ipad_y_default;
|
||||||
ipad_x = priv->child_ipad_x != GTK_BUTTONBOX_DEFAULT
|
|
||||||
? priv->child_ipad_x : ipad_x_default;
|
|
||||||
ipad_y = priv->child_ipad_y != GTK_BUTTONBOX_DEFAULT
|
|
||||||
? priv->child_ipad_y : ipad_y_default;
|
|
||||||
|
|
||||||
nchildren = 0;
|
nchildren = 0;
|
||||||
nsecondaries = 0;
|
nsecondaries = 0;
|
||||||
@ -474,17 +458,17 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
|
|||||||
is_secondary = gtk_button_box_get_child_secondary (bbox, child);
|
is_secondary = gtk_button_box_get_child_secondary (bbox, child);
|
||||||
|
|
||||||
if (gtk_widget_get_visible (child))
|
if (gtk_widget_get_visible (child))
|
||||||
{
|
{
|
||||||
nchildren += 1;
|
nchildren += 1;
|
||||||
gtk_widget_size_request (child, &child_requisition);
|
gtk_widget_size_request (child, &child_requisition);
|
||||||
|
|
||||||
if (child_requisition.width + ipad_w > needed_width)
|
if (child_requisition.width + ipad_w > needed_width)
|
||||||
needed_width = child_requisition.width + ipad_w;
|
needed_width = child_requisition.width + ipad_w;
|
||||||
if (child_requisition.height + ipad_h > needed_height)
|
if (child_requisition.height + ipad_h > needed_height)
|
||||||
needed_height = child_requisition.height + ipad_h;
|
needed_height = child_requisition.height + ipad_h;
|
||||||
if (is_secondary)
|
if (is_secondary)
|
||||||
nsecondaries++;
|
nsecondaries++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (list);
|
g_list_free (list);
|
||||||
@ -499,23 +483,6 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
|
|||||||
*height = needed_height;
|
*height = needed_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is a kludge function to support the deprecated
|
|
||||||
* gtk_[vh]button_box_set_layout_default() just in case anyone is still
|
|
||||||
* using it (why?)
|
|
||||||
*/
|
|
||||||
static GtkButtonBoxStyle
|
|
||||||
gtk_button_box_kludge_get_layout_default (GtkButtonBox *widget)
|
|
||||||
{
|
|
||||||
GtkOrientation orientation;
|
|
||||||
|
|
||||||
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
|
|
||||||
|
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
||||||
return _gtk_hbutton_box_get_layout_default ();
|
|
||||||
else
|
|
||||||
return _gtk_vbutton_box_get_layout_default ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_button_box_size_request (GtkWidget *widget,
|
gtk_button_box_size_request (GtkWidget *widget,
|
||||||
GtkRequisition *requisition)
|
GtkRequisition *requisition)
|
||||||
@ -528,7 +495,6 @@ gtk_button_box_size_request (GtkWidget *widget,
|
|||||||
gint child_height;
|
gint child_height;
|
||||||
gint spacing;
|
gint spacing;
|
||||||
guint border_width;
|
guint border_width;
|
||||||
GtkButtonBoxStyle layout;
|
|
||||||
GtkOrientation orientation;
|
GtkOrientation orientation;
|
||||||
|
|
||||||
box = GTK_BOX (widget);
|
box = GTK_BOX (widget);
|
||||||
@ -537,12 +503,10 @@ gtk_button_box_size_request (GtkWidget *widget,
|
|||||||
|
|
||||||
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
|
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
|
||||||
spacing = gtk_box_get_spacing (box);
|
spacing = gtk_box_get_spacing (box);
|
||||||
layout = priv->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE
|
|
||||||
? priv->layout_style : gtk_button_box_kludge_get_layout_default (GTK_BUTTON_BOX (widget));
|
|
||||||
|
|
||||||
_gtk_button_box_child_requisition (widget,
|
_gtk_button_box_child_requisition (widget,
|
||||||
&nvis_children,
|
&nvis_children,
|
||||||
NULL,
|
NULL,
|
||||||
&child_width,
|
&child_width,
|
||||||
&child_height);
|
&child_height);
|
||||||
|
|
||||||
@ -553,7 +517,7 @@ gtk_button_box_size_request (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (layout)
|
switch (priv->layout_style)
|
||||||
{
|
{
|
||||||
case GTK_BUTTONBOX_SPREAD:
|
case GTK_BUTTONBOX_SPREAD:
|
||||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
@ -613,7 +577,6 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
gint height = 0;
|
gint height = 0;
|
||||||
gint childspace;
|
gint childspace;
|
||||||
gint childspacing = 0;
|
gint childspacing = 0;
|
||||||
GtkButtonBoxStyle layout;
|
|
||||||
gint spacing;
|
gint spacing;
|
||||||
guint border_width;
|
guint border_width;
|
||||||
GtkOrientation orientation;
|
GtkOrientation orientation;
|
||||||
@ -625,8 +588,6 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
|
||||||
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
|
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
|
||||||
spacing = gtk_box_get_spacing (base_box);
|
spacing = gtk_box_get_spacing (base_box);
|
||||||
layout = priv->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE
|
|
||||||
? priv->layout_style : gtk_button_box_kludge_get_layout_default (GTK_BUTTON_BOX (widget));
|
|
||||||
_gtk_button_box_child_requisition (widget,
|
_gtk_button_box_child_requisition (widget,
|
||||||
&nvis_children,
|
&nvis_children,
|
||||||
&n_secondaries,
|
&n_secondaries,
|
||||||
@ -639,7 +600,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
|||||||
else
|
else
|
||||||
height = allocation->height - border_width*2;
|
height = allocation->height - border_width*2;
|
||||||
|
|
||||||
switch (layout)
|
switch (priv->layout_style)
|
||||||
{
|
{
|
||||||
case GTK_BUTTONBOX_SPREAD:
|
case GTK_BUTTONBOX_SPREAD:
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@ G_BEGIN_DECLS
|
|||||||
#define GTK_BUTTON_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_BOX, GtkButtonBoxClass))
|
#define GTK_BUTTON_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_BOX, GtkButtonBoxClass))
|
||||||
|
|
||||||
|
|
||||||
#define GTK_BUTTONBOX_DEFAULT -1
|
|
||||||
|
|
||||||
typedef struct _GtkButtonBox GtkButtonBox;
|
typedef struct _GtkButtonBox GtkButtonBox;
|
||||||
typedef struct _GtkButtonBoxPriv GtkButtonBoxPriv;
|
typedef struct _GtkButtonBoxPriv GtkButtonBoxPriv;
|
||||||
typedef struct _GtkButtonBoxClass GtkButtonBoxClass;
|
typedef struct _GtkButtonBoxClass GtkButtonBoxClass;
|
||||||
|
@ -86,8 +86,7 @@ typedef enum
|
|||||||
/* Button box styles */
|
/* Button box styles */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
GTK_BUTTONBOX_DEFAULT_STYLE,
|
GTK_BUTTONBOX_SPREAD = 1,
|
||||||
GTK_BUTTONBOX_SPREAD,
|
|
||||||
GTK_BUTTONBOX_EDGE,
|
GTK_BUTTONBOX_EDGE,
|
||||||
GTK_BUTTONBOX_START,
|
GTK_BUTTONBOX_START,
|
||||||
GTK_BUTTONBOX_END,
|
GTK_BUTTONBOX_END,
|
||||||
|
@ -29,8 +29,6 @@
|
|||||||
#include "gtkorientable.h"
|
#include "gtkorientable.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
|
||||||
static gint default_layout_style = GTK_BUTTONBOX_EDGE;
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkHButtonBox, gtk_hbutton_box, GTK_TYPE_BUTTON_BOX)
|
G_DEFINE_TYPE (GtkHButtonBox, gtk_hbutton_box, GTK_TYPE_BUTTON_BOX)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -51,8 +49,3 @@ gtk_hbutton_box_new (void)
|
|||||||
return g_object_new (GTK_TYPE_HBUTTON_BOX, NULL);
|
return g_object_new (GTK_TYPE_HBUTTON_BOX, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkButtonBoxStyle
|
|
||||||
_gtk_hbutton_box_get_layout_default (void)
|
|
||||||
{
|
|
||||||
return default_layout_style;
|
|
||||||
}
|
|
||||||
|
@ -55,8 +55,6 @@
|
|||||||
* gtk_button_box_set_layout().
|
* gtk_button_box_set_layout().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE;
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkVButtonBox, gtk_vbutton_box, GTK_TYPE_BUTTON_BOX)
|
G_DEFINE_TYPE (GtkVButtonBox, gtk_vbutton_box, GTK_TYPE_BUTTON_BOX)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -83,10 +81,3 @@ gtk_vbutton_box_new (void)
|
|||||||
{
|
{
|
||||||
return g_object_new (GTK_TYPE_VBUTTON_BOX, NULL);
|
return g_object_new (GTK_TYPE_VBUTTON_BOX, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GtkButtonBoxStyle
|
|
||||||
_gtk_vbutton_box_get_layout_default (void)
|
|
||||||
{
|
|
||||||
return default_layout_style;
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user