aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-10 08:14:23 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-10 08:14:23 +0800
commit0db1c0f440d4388e7000eaa6aa2ea8e53776aded (patch)
tree1851d3f4ba438eb4f2771958eb26e6d0a5902b91 /lib
parentdb1d9c156dce000c86c7ea961ac55c9a46b48e8e (diff)
downloadgsoc2013-epiphany-0db1c0f440d4388e7000eaa6aa2ea8e53776aded.tar.gz
gsoc2013-epiphany-0db1c0f440d4388e7000eaa6aa2ea8e53776aded.tar.zst
gsoc2013-epiphany-0db1c0f440d4388e7000eaa6aa2ea8e53776aded.zip
Rename toolbar model flags to be more in line with GtkToolbarStyle.
2005-01-10 Christian Persch <chpe@cvs.gnome.org> * lib/egg/egg-editable-toolbar.c: (toolbar_changed_cb), (egg_editable_toolbar_construct): * lib/egg/egg-toolbars-model.c: (parse_toolbars): * lib/egg/egg-toolbars-model.h: Rename toolbar model flags to be more in line with GtkToolbarStyle.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/egg/egg-editable-toolbar.c25
-rwxr-xr-xlib/egg/egg-toolbars-model.c2
-rwxr-xr-xlib/egg/egg-toolbars-model.h9
3 files changed, 16 insertions, 20 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index 381ed8670..72884e5f7 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -745,19 +745,19 @@ toolbar_changed_cb (EggToolbarsModel *model,
flags = egg_toolbars_model_get_flags (model, position);
toolbar = get_toolbar_nth (t, position);
- if (flags & EGG_TB_MODEL_ICONS_ONLY)
+ if (flags & EGG_TB_MODEL_ICONS)
{
style = GTK_TOOLBAR_ICONS;
}
- else if (flags & EGG_TB_MODEL_TEXT_ONLY)
+ else if (flags & EGG_TB_MODEL_TEXT)
{
style = GTK_TOOLBAR_TEXT;
}
- else if (flags & EGG_TB_MODEL_ICONS_TEXT)
+ else if (flags & EGG_TB_MODEL_BOTH)
{
style = GTK_TOOLBAR_BOTH;
}
- else if (flags & EGG_TB_MODEL_ICONS_TEXT_HORIZ)
+ else if (flags & EGG_TB_MODEL_BOTH_HORIZ)
{
style = GTK_TOOLBAR_BOTH_HORIZ;
}
@@ -905,22 +905,11 @@ egg_editable_toolbar_construct (EggEditableToolbar *t)
for (i = 0; i < n_toolbars; i++)
{
GtkWidget *toolbar, *dock;
- EggTbModelFlags flags;
dock = create_dock (t);
gtk_box_pack_start (GTK_BOX (t), dock, TRUE, TRUE, 0);
toolbar = get_toolbar_nth (t, i);
- flags = egg_toolbars_model_get_flags (model, i);
- if (flags & EGG_TB_MODEL_ICONS_ONLY)
- {
- gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
- if (i == 0 && t->priv->fixed_toolbar)
- {
- set_fixed_style (t, GTK_TOOLBAR_ICONS);
- }
- }
-
n_items = egg_toolbars_model_n_items (model, i);
for (l = 0; l < n_items; l++)
{
@@ -953,6 +942,12 @@ egg_editable_toolbar_construct (EggEditableToolbar *t)
}
update_fixed (t);
+
+ /* apply styles */
+ for (i = 0; i < n_toolbars; i ++)
+ {
+ toolbar_changed_cb (model, i, t);
+ }
}
static void
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index 3837cc3f6..0ecfcd193 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -442,7 +442,7 @@ parse_toolbars (EggToolbarsModel *t,
if (style && xmlStrEqual (style, "icons-only"))
{
/* FIXME: use toolbar position instead of 0 */
- egg_toolbars_model_set_flags (t, 0, EGG_TB_MODEL_ICONS_ONLY);
+ egg_toolbars_model_set_flags (t, 0, EGG_TB_MODEL_ICONS);
}
xmlFree (style);
diff --git a/lib/egg/egg-toolbars-model.h b/lib/egg/egg-toolbars-model.h
index 276c4730d..aaaa2140a 100755
--- a/lib/egg/egg-toolbars-model.h
+++ b/lib/egg/egg-toolbars-model.h
@@ -43,10 +43,11 @@ typedef struct EggToolbarsModelClass EggToolbarsModelClass;
typedef enum
{
EGG_TB_MODEL_NOT_REMOVABLE = 1 << 0,
- EGG_TB_MODEL_ICONS_ONLY = 1 << 1,
- EGG_TB_MODEL_TEXT_ONLY = 1 << 2,
- EGG_TB_MODEL_ICONS_TEXT = 1 << 3,
- EGG_TB_MODEL_ICONS_TEXT_HORIZ = 1 << 4,
+ EGG_TB_MODEL_BOTH = 1 << 1,
+ EGG_TB_MODEL_BOTH_HORIZ = 1 << 2,
+ EGG_TB_MODEL_ICONS = 1 << 3,
+ EGG_TB_MODEL_TEXT = 1 << 4,
+ EGG_TB_MODEL_STYLES_MASK = 0x1F,
EGG_TB_MODEL_ACCEPT_ITEMS_ONLY = 1 << 5
} EggTbModelFlags;