libegg r928 - in trunk: . libegg/toolpalette
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: libegg r928 - in trunk: . libegg/toolpalette
- Date: Mon, 16 Feb 2009 11:08:41 +0000 (UTC)
Author: jhs
Date: Mon Feb 16 11:08:41 2009
New Revision: 928
URL: http://svn.gnome.org/viewvc/libegg?rev=928&view=rev
Log:
2009-02-16 Johannes Schmid <jschmid openismus com>
* libegg/toolpalette/eggtoolitemgroup.c
(egg_tool_item_group_set_property),
(egg_tool_item_group_get_property),
(egg_tool_item_group_set_header_relief),
(egg_tool_item_group_get_header_relief):
* libegg/toolpalette/eggtoolitemgroup.h:
* libegg/toolpalette/testtoolpalette.c (view_relief_changed_cb),
(view_relief_changed), (create_ui):
Implemented "header-relief" property
Modified:
trunk/ChangeLog
trunk/libegg/toolpalette/eggtoolitemgroup.c
trunk/libegg/toolpalette/eggtoolitemgroup.h
trunk/libegg/toolpalette/testtoolpalette.c
Modified: trunk/libegg/toolpalette/eggtoolitemgroup.c
==============================================================================
--- trunk/libegg/toolpalette/eggtoolitemgroup.c (original)
+++ trunk/libegg/toolpalette/eggtoolitemgroup.c Mon Feb 16 11:08:41 2009
@@ -53,6 +53,7 @@
PROP_NAME,
PROP_COLLAPSED,
PROP_ELLIPSIZE,
+ PROP_RELIEF
};
enum
@@ -396,7 +397,9 @@
case PROP_ELLIPSIZE:
egg_tool_item_group_set_ellipsize (group, g_value_get_enum (value));
break;
-
+ case PROP_RELIEF:
+ egg_tool_item_group_set_header_relief (group, g_value_get_enum(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -425,6 +428,10 @@
g_value_set_enum (value, egg_tool_item_group_get_ellipsize (group));
break;
+ case PROP_RELIEF:
+ g_value_set_enum (value, egg_tool_item_group_get_header_relief (group));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1483,6 +1490,14 @@
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+ g_object_class_install_property (oclass, PROP_ELLIPSIZE,
+ g_param_spec_enum ("header-relief",
+ P_("header-relif"),
+ P_("Relief of the group header button"),
+ GTK_TYPE_RELIEF_STYLE, GTK_RELIEF_NORMAL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
+ G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+
gtk_widget_class_install_style_property (wclass,
g_param_spec_int ("expander-size",
P_("Expander Size"),
@@ -1594,6 +1609,22 @@
}
}
+/**
+ * egg_tool_item_group_header_relief:
+ * @group: an #EggToolItemGroup.
+ * @style: The GtkReliefStyle
+ *
+ * Set the button relief of the group header. See #gtk_button_set_relief for
+ * details
+ */
+void
+egg_tool_item_group_set_header_relief (EggToolItemGroup *group,
+ GtkReliefStyle style)
+{
+ g_return_if_fail (EGG_IS_TOOL_ITEM_GROUP (group));
+ gtk_button_set_relief (GTK_BUTTON(group->priv->header), style);
+}
+
static gint64
egg_tool_item_group_get_animation_timestamp (EggToolItemGroup *group)
{
@@ -1795,6 +1826,21 @@
}
/**
+ * egg_tool_item_group_get_header_relief:
+ * @group: an #EggToolItemGroup.
+ *
+ * Gets the relief mode of the header button of @group.
+ *
+ * Returns: the #GtkReliefStyle
+ */
+GtkReliefStyle
+egg_tool_item_group_get_header_relief (EggToolItemGroup *group)
+{
+ g_return_val_if_fail (EGG_IS_TOOL_ITEM_GROUP (group), GTK_RELIEF_NORMAL);
+ return gtk_button_get_relief (GTK_BUTTON (group->priv->header));
+}
+
+/**
* egg_tool_item_group_insert:
* @group: an #EggToolItemGroup.
* @item: the #GtkToolItem to insert into @group.
Modified: trunk/libegg/toolpalette/eggtoolitemgroup.h
==============================================================================
--- trunk/libegg/toolpalette/eggtoolitemgroup.h (original)
+++ trunk/libegg/toolpalette/eggtoolitemgroup.h Mon Feb 16 11:08:41 2009
@@ -63,10 +63,13 @@
gboolean collapsed);
void egg_tool_item_group_set_ellipsize (EggToolItemGroup *group,
PangoEllipsizeMode ellipsize);
+void egg_tool_item_group_set_header_relief (EggToolItemGroup *group,
+ GtkReliefStyle style);
G_CONST_RETURN gchar* egg_tool_item_group_get_name (EggToolItemGroup *group);
gboolean egg_tool_item_group_get_collapsed (EggToolItemGroup *group);
PangoEllipsizeMode egg_tool_item_group_get_ellipsize (EggToolItemGroup *group);
+GtkReliefStyle egg_tool_item_group_get_header_relief (EggToolItemGroup *group);
void egg_tool_item_group_insert (EggToolItemGroup *group,
GtkToolItem *item,
Modified: trunk/libegg/toolpalette/testtoolpalette.c
==============================================================================
--- trunk/libegg/toolpalette/testtoolpalette.c (original)
+++ trunk/libegg/toolpalette/testtoolpalette.c Mon Feb 16 11:08:41 2009
@@ -584,6 +584,16 @@
}
static void
+view_relief_changed_cb (GtkWidget *widget,
+ gpointer data)
+{
+ GEnumValue *relief = data;
+
+ egg_tool_item_group_set_header_relief (EGG_TOOL_ITEM_GROUP (widget),
+ relief->value);
+}
+
+static void
view_ellipsize_changed (GEnumValue *value,
gpointer data)
{
@@ -591,6 +601,13 @@
}
static void
+view_relief_changed (GEnumValue *value,
+ gpointer data)
+{
+ gtk_container_foreach (data, view_relief_changed_cb, value);
+}
+
+static void
view_exclusive_toggled_cb (GtkWidget *widget,
gpointer data)
{
@@ -666,6 +683,7 @@
<toolitem action='ViewStyle' /> \
<separator /> \
<toolitem action='ViewEllipsize' /> \
+ <toolitem action='ViewRelief' /> \
<toolitem action='ViewExclusive' /> \
<toolitem action='ViewExpand' /> \
<separator /> \
@@ -722,6 +740,10 @@
egg_enum_action_connect (EGG_ENUM_ACTION (action), view_ellipsize_changed, palette);
gtk_action_group_add_action (group, action);
+ action = egg_enum_action_new ("ViewRelief", _("Header Relief"), NULL, GTK_TYPE_RELIEF_STYLE);
+ egg_enum_action_connect (EGG_ENUM_ACTION (action), view_relief_changed, palette);
+ gtk_action_group_add_action (group, action);
+
action = GTK_ACTION (gtk_toggle_action_new ("ViewExclusive", _("Exclusive Groups"), NULL, NULL));
g_signal_connect (action, "toggled", G_CALLBACK (view_exclusive_toggled), palette);
gtk_action_group_add_action (group, action);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]