Commit baaa2cd7 authored by Michael Natterer's avatar Michael Natterer 😴

app: remove the entire dockable tab auto-sizing code

It was totally broken and could never work like this in GTK+ 3.x, and
if it can be reimplemented it should be started from scratch.
parent abdd6964
......@@ -112,9 +112,7 @@ static const GimpRadioActionEntry dockable_tab_style_actions[] =
TAB_STYLE ("icon-name",
NC_("tab-style", "I_con & Text"), GIMP_TAB_STYLE_ICON_NAME),
TAB_STYLE ("preview-name",
NC_("tab-style", "St_atus & Text"), GIMP_TAB_STYLE_PREVIEW_NAME),
TAB_STYLE ("automatic",
NC_("tab-style", "Automatic"), GIMP_TAB_STYLE_AUTOMATIC)
NC_("tab-style", "St_atus & Text"), GIMP_TAB_STYLE_PREVIEW_NAME)
};
#undef VIEW_SIZE
......@@ -179,7 +177,7 @@ dockable_actions_setup (GimpActionGroup *group)
dockable_tab_style_actions,
G_N_ELEMENTS (dockable_tab_style_actions),
NULL,
GIMP_TAB_STYLE_AUTOMATIC,
GIMP_TAB_STYLE_PREVIEW,
G_CALLBACK (dockable_tab_style_cmd_callback));
gimp_action_group_add_radio_actions (group, "dockable-action",
......@@ -342,8 +340,6 @@ dockable_actions_update (GimpActionGroup *group,
SET_ACTIVE ("dockable-tab-style-icon-name", TRUE);
else if (tab_style == GIMP_TAB_STYLE_PREVIEW_NAME)
SET_ACTIVE ("dockable-tab-style-preview-name", TRUE);
else if (tab_style == GIMP_TAB_STYLE_AUTOMATIC)
SET_ACTIVE ("dockable-tab-style-automatic", TRUE);
docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
SET_SENSITIVE ("dockable-tab-style-preview",
......
......@@ -111,7 +111,7 @@ new_dockable_not_in_new_window (gconstpointer data)
gimp_test_run_mainloop_until_idle ();
/* Count dialogs after we created the dockable */
dialogs = gimp_dialog_factory_get_open_dialogs (factory);
dialogs = gimp_dialog_factory_get_open_dialogs (factory);
dialogs_after = g_list_length (dialogs);
for (iter = dialogs; iter; iter = g_list_next (iter))
{
......
......@@ -185,7 +185,7 @@ automatic_tab_style (gconstpointer data)
*/
g_assert_cmpint (GIMP_TAB_STYLE_ICON_BLURB,
==,
gimp_dockable_get_actual_tab_style (dockable));
gimp_dockable_get_tab_style (dockable));
/* Add some dockables to the channel dockable dockbook */
ui_manager =
......@@ -203,7 +203,7 @@ automatic_tab_style (gconstpointer data)
*/
g_assert_cmpint (GIMP_TAB_STYLE_ICON,
==,
gimp_dockable_get_actual_tab_style (dockable));
gimp_dockable_get_tab_style (dockable));
/* Close the two dockables we added */
gimp_ui_manager_activate_action (ui_manager,
......@@ -217,7 +217,7 @@ automatic_tab_style (gconstpointer data)
/* We should now be back on icon-blurb */
g_assert_cmpint (GIMP_TAB_STYLE_ICON_BLURB,
==,
gimp_dockable_get_actual_tab_style (dockable));
gimp_dockable_get_tab_style (dockable));
}
static void
......
......@@ -62,7 +62,6 @@ struct _GimpDockablePrivate
gchar *icon_name;
gchar *help_id;
GimpTabStyle tab_style;
GimpTabStyle actual_tab_style;
gboolean locked;
GimpDockbook *dockbook;
......@@ -183,10 +182,9 @@ gimp_dockable_init (GimpDockable *dockable)
GIMP_TYPE_DOCKABLE,
GimpDockablePrivate);
dockable->p->tab_style = GIMP_TAB_STYLE_AUTOMATIC;
dockable->p->actual_tab_style = GIMP_TAB_STYLE_UNDEFINED;
dockable->p->drag_x = GIMP_DOCKABLE_DRAG_OFFSET;
dockable->p->drag_y = GIMP_DOCKABLE_DRAG_OFFSET;
dockable->p->tab_style = GIMP_TAB_STYLE_PREVIEW;
dockable->p->drag_x = GIMP_DOCKABLE_DRAG_OFFSET;
dockable->p->drag_y = GIMP_DOCKABLE_DRAG_OFFSET;
gtk_drag_dest_set (GTK_WIDGET (dockable),
0,
......@@ -528,11 +526,6 @@ gimp_dockable_new_tab_widget_internal (GimpDockable *dockable,
gtk_box_pack_start (GTK_BOX (tab_widget), label, FALSE, FALSE, 0);
gtk_widget_show (label);
break;
case GIMP_TAB_STYLE_UNDEFINED:
case GIMP_TAB_STYLE_AUTOMATIC:
g_warning ("Tab style error, unexpected code path taken, fix!");
break;
}
return tab_widget;
......@@ -595,22 +588,6 @@ gimp_dockable_get_tab_style (GimpDockable *dockable)
return dockable->p->tab_style;
}
/**
* gimp_dockable_get_actual_tab_style:
* @dockable:
*
* Get actual tab style, i.e. never "automatic". This state should
* actually be hold on a per-dockbook basis, but at this point that
* feels like over-engineering...
**/
GimpTabStyle
gimp_dockable_get_actual_tab_style (GimpDockable *dockable)
{
g_return_val_if_fail (GIMP_IS_DOCKABLE (dockable), -1);
return dockable->p->actual_tab_style;
}
const gchar *
gimp_dockable_get_name (GimpDockable *dockable)
{
......@@ -722,39 +699,6 @@ gimp_dockable_set_tab_style (GimpDockable *dockable,
g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
dockable->p->tab_style = gimp_dockable_convert_tab_style (dockable, tab_style);
if (tab_style == GIMP_TAB_STYLE_AUTOMATIC)
gimp_dockable_set_actual_tab_style (dockable, GIMP_TAB_STYLE_UNDEFINED);
else
gimp_dockable_set_actual_tab_style (dockable, tab_style);
if (dockable->p->dockbook)
gimp_dockbook_update_auto_tab_style (dockable->p->dockbook);
}
/**
* gimp_dockable_set_actual_tab_style:
* @dockable:
* @tab_style:
*
* Sets actual tab style, meant for those that decides what
* "automatic" tab style means.
*
* Returns: %TRUE if changed, %FALSE otherwise.
**/
gboolean
gimp_dockable_set_actual_tab_style (GimpDockable *dockable,
GimpTabStyle tab_style)
{
GimpTabStyle new_tab_style = gimp_dockable_convert_tab_style (dockable, tab_style);
GimpTabStyle old_tab_style = dockable->p->actual_tab_style;
g_return_val_if_fail (GIMP_IS_DOCKABLE (dockable), FALSE);
g_return_val_if_fail (tab_style != GIMP_TAB_STYLE_AUTOMATIC, FALSE);
dockable->p->actual_tab_style = new_tab_style;
return new_tab_style != old_tab_style;
}
GtkWidget *
......
......@@ -88,9 +88,6 @@ gboolean gimp_dockable_is_locked (GimpDockable *dockable);
void gimp_dockable_set_tab_style (GimpDockable *dockable,
GimpTabStyle tab_style);
gboolean gimp_dockable_set_actual_tab_style (GimpDockable *dockable,
GimpTabStyle tab_style);
GimpTabStyle gimp_dockable_get_actual_tab_style (GimpDockable *dockable);
GtkWidget * gimp_dockable_create_tab_widget (GimpDockable *dockable,
GimpContext *context,
GimpTabStyle tab_style,
......
This diff is collapsed.
......@@ -77,7 +77,6 @@ void gimp_dockbook_update_with_context (GimpDockbook *dockbo
GimpContext *context);
GtkWidget * gimp_dockbook_create_tab_widget (GimpDockbook *dockbook,
GimpDockable *dockable);
void gimp_dockbook_update_auto_tab_style (GimpDockbook *dockbook);
gboolean gimp_dockbook_drop_dockable (GimpDockbook *dockbook,
GtkWidget *drag_source);
void gimp_dockbook_set_drag_handler (GimpDockbook *dockbook,
......
......@@ -242,8 +242,6 @@ gimp_tab_style_get_type (void)
{ GIMP_TAB_STYLE_ICON_BLURB, "GIMP_TAB_STYLE_ICON_BLURB", "icon-blurb" },
{ GIMP_TAB_STYLE_PREVIEW_NAME, "GIMP_TAB_STYLE_PREVIEW_NAME", "preview-name" },
{ GIMP_TAB_STYLE_PREVIEW_BLURB, "GIMP_TAB_STYLE_PREVIEW_BLURB", "preview-blurb" },
{ GIMP_TAB_STYLE_UNDEFINED, "GIMP_TAB_STYLE_UNDEFINED", "undefined" },
{ GIMP_TAB_STYLE_AUTOMATIC, "GIMP_TAB_STYLE_AUTOMATIC", "automatic" },
{ 0, NULL, NULL }
};
......@@ -257,8 +255,6 @@ gimp_tab_style_get_type (void)
{ GIMP_TAB_STYLE_ICON_BLURB, NC_("tab-style", "Icon & desc"), NULL },
{ GIMP_TAB_STYLE_PREVIEW_NAME, NC_("tab-style", "Status & text"), NULL },
{ GIMP_TAB_STYLE_PREVIEW_BLURB, NC_("tab-style", "Status & desc"), NULL },
{ GIMP_TAB_STYLE_UNDEFINED, NC_("tab-style", "Undefined"), NULL },
{ GIMP_TAB_STYLE_AUTOMATIC, NC_("tab-style", "Automatic"), NULL },
{ 0, NULL, NULL }
};
......
......@@ -122,9 +122,7 @@ typedef enum
GIMP_TAB_STYLE_ICON_NAME, /*< desc="Icon & text" >*/
GIMP_TAB_STYLE_ICON_BLURB, /*< desc="Icon & desc" >*/
GIMP_TAB_STYLE_PREVIEW_NAME, /*< desc="Status & text" >*/
GIMP_TAB_STYLE_PREVIEW_BLURB, /*< desc="Status & desc" >*/
GIMP_TAB_STYLE_UNDEFINED, /*< desc="Undefined" >*/
GIMP_TAB_STYLE_AUTOMATIC /*< desc="Automatic" >*/
GIMP_TAB_STYLE_PREVIEW_BLURB /*< desc="Status & desc" >*/
} GimpTabStyle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment