diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 25 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-model.c | 2 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-model.h | 9 |
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; |