Skip to content

Commit

Permalink
Use a common function bar_pane_expander_title() to set expanders titl…
Browse files Browse the repository at this point in the history
…e widget.
  • Loading branch information
Laurent Monin committed Mar 7, 2009
1 parent e4c7b67 commit fbe1332
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,14 @@ GtkWidget *bar_new_from_config(LayoutWindow *lw, const gchar **attribute_names,
return bar;
}

GtkWidget *bar_pane_expander_title(const gchar *title)
{
GtkWidget *widget = gtk_label_new(title);

pref_label_bold(widget, TRUE, FALSE);
//gtk_label_set_ellipsize(GTK_LABEL(widget), PANGO_ELLIPSIZE_END); //FIXME: do not work

return widget;
}

/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
2 changes: 2 additions & 0 deletions src/bar.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ gint bar_event(GtkWidget *bar, GdkEvent *event);

gint bar_get_width(GtkWidget *bar);

GtkWidget *bar_pane_expander_title(const gchar *title);

#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
3 changes: 1 addition & 2 deletions src/bar_comment.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ GtkWidget *bar_pane_comment_new(const gchar *title, const gchar *key, gboolean e
pcd->pane.pane_set_fd = bar_pane_comment_set_fd;
pcd->pane.pane_event = bar_pane_comment_event;
pcd->pane.pane_write_config = bar_pane_comment_write_config;
pcd->pane.title = gtk_label_new(title);
pref_label_bold(pcd->pane.title, TRUE, FALSE);
pcd->pane.title = bar_pane_expander_title(title);

pcd->pane.expanded = expanded;

Expand Down
3 changes: 1 addition & 2 deletions src/bar_exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,7 @@ GtkWidget *bar_pane_exif_new(const gchar *title, gboolean expanded, gboolean pop

ped->pane.pane_set_fd = bar_pane_exif_set_fd;
ped->pane.pane_write_config = bar_pane_exif_write_config;
ped->pane.title = gtk_label_new(title);
pref_label_bold(ped->pane.title, TRUE, FALSE);
ped->pane.title = bar_pane_expander_title(title);
ped->pane.expanded = expanded;

ped->size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
Expand Down
3 changes: 1 addition & 2 deletions src/bar_histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ GtkWidget *bar_pane_histogram_new(const gchar *title, gint height, gboolean expa

phd->pane.pane_set_fd = bar_pane_histogram_set_fd;
phd->pane.pane_write_config = bar_pane_histogram_write_config;
phd->pane.title = gtk_label_new(title);
pref_label_bold(phd->pane.title, TRUE, FALSE);
phd->pane.title = bar_pane_expander_title(title);

phd->pane.expanded = expanded;
phd->idle_id = -1;
Expand Down
3 changes: 1 addition & 2 deletions src/bar_keywords.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,7 @@ GtkWidget *bar_pane_keywords_new(const gchar *title, const gchar *key, gboolean
pkd->pane.pane_set_fd = bar_pane_keywords_set_fd;
pkd->pane.pane_event = bar_pane_keywords_event;
pkd->pane.pane_write_config = bar_pane_keywords_write_config;
pkd->pane.title = gtk_label_new(title);
pref_label_bold(pkd->pane.title, TRUE, FALSE);
pkd->pane.title = bar_pane_expander_title(title);

pkd->pane.expanded = expanded;

Expand Down

0 comments on commit fbe1332

Please sign in to comment.