aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-folder-title-bar.c
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-05-31 08:24:59 +0800
committerJacob Leach <jleach@src.gnome.org>2001-05-31 08:24:59 +0800
commit65460ea5357a9f5638d3f6d816a97a9428971f31 (patch)
tree7fbfaca6689cdcd9dfed9c6dfa4c30a637cfbf07 /shell/e-shell-folder-title-bar.c
parentfc68923b1110d26c8d5185adaa701dd9a34991fa (diff)
downloadgsoc2013-evolution-65460ea5357a9f5638d3f6d816a97a9428971f31.tar
gsoc2013-evolution-65460ea5357a9f5638d3f6d816a97a9428971f31.tar.gz
gsoc2013-evolution-65460ea5357a9f5638d3f6d816a97a9428971f31.tar.bz2
gsoc2013-evolution-65460ea5357a9f5638d3f6d816a97a9428971f31.tar.lz
gsoc2013-evolution-65460ea5357a9f5638d3f6d816a97a9428971f31.tar.xz
gsoc2013-evolution-65460ea5357a9f5638d3f6d816a97a9428971f31.tar.zst
gsoc2013-evolution-65460ea5357a9f5638d3f6d816a97a9428971f31.zip
New function (probably should just be static).
2001-05-30 Jason Leach <jleach@ximian.com> * e-shell-view.c (e_shell_view_set_current_shortcuts_group_num): New function (probably should just be static). (e_shell_view_load_settings): Load the current shortcut group here using the above new function. (e_shell_view_save_settings): Save current shortcut group in here. 2001-05-30 Jason Leach <jleach@ximian.com> * e-shell-folder-title-bar.c: New 'folder_bar_label' member for EShellFolderTitleBar, it's for information that's shown to the left of the icon like the dates in the calendar (or, potentially total and unread numbers for mailer). (e_shell_folder_title_bar_set_folder_bar_label): New function, lets others set the title bar extra label. * Evolution-ShellView.idl: New method 'setFolderBarLabel' for our exposed ShellView interface. * evolution-shell-view.c (class_init): New signal "set_folder_bar_label" for EvolutionShellViewClass. * evolution-shell-view.c (impl_ShellView_set_folder_bar_label): Emit the new signal here. * e-shell-view.c (setup_corba_interface): Connect the signal here. * e-shell-view.c (corba_interface_set_folder_bar_label): New function, callback for the above signals, does the actual extra label setting for the folder title bar. * e-shell-folder-commands.c (e_shell_command_add_to_shortcut_bar): Fix a warning here. svn path=/trunk/; revision=10059
Diffstat (limited to 'shell/e-shell-folder-title-bar.c')
-rw-r--r--shell/e-shell-folder-title-bar.c49
1 files changed, 43 insertions, 6 deletions
diff --git a/shell/e-shell-folder-title-bar.c b/shell/e-shell-folder-title-bar.c
index 2ad59f507f..514d5141ac 100644
--- a/shell/e-shell-folder-title-bar.c
+++ b/shell/e-shell-folder-title-bar.c
@@ -50,15 +50,19 @@ struct _EShellFolderTitleBarPrivate {
GdkPixbuf *icon;
GtkWidget *icon_widget;
- /* The hbox containing the button, the label and the icon on the right. */
+ /* The hbox containing the button, the label, the extra label, and the icon on the right. */
GtkWidget *hbox;
- /* We have a label and a button. When the button is enabled, the label is hidden;
- when the button is disable, only the label is visible. */
+ /* We have a label and a button. When the button is enabled,
+ the label is hidden; when the button is disable, only the
+ label is visible. */
/* The label. */
GtkWidget *label;
+ /* Holds extra information that is to be shown to the left of the icon */
+ GtkWidget *folder_bar_label;
+
/* The button. */
GtkWidget *button;
GtkWidget *button_label;
@@ -269,8 +273,8 @@ realize (GtkWidget *widget)
gtk_widget_show (priv->icon_widget);
gtk_misc_set_alignment (GTK_MISC (priv->icon_widget), 1.0, .5);
- gtk_misc_set_padding (GTK_MISC (priv->icon_widget), 5, 0);
- gtk_box_pack_start (GTK_BOX (priv->hbox), priv->icon_widget, TRUE, TRUE, 2);
+ gtk_misc_set_padding (GTK_MISC (priv->icon_widget), 0, 0);
+ gtk_box_pack_start (GTK_BOX (priv->hbox), priv->icon_widget, FALSE, FALSE, 2);
}
static void
@@ -345,6 +349,7 @@ init (EShellFolderTitleBar *shell_folder_title_bar)
priv->icon_widget = NULL;
priv->hbox = NULL;
priv->label = NULL;
+ priv->folder_bar_label = NULL;
priv->button_label = NULL;
priv->button = NULL;
priv->button_arrow = NULL;
@@ -375,9 +380,12 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
widget = GTK_WIDGET (folder_title_bar);
priv->label = gtk_label_new ("");
- gtk_misc_set_padding (GTK_MISC (priv->label), 5, 0);
gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
+ priv->folder_bar_label = gtk_label_new ("");
+ gtk_misc_set_alignment (GTK_MISC (priv->folder_bar_label), 1.0, 0.5);
+ gtk_widget_show (priv->folder_bar_label);
+
priv->button_label = gtk_label_new ("");
gtk_misc_set_padding (GTK_MISC (priv->button_label), 5, 0);
gtk_misc_set_alignment (GTK_MISC (priv->button_label), 0.0, 0.5);
@@ -399,6 +407,7 @@ e_shell_folder_title_bar_construct (EShellFolderTitleBar *folder_title_bar)
gtk_container_set_border_width (GTK_CONTAINER (priv->hbox), 2);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->label, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->button, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (priv->hbox), priv->folder_bar_label, TRUE, TRUE, 0);
gtk_widget_show (priv->hbox);
@@ -468,6 +477,34 @@ e_shell_folder_title_bar_set_title (EShellFolderTitleBar *folder_title_bar,
}
/**
+ * e_shell_folder_title_bar_set_folder_bar_label:
+ * @folder_title_bar:
+ * @text: Some text to show in the label.
+ *
+ * Sets the right-justified text label (to the left of the icon) for
+ * the title bar.
+ **/
+void
+e_shell_folder_title_bar_set_folder_bar_label (EShellFolderTitleBar *folder_title_bar,
+ const char *text)
+{
+ EShellFolderTitleBarPrivate *priv;
+
+ g_return_if_fail (folder_title_bar != NULL);
+ g_return_if_fail (E_IS_SHELL_FOLDER_TITLE_BAR (folder_title_bar));
+
+ priv = folder_title_bar->priv;
+
+ if (text == NULL)
+ gtk_label_set_text (GTK_LABEL (priv->folder_bar_label), "");
+ else
+ gtk_label_set_text (GTK_LABEL (priv->folder_bar_label), text);
+
+ /* FIXME: Might want to set the styles somewhere in here too,
+ black text on grey background isn't the best combination */
+}
+
+/**
* e_shell_folder_title_bar_set_icon:
* @folder_title_bar:
* @icon: