diff --git a/ChangeLog b/ChangeLog index 8b83886eb..11741bde9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2000-07-24 Pavel Cisler + + * libnautilus-extensions/nautilus-gdk-extensions.c: + * libnautilus-extensions/nautilus-gdk-extensions.h: + (nautilus_gdk_font_get_bold): + New K-rad call to get a bold flavor of a given font. + + * libnautilus-extensions/nautilus-gtk-extensions.c: + (nautilus_gtk_label_make_bold): + Add a convenience call to set a label to a bold font. + + * libnautilus-extensions/nautilus-gtk-extensions.h: + * src/file-manager/dfos-xfer-progress-dialog.c: + (create_titled_label), (dfos_xfer_progress_dialog_initialize): + Use bold labels where appropriate. + Make the To: From: and Copying: labels properly right-aligned. + Add a space between the labels and the paths to make it look nicer. + + * src/file-manager/dfos-xfer.c: + (progress_dialog_set_to_from_item_text): + Chop off the trailing '/' from to and from paths in the progress + dialog. + 2000-07-24 John Sullivan Fixed bug 1469 (changing owner/group doesn't handle diff --git a/libnautilus-extensions/nautilus-file-operations-progress.c b/libnautilus-extensions/nautilus-file-operations-progress.c index aee3d76aa..cef0eff18 100644 --- a/libnautilus-extensions/nautilus-file-operations-progress.c +++ b/libnautilus-extensions/nautilus-file-operations-progress.c @@ -34,7 +34,7 @@ #define LABEL_BOX_WIDTH 350 /* FIXME bugzilla.eazel.com 675: ? */ -#define OPERATION_LABEL_WIDTH 80 +#define OPERATION_LABEL_WIDTH 65 #define PATH_TRIM_WIDTH LABEL_BOX_WIDTH - OPERATION_LABEL_WIDTH - 2 * 20 static void dfos_xfer_progress_dialog_initialize_class (DFOSXferProgressDialogClass *klass); @@ -160,23 +160,25 @@ static void create_titled_label (GtkBox *vbox, GtkWidget **title_widget, GtkWidget **label_text_widget) { GtkWidget *hbox; - + hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 0); + gtk_box_pack_start (vbox, hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); gtk_widget_set_usize (hbox, LABEL_BOX_WIDTH, 0); - *title_widget = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), *title_widget, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), *title_widget, FALSE, FALSE, 2); gtk_widget_show (*title_widget); gtk_widget_set_usize (*title_widget, OPERATION_LABEL_WIDTH, 0); gtk_label_set_justify (GTK_LABEL (*title_widget), GTK_JUSTIFY_RIGHT); + gtk_misc_set_alignment (GTK_MISC (*title_widget), 1, 0); + nautilus_gtk_label_make_bold (GTK_LABEL (*title_widget)); *label_text_widget = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), *label_text_widget, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), *label_text_widget, FALSE, FALSE, 2); gtk_widget_show (*label_text_widget); gtk_label_set_justify (GTK_LABEL (*label_text_widget), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (*label_text_widget), 0, 0); } static void @@ -192,7 +194,7 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) vbox = GTK_BOX (gnome_dialog->vbox); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 0); + gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 3); gtk_widget_show (hbox); /* label- */ @@ -201,6 +203,8 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) gtk_label_set_justify (GTK_LABEL (dialog->details->progress_title_label), GTK_JUSTIFY_LEFT); gtk_box_pack_start (GTK_BOX (hbox), dialog->details->progress_title_label, FALSE, FALSE, 0); gtk_widget_show (dialog->details->progress_title_label); + nautilus_gtk_label_make_bold (GTK_LABEL (dialog->details->progress_title_label)); + /* label -- */ /* 24 of 30 */ @@ -208,6 +212,7 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) gtk_label_set_justify (GTK_LABEL (dialog->details->progress_count_label), GTK_JUSTIFY_RIGHT); gtk_box_pack_end (GTK_BOX (hbox), dialog->details->progress_count_label, FALSE, FALSE, 0); gtk_widget_show (dialog->details->progress_count_label); + nautilus_gtk_label_make_bold (GTK_LABEL (dialog->details->progress_count_label)); /* progress bar */ dialog->details->progress_bar = gtk_progress_bar_new (); diff --git a/libnautilus-extensions/nautilus-file-operations.c b/libnautilus-extensions/nautilus-file-operations.c index e054c243e..274b307b0 100644 --- a/libnautilus-extensions/nautilus-file-operations.c +++ b/libnautilus-extensions/nautilus-file-operations.c @@ -147,6 +147,7 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, const char *from_prefix; const char *to_prefix; GnomeVFSURI *uri; + int length; item = NULL; from_path = NULL; @@ -159,6 +160,13 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, uri = gnome_vfs_uri_new (from_uri); item = gnome_vfs_uri_extract_short_name (uri); from_path = gnome_vfs_uri_extract_dirname (uri); + + /* remove the last '/' */ + length = strlen (from_path); + if (from_path [length - 1] == '/') { + from_path [length - 1] = '\0'; + } + gnome_vfs_uri_unref (uri); g_assert (progress_verb); progress_label_text = g_strdup_printf ("%s:", progress_verb); @@ -168,6 +176,13 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, if (to_uri != NULL) { uri = gnome_vfs_uri_new (from_uri); to_path = gnome_vfs_uri_extract_dirname (uri); + + /* remove the last '/' */ + length = strlen (to_path); + if (to_path [length - 1] == '/') { + to_path [length - 1] = '\0'; + } + gnome_vfs_uri_unref (uri); to_prefix = _("To:"); } diff --git a/libnautilus-extensions/nautilus-gdk-extensions.c b/libnautilus-extensions/nautilus-gdk-extensions.c index 2df0948a7..396253157 100644 --- a/libnautilus-extensions/nautilus-gdk-extensions.c +++ b/libnautilus-extensions/nautilus-gdk-extensions.c @@ -19,13 +19,14 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Authors: Darin Adler + Authors: Darin Adler , Pavel Cisler */ #include #include "nautilus-gdk-extensions.h" #include #include +#include #include "nautilus-glib-extensions.h" #include "nautilus-lib-self-check-functions.h" #include "nautilus-string.h" @@ -646,6 +647,80 @@ nautilus_set_mini_icon (GdkWindow *window, (guchar *) data, 2); } +/** + * nautilus_gdk_font_get_bold + * @plain_font: A font. + * Returns: A bold variant of @plain_font or NULL. + * + * Tries to find a bold flavor of a given font. Returns NULL if none is available. + */ +GdkFont * +nautilus_gdk_font_get_bold (const GdkFont *plain_font) +{ + const char *plain_name; + const char *scanner; + char *bold_name; + int count; + GSList *p; + GdkFont *result; + GdkFontPrivate *private_plain; + + private_plain = (GdkFontPrivate *)plain_font; + + if (private_plain->names == NULL) { + return NULL; + } + + + /* -foundry-family-weight-slant-sel_width-add-style-pixels-points-hor_res-ver_res-spacing-average_width-char_set_registry-char_set_encoding */ + + bold_name = NULL; + for (p = private_plain->names; p != NULL; p = p->next) { + plain_name = (const char *)p->data; + scanner = plain_name; + + /* skip past foundry and family to weight */ + for (count = 2; count > 0; count--) { + scanner = strchr (scanner + 1, '-'); + if (!scanner) { + break; + } + } + + if (!scanner) { + /* try the other names in the list */ + continue; + } + g_assert (*scanner == '-'); + + /* copy "-foundry-family-" over */ + scanner++; + bold_name = g_strndup (plain_name, scanner - plain_name); + + /* skip weight */ + scanner = strchr (scanner, '-'); + g_assert (scanner != NULL); + + /* FIXME: + * some fonts have demibold, etc. instead. We should be able to figure out + * which they are and use them here. + */ + + /* add "bold" and copy everything past weight over */ + bold_name = g_strconcat (bold_name, "bold", scanner, NULL); + break; + } + + if (bold_name == NULL) { + return NULL; + } + + result = gdk_font_load (bold_name); + g_free (bold_name); + + return result; +} + #if ! defined (NAUTILUS_OMIT_SELF_CHECK) static char * diff --git a/libnautilus-extensions/nautilus-gdk-extensions.h b/libnautilus-extensions/nautilus-gdk-extensions.h index 56c8d5a02..afdba1316 100644 --- a/libnautilus-extensions/nautilus-gdk-extensions.h +++ b/libnautilus-extensions/nautilus-gdk-extensions.h @@ -105,6 +105,8 @@ gboolean nautilus_gdk_font_equal (GdkFont *font GdkFont * nautilus_get_largest_fitting_font (const char *text_to_format, int width, const char *font_format); +GdkFont * nautilus_gdk_font_get_bold (const GdkFont *plain); + /* Misc GdkWindow helper functions */ void nautilus_gdk_window_bring_to_front (GdkWindow *window); diff --git a/libnautilus-extensions/nautilus-gtk-extensions.c b/libnautilus-extensions/nautilus-gtk-extensions.c index d8a4715d5..790da26f7 100644 --- a/libnautilus-extensions/nautilus-gtk-extensions.c +++ b/libnautilus-extensions/nautilus-gtk-extensions.c @@ -26,6 +26,7 @@ #include #include "nautilus-gtk-extensions.h" +#include "nautilus-gdk-extensions.h" #include #include @@ -982,3 +983,30 @@ nautilus_gtk_adjustment_clamp_value (GtkAdjustment *adjustment) nautilus_gtk_adjustment_set_value (adjustment, adjustment->value); } + +/** + * nautilus_gtk_label_make_bold. + * + * Switches the font of label to a bold equivalent. + * @label: The label. + **/ + +void +nautilus_gtk_label_make_bold (GtkLabel *label) +{ + GtkStyle *style; + GdkFont *bold_font; + + g_return_if_fail (GTK_IS_LABEL (label)); + style = gtk_widget_get_style (GTK_WIDGET(label)); + + bold_font = nautilus_gdk_font_get_bold (style->font); + + if (bold_font == NULL) { + return; + } + + nautilus_gtk_widget_set_font (GTK_WIDGET(label), bold_font); + gdk_font_unref (bold_font); +} + diff --git a/libnautilus-extensions/nautilus-gtk-extensions.h b/libnautilus-extensions/nautilus-gtk-extensions.h index c11b0017f..acdcc448c 100644 --- a/libnautilus-extensions/nautilus-gtk-extensions.h +++ b/libnautilus-extensions/nautilus-gtk-extensions.h @@ -104,6 +104,9 @@ void nautilus_gtk_style_set_font (GtkStyle void nautilus_gtk_style_set_font_by_name (GtkStyle *style, const char *font_name); +/* GtkLabel */ +void nautilus_gtk_label_make_bold (GtkLabel *label); + /* GtkPixmap */ GtkPixmap *nautilus_gtk_pixmap_new_empty (void); diff --git a/libnautilus-private/nautilus-file-operations-progress.c b/libnautilus-private/nautilus-file-operations-progress.c index aee3d76aa..cef0eff18 100644 --- a/libnautilus-private/nautilus-file-operations-progress.c +++ b/libnautilus-private/nautilus-file-operations-progress.c @@ -34,7 +34,7 @@ #define LABEL_BOX_WIDTH 350 /* FIXME bugzilla.eazel.com 675: ? */ -#define OPERATION_LABEL_WIDTH 80 +#define OPERATION_LABEL_WIDTH 65 #define PATH_TRIM_WIDTH LABEL_BOX_WIDTH - OPERATION_LABEL_WIDTH - 2 * 20 static void dfos_xfer_progress_dialog_initialize_class (DFOSXferProgressDialogClass *klass); @@ -160,23 +160,25 @@ static void create_titled_label (GtkBox *vbox, GtkWidget **title_widget, GtkWidget **label_text_widget) { GtkWidget *hbox; - + hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 0); + gtk_box_pack_start (vbox, hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); gtk_widget_set_usize (hbox, LABEL_BOX_WIDTH, 0); - *title_widget = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), *title_widget, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), *title_widget, FALSE, FALSE, 2); gtk_widget_show (*title_widget); gtk_widget_set_usize (*title_widget, OPERATION_LABEL_WIDTH, 0); gtk_label_set_justify (GTK_LABEL (*title_widget), GTK_JUSTIFY_RIGHT); + gtk_misc_set_alignment (GTK_MISC (*title_widget), 1, 0); + nautilus_gtk_label_make_bold (GTK_LABEL (*title_widget)); *label_text_widget = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), *label_text_widget, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), *label_text_widget, FALSE, FALSE, 2); gtk_widget_show (*label_text_widget); gtk_label_set_justify (GTK_LABEL (*label_text_widget), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (*label_text_widget), 0, 0); } static void @@ -192,7 +194,7 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) vbox = GTK_BOX (gnome_dialog->vbox); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 0); + gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 3); gtk_widget_show (hbox); /* label- */ @@ -201,6 +203,8 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) gtk_label_set_justify (GTK_LABEL (dialog->details->progress_title_label), GTK_JUSTIFY_LEFT); gtk_box_pack_start (GTK_BOX (hbox), dialog->details->progress_title_label, FALSE, FALSE, 0); gtk_widget_show (dialog->details->progress_title_label); + nautilus_gtk_label_make_bold (GTK_LABEL (dialog->details->progress_title_label)); + /* label -- */ /* 24 of 30 */ @@ -208,6 +212,7 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) gtk_label_set_justify (GTK_LABEL (dialog->details->progress_count_label), GTK_JUSTIFY_RIGHT); gtk_box_pack_end (GTK_BOX (hbox), dialog->details->progress_count_label, FALSE, FALSE, 0); gtk_widget_show (dialog->details->progress_count_label); + nautilus_gtk_label_make_bold (GTK_LABEL (dialog->details->progress_count_label)); /* progress bar */ dialog->details->progress_bar = gtk_progress_bar_new (); diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c index e054c243e..274b307b0 100644 --- a/libnautilus-private/nautilus-file-operations.c +++ b/libnautilus-private/nautilus-file-operations.c @@ -147,6 +147,7 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, const char *from_prefix; const char *to_prefix; GnomeVFSURI *uri; + int length; item = NULL; from_path = NULL; @@ -159,6 +160,13 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, uri = gnome_vfs_uri_new (from_uri); item = gnome_vfs_uri_extract_short_name (uri); from_path = gnome_vfs_uri_extract_dirname (uri); + + /* remove the last '/' */ + length = strlen (from_path); + if (from_path [length - 1] == '/') { + from_path [length - 1] = '\0'; + } + gnome_vfs_uri_unref (uri); g_assert (progress_verb); progress_label_text = g_strdup_printf ("%s:", progress_verb); @@ -168,6 +176,13 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, if (to_uri != NULL) { uri = gnome_vfs_uri_new (from_uri); to_path = gnome_vfs_uri_extract_dirname (uri); + + /* remove the last '/' */ + length = strlen (to_path); + if (to_path [length - 1] == '/') { + to_path [length - 1] = '\0'; + } + gnome_vfs_uri_unref (uri); to_prefix = _("To:"); } diff --git a/libnautilus-private/nautilus-gdk-extensions.c b/libnautilus-private/nautilus-gdk-extensions.c index 2df0948a7..396253157 100644 --- a/libnautilus-private/nautilus-gdk-extensions.c +++ b/libnautilus-private/nautilus-gdk-extensions.c @@ -19,13 +19,14 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Authors: Darin Adler + Authors: Darin Adler , Pavel Cisler */ #include #include "nautilus-gdk-extensions.h" #include #include +#include #include "nautilus-glib-extensions.h" #include "nautilus-lib-self-check-functions.h" #include "nautilus-string.h" @@ -646,6 +647,80 @@ nautilus_set_mini_icon (GdkWindow *window, (guchar *) data, 2); } +/** + * nautilus_gdk_font_get_bold + * @plain_font: A font. + * Returns: A bold variant of @plain_font or NULL. + * + * Tries to find a bold flavor of a given font. Returns NULL if none is available. + */ +GdkFont * +nautilus_gdk_font_get_bold (const GdkFont *plain_font) +{ + const char *plain_name; + const char *scanner; + char *bold_name; + int count; + GSList *p; + GdkFont *result; + GdkFontPrivate *private_plain; + + private_plain = (GdkFontPrivate *)plain_font; + + if (private_plain->names == NULL) { + return NULL; + } + + + /* -foundry-family-weight-slant-sel_width-add-style-pixels-points-hor_res-ver_res-spacing-average_width-char_set_registry-char_set_encoding */ + + bold_name = NULL; + for (p = private_plain->names; p != NULL; p = p->next) { + plain_name = (const char *)p->data; + scanner = plain_name; + + /* skip past foundry and family to weight */ + for (count = 2; count > 0; count--) { + scanner = strchr (scanner + 1, '-'); + if (!scanner) { + break; + } + } + + if (!scanner) { + /* try the other names in the list */ + continue; + } + g_assert (*scanner == '-'); + + /* copy "-foundry-family-" over */ + scanner++; + bold_name = g_strndup (plain_name, scanner - plain_name); + + /* skip weight */ + scanner = strchr (scanner, '-'); + g_assert (scanner != NULL); + + /* FIXME: + * some fonts have demibold, etc. instead. We should be able to figure out + * which they are and use them here. + */ + + /* add "bold" and copy everything past weight over */ + bold_name = g_strconcat (bold_name, "bold", scanner, NULL); + break; + } + + if (bold_name == NULL) { + return NULL; + } + + result = gdk_font_load (bold_name); + g_free (bold_name); + + return result; +} + #if ! defined (NAUTILUS_OMIT_SELF_CHECK) static char * diff --git a/libnautilus-private/nautilus-gdk-extensions.h b/libnautilus-private/nautilus-gdk-extensions.h index 56c8d5a02..afdba1316 100644 --- a/libnautilus-private/nautilus-gdk-extensions.h +++ b/libnautilus-private/nautilus-gdk-extensions.h @@ -105,6 +105,8 @@ gboolean nautilus_gdk_font_equal (GdkFont *font GdkFont * nautilus_get_largest_fitting_font (const char *text_to_format, int width, const char *font_format); +GdkFont * nautilus_gdk_font_get_bold (const GdkFont *plain); + /* Misc GdkWindow helper functions */ void nautilus_gdk_window_bring_to_front (GdkWindow *window); diff --git a/libnautilus-private/nautilus-gtk-extensions.c b/libnautilus-private/nautilus-gtk-extensions.c index d8a4715d5..790da26f7 100644 --- a/libnautilus-private/nautilus-gtk-extensions.c +++ b/libnautilus-private/nautilus-gtk-extensions.c @@ -26,6 +26,7 @@ #include #include "nautilus-gtk-extensions.h" +#include "nautilus-gdk-extensions.h" #include #include @@ -982,3 +983,30 @@ nautilus_gtk_adjustment_clamp_value (GtkAdjustment *adjustment) nautilus_gtk_adjustment_set_value (adjustment, adjustment->value); } + +/** + * nautilus_gtk_label_make_bold. + * + * Switches the font of label to a bold equivalent. + * @label: The label. + **/ + +void +nautilus_gtk_label_make_bold (GtkLabel *label) +{ + GtkStyle *style; + GdkFont *bold_font; + + g_return_if_fail (GTK_IS_LABEL (label)); + style = gtk_widget_get_style (GTK_WIDGET(label)); + + bold_font = nautilus_gdk_font_get_bold (style->font); + + if (bold_font == NULL) { + return; + } + + nautilus_gtk_widget_set_font (GTK_WIDGET(label), bold_font); + gdk_font_unref (bold_font); +} + diff --git a/libnautilus-private/nautilus-gtk-extensions.h b/libnautilus-private/nautilus-gtk-extensions.h index c11b0017f..acdcc448c 100644 --- a/libnautilus-private/nautilus-gtk-extensions.h +++ b/libnautilus-private/nautilus-gtk-extensions.h @@ -104,6 +104,9 @@ void nautilus_gtk_style_set_font (GtkStyle void nautilus_gtk_style_set_font_by_name (GtkStyle *style, const char *font_name); +/* GtkLabel */ +void nautilus_gtk_label_make_bold (GtkLabel *label); + /* GtkPixmap */ GtkPixmap *nautilus_gtk_pixmap_new_empty (void); diff --git a/src/file-manager/dfos-xfer-progress-dialog.c b/src/file-manager/dfos-xfer-progress-dialog.c index aee3d76aa..cef0eff18 100644 --- a/src/file-manager/dfos-xfer-progress-dialog.c +++ b/src/file-manager/dfos-xfer-progress-dialog.c @@ -34,7 +34,7 @@ #define LABEL_BOX_WIDTH 350 /* FIXME bugzilla.eazel.com 675: ? */ -#define OPERATION_LABEL_WIDTH 80 +#define OPERATION_LABEL_WIDTH 65 #define PATH_TRIM_WIDTH LABEL_BOX_WIDTH - OPERATION_LABEL_WIDTH - 2 * 20 static void dfos_xfer_progress_dialog_initialize_class (DFOSXferProgressDialogClass *klass); @@ -160,23 +160,25 @@ static void create_titled_label (GtkBox *vbox, GtkWidget **title_widget, GtkWidget **label_text_widget) { GtkWidget *hbox; - + hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 0); + gtk_box_pack_start (vbox, hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); gtk_widget_set_usize (hbox, LABEL_BOX_WIDTH, 0); - *title_widget = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), *title_widget, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), *title_widget, FALSE, FALSE, 2); gtk_widget_show (*title_widget); gtk_widget_set_usize (*title_widget, OPERATION_LABEL_WIDTH, 0); gtk_label_set_justify (GTK_LABEL (*title_widget), GTK_JUSTIFY_RIGHT); + gtk_misc_set_alignment (GTK_MISC (*title_widget), 1, 0); + nautilus_gtk_label_make_bold (GTK_LABEL (*title_widget)); *label_text_widget = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (hbox), *label_text_widget, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), *label_text_widget, FALSE, FALSE, 2); gtk_widget_show (*label_text_widget); gtk_label_set_justify (GTK_LABEL (*label_text_widget), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (*label_text_widget), 0, 0); } static void @@ -192,7 +194,7 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) vbox = GTK_BOX (gnome_dialog->vbox); hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 0); + gtk_box_pack_start (vbox, hbox, TRUE, TRUE, 3); gtk_widget_show (hbox); /* label- */ @@ -201,6 +203,8 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) gtk_label_set_justify (GTK_LABEL (dialog->details->progress_title_label), GTK_JUSTIFY_LEFT); gtk_box_pack_start (GTK_BOX (hbox), dialog->details->progress_title_label, FALSE, FALSE, 0); gtk_widget_show (dialog->details->progress_title_label); + nautilus_gtk_label_make_bold (GTK_LABEL (dialog->details->progress_title_label)); + /* label -- */ /* 24 of 30 */ @@ -208,6 +212,7 @@ dfos_xfer_progress_dialog_initialize (DFOSXferProgressDialog *dialog) gtk_label_set_justify (GTK_LABEL (dialog->details->progress_count_label), GTK_JUSTIFY_RIGHT); gtk_box_pack_end (GTK_BOX (hbox), dialog->details->progress_count_label, FALSE, FALSE, 0); gtk_widget_show (dialog->details->progress_count_label); + nautilus_gtk_label_make_bold (GTK_LABEL (dialog->details->progress_count_label)); /* progress bar */ dialog->details->progress_bar = gtk_progress_bar_new (); diff --git a/src/file-manager/dfos-xfer.c b/src/file-manager/dfos-xfer.c index e054c243e..274b307b0 100644 --- a/src/file-manager/dfos-xfer.c +++ b/src/file-manager/dfos-xfer.c @@ -147,6 +147,7 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, const char *from_prefix; const char *to_prefix; GnomeVFSURI *uri; + int length; item = NULL; from_path = NULL; @@ -159,6 +160,13 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, uri = gnome_vfs_uri_new (from_uri); item = gnome_vfs_uri_extract_short_name (uri); from_path = gnome_vfs_uri_extract_dirname (uri); + + /* remove the last '/' */ + length = strlen (from_path); + if (from_path [length - 1] == '/') { + from_path [length - 1] = '\0'; + } + gnome_vfs_uri_unref (uri); g_assert (progress_verb); progress_label_text = g_strdup_printf ("%s:", progress_verb); @@ -168,6 +176,13 @@ progress_dialog_set_to_from_item_text (DFOSXferProgressDialog *dialog, if (to_uri != NULL) { uri = gnome_vfs_uri_new (from_uri); to_path = gnome_vfs_uri_extract_dirname (uri); + + /* remove the last '/' */ + length = strlen (to_path); + if (to_path [length - 1] == '/') { + to_path [length - 1] = '\0'; + } + gnome_vfs_uri_unref (uri); to_prefix = _("To:"); }