Commit 501f97b5 authored by Martin Nordholts's avatar Martin Nordholts

Add gimp_preview_tab_style_to_icon() utility function

Also fix wrong conversion from PREVIEW_NAME to ICON_BLURB
parent e8e469c5
......@@ -1318,25 +1318,7 @@ gimp_dockable_convert_tab_style (GimpDockable *dockable,
GtkWidget *child = gtk_bin_get_child (GTK_BIN (dockable));
if (child && ! GIMP_DOCKED_GET_INTERFACE (child)->get_preview)
{
switch (tab_style)
{
case GIMP_TAB_STYLE_PREVIEW:
tab_style = GIMP_TAB_STYLE_ICON;
break;
case GIMP_TAB_STYLE_PREVIEW_NAME:
tab_style = GIMP_TAB_STYLE_ICON_BLURB;
break;
case GIMP_TAB_STYLE_PREVIEW_BLURB:
tab_style = GIMP_TAB_STYLE_ICON_BLURB;
break;
default:
break;
}
}
tab_style = gimp_preview_tab_style_to_icon (tab_style);
return tab_style;
}
......
......@@ -429,6 +429,30 @@ gimp_get_icon_size (GtkWidget *widget,
return icon_size;
}
GimpTabStyle
gimp_preview_tab_style_to_icon (GimpTabStyle tab_style)
{
switch (tab_style)
{
case GIMP_TAB_STYLE_PREVIEW:
tab_style = GIMP_TAB_STYLE_ICON;
break;
case GIMP_TAB_STYLE_PREVIEW_NAME:
tab_style = GIMP_TAB_STYLE_ICON_NAME;
break;
case GIMP_TAB_STYLE_PREVIEW_BLURB:
tab_style = GIMP_TAB_STYLE_ICON_BLURB;
break;
default:
break;
}
return tab_style;
}
const gchar *
gimp_get_mod_name_shift (void)
{
......
......@@ -49,6 +49,7 @@ GtkIconSize gimp_get_icon_size (GtkWidget *widget
GtkIconSize max_size,
gint width,
gint height);
GimpTabStyle gimp_preview_tab_style_to_icon (GimpTabStyle tab_style);
const gchar * gimp_get_mod_name_shift (void);
const gchar * gimp_get_mod_name_control (void);
const gchar * gimp_get_mod_name_alt (void);
......
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