set the full name as tooltip.
2007-06-26 Sven Neumann <sven@gimp.org> * app/widgets/gimpimagepropview.c (gimp_image_prop_view_label_set_filename): set the full name as tooltip. svn path=/trunk/; revision=22835
This commit is contained in:

committed by
Sven Neumann

parent
7aa01e3120
commit
fd19774c3f
@ -1,3 +1,9 @@
|
||||
2007-06-26 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimpimagepropview.c
|
||||
(gimp_image_prop_view_label_set_filename): set the full name as
|
||||
tooltip.
|
||||
|
||||
2007-06-25 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/gimp-transform-resize.c: applied patch from Geert
|
||||
|
@ -77,6 +77,10 @@ static void gimp_image_prop_view_get_property (GObject *object,
|
||||
static GtkWidget * gimp_image_prop_view_add_label (GtkTable *table,
|
||||
gint row,
|
||||
const gchar *text);
|
||||
static GtkWidget * gimp_image_prop_view_add_label_with_tooltip
|
||||
(GtkTable *table,
|
||||
gint row,
|
||||
const gchar *text);
|
||||
static void gimp_image_prop_view_undo_event (GimpImage *image,
|
||||
GimpUndoEvent event,
|
||||
GimpUndo *undo,
|
||||
@ -132,7 +136,7 @@ gimp_image_prop_view_init (GimpImagePropView *view)
|
||||
gtk_table_set_row_spacing (GTK_TABLE (view), row++, 12);
|
||||
|
||||
view->filename_label =
|
||||
gimp_image_prop_view_add_label (table, row++, _("File Name:"));
|
||||
gimp_image_prop_view_add_label_with_tooltip (table, row++, _("File Name:"));
|
||||
|
||||
view->filesize_label =
|
||||
gimp_image_prop_view_add_label (table, row++, _("File Size:"));
|
||||
@ -268,12 +272,14 @@ gimp_image_prop_view_new (GimpImage *image)
|
||||
/* private functions */
|
||||
|
||||
static GtkWidget *
|
||||
gimp_image_prop_view_add_label (GtkTable *table,
|
||||
gint row,
|
||||
const gchar *text)
|
||||
gimp_image_prop_view_add_label_full (GtkTable *table,
|
||||
gint row,
|
||||
const gchar *text,
|
||||
gboolean tooltip)
|
||||
{
|
||||
GtkWidget *label;
|
||||
GtkWidget *desc;
|
||||
GtkWidget *ebox;
|
||||
|
||||
desc = g_object_new (GTK_TYPE_LABEL,
|
||||
"label", text,
|
||||
@ -287,18 +293,47 @@ gimp_image_prop_view_add_label (GtkTable *table,
|
||||
0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (desc);
|
||||
|
||||
if (tooltip)
|
||||
{
|
||||
ebox = gtk_event_box_new ();
|
||||
gtk_table_attach (table, ebox,
|
||||
1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (ebox);
|
||||
}
|
||||
|
||||
label = g_object_new (GTK_TYPE_LABEL,
|
||||
"xalign", 0.0,
|
||||
"yalign", 0.5,
|
||||
"selectable", TRUE,
|
||||
NULL);
|
||||
gtk_table_attach (table, label,
|
||||
1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
||||
if (tooltip)
|
||||
gtk_container_add (GTK_CONTAINER (ebox), label);
|
||||
else
|
||||
gtk_table_attach (table, label,
|
||||
1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
||||
gtk_widget_show (label);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
gimp_image_prop_view_add_label (GtkTable *table,
|
||||
gint row,
|
||||
const gchar *text)
|
||||
{
|
||||
return gimp_image_prop_view_add_label_full (table, row, text, FALSE);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
gimp_image_prop_view_add_label_with_tooltip (GtkTable *table,
|
||||
gint row,
|
||||
const gchar *text)
|
||||
{
|
||||
return gimp_image_prop_view_add_label_full (table, row, text, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_image_prop_view_label_set_memsize (GtkWidget *label,
|
||||
GimpObject *object)
|
||||
@ -317,14 +352,20 @@ gimp_image_prop_view_label_set_filename (GtkWidget *label,
|
||||
|
||||
if (uri)
|
||||
{
|
||||
gchar *name = file_utils_uri_display_basename (uri);
|
||||
gchar *name;
|
||||
|
||||
name = file_utils_uri_display_basename (uri);
|
||||
gtk_label_set_text (GTK_LABEL (label), name);
|
||||
g_free (name);
|
||||
|
||||
name = file_utils_uri_display_name (uri);
|
||||
gimp_help_set_help_data (gtk_widget_get_parent (label), name, NULL);
|
||||
g_free (name);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_label_set_text (GTK_LABEL (label), NULL);
|
||||
gimp_help_set_help_data (gtk_widget_get_parent (label), NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user