Skip to content

Commit

Permalink
show histogram label in the title
Browse files Browse the repository at this point in the history
adjusted label texts
  • Loading branch information
nadvornik committed Feb 28, 2009
1 parent f9936e3 commit f3d61f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
8 changes: 2 additions & 6 deletions src/bar_histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ static void bar_pane_histogram_update(PaneHistogramData *phd)
if (phd->pixbuf) g_object_unref(phd->pixbuf);
phd->pixbuf = NULL;

gtk_label_set_text(GTK_LABEL(phd->pane.title), histogram_label(phd->histogram));

if (!phd->histogram_width || !phd->histogram_height || !phd->fd) return;

/* histmap_get is relatively expensive, run it only when we really need it
Expand Down Expand Up @@ -87,9 +89,6 @@ static gboolean bar_pane_histogram_update_cb(gpointer data)
gdk_pixbuf_fill(phd->pixbuf, 0xffffffff);
histogram_draw(phd->histogram, histmap, phd->pixbuf, 0, 0, phd->histogram_width, phd->histogram_height);

#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(phd->drawing_area, histogram_label(phd->histogram));
#endif
return FALSE;
}

Expand Down Expand Up @@ -365,9 +364,6 @@ GtkWidget *bar_pane_histogram_new(const gchar *title, gint height, gboolean expa

g_signal_connect(G_OBJECT(phd->drawing_area), "button_press_event", G_CALLBACK(bar_pane_histogram_press_cb), phd);

#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(phd->drawing_area, histogram_label(phd->histogram));
#endif
gtk_widget_show(phd->widget);

file_data_register_notify_func(bar_pane_histogram_notify_cb, phd, NOTIFY_PRIORITY_LOW);
Expand Down
20 changes: 10 additions & 10 deletions src/histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ const gchar *histogram_label(Histogram *histogram)
if (histogram->histogram_mode)
switch (histogram->histogram_channel)
{
case HCHAN_R: t1 = _("logarithmical histogram on red"); break;
case HCHAN_G: t1 = _("logarithmical histogram on green"); break;
case HCHAN_B: t1 = _("logarithmical histogram on blue"); break;
case HCHAN_RGB: t1 = _("logarithmical histogram on RGB"); break;
case HCHAN_MAX: t1 = _("logarithmical histogram on max value"); break;
case HCHAN_R: t1 = _("Log Histogram on Red"); break;
case HCHAN_G: t1 = _("Log Histogram on Green"); break;
case HCHAN_B: t1 = _("Log Histogram on Blue"); break;
case HCHAN_RGB: t1 = _("Log Histogram on RGB"); break;
case HCHAN_MAX: t1 = _("Log Histogram on max value"); break;
}
else
switch (histogram->histogram_channel)
{
case HCHAN_R: t1 = _("linear histogram on red"); break;
case HCHAN_G: t1 = _("linear histogram on green"); break;
case HCHAN_B: t1 = _("linear histogram on blue"); break;
case HCHAN_RGB: t1 = _("linear histogram on RGB"); break;
case HCHAN_MAX: t1 = _("linear histogram on max value"); break;
case HCHAN_R: t1 = _("Linear Histogram on Red"); break;
case HCHAN_G: t1 = _("Linear Histogram on Green"); break;
case HCHAN_B: t1 = _("Linear Histogram on Blue"); break;
case HCHAN_RGB: t1 = _("Linear Histogram on RGB"); break;
case HCHAN_MAX: t1 = _("Linear Histogram on max value"); break;
}
return t1;
}
Expand Down

0 comments on commit f3d61f4

Please sign in to comment.