diff options
author | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-08-29 02:11:38 +0000 |
---|---|---|
committer | Ramiro Estrugo <ramiro@src.gnome.org> | 2000-08-29 02:11:38 +0000 |
commit | f7276747ab4240532078ae7d4385ef0a705f82a0 (patch) | |
tree | cdca9cedf1cdcfb29d1f4c3cde3ddd37df7f6b47 /src | |
parent | b23f4b14cc0553f49e3fd42441ed4832b13a6023 (diff) | |
download | nautilus-f7276747ab4240532078ae7d4385ef0a705f82a0.tar.gz |
Add unref/ref functions for gcs that take NULL.
* libnautilus-extensions/nautilus-buffered-widget.c:
(nautilus_buffered_widget_initialize),
(nautilus_buffered_widget_destroy),
(buffered_widget_update_pixbuf),
(create_background_pixbuf_from_none),
(create_background_pixbuf_from_solid),
(create_background_pixbuf_from_ancestor),
(create_background_pixbuf),
(nautilus_buffered_widget_get_vertical_offset),
(nautilus_buffered_widget_set_background_type),
(nautilus_buffered_widget_get_background_type),
(nautilus_buffered_widget_set_background_color),
(nautilus_buffered_widget_get_background_color):
* libnautilus-extensions/nautilus-buffered-widget.h:
* libnautilus-extensions/nautilus-gdk-extensions.c:
(nautilus_gdk_gc_ref_if_not_null),
(nautilus_gdk_gc_unref_if_not_null):
* libnautilus-extensions/nautilus-gdk-extensions.h:
Add unref/ref functions for gcs that take NULL.
* libnautilus-extensions/nautilus-label.c: (nautilus_label_new):
* libnautilus-extensions/nautilus-label.h:
Make the constructor work just like GtkLabel by accepting a string.
* components/music/nautilus-music-view.c:
(nautilus_music_view_initialize), (add_play_controls):
Use the new NautilusLabel constructor.
* components/services/nautilus-dependent-shared/shared-service-widg
ets.c: (create_label_widget):
Use the new NautilusLabel constructor.
* src/nautilus-first-time-druid.c: (make_anti_aliased_label),
(set_up_update_feedback_page):
Use the new NautilusLabel constructor.
* src/nautilus-property-browser.c:
(nautilus_property_browser_initialize),
(make_properties_from_directory_path),
(make_properties_from_xml_node), (make_category_link):
Use the new NautilusLabel constructor.
Fix the tile names to be antialises by using the new buffered
widget SOLID background mode.
* src/nautilus-sidebar-title.c:
(sidebar_create_smooth_components_if_needed):
Use the new NautilusLabel constructor.
* src/nautilus-theme-selector.c:
(nautilus_theme_selector_initialize):
Use the new NautilusLabel constructor.
* test/test-nautilus-image.c: (main):
* test/test-nautilus-label.c: (main):
Use the new NautilusLabel constructor.
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-first-time-druid.c | 8 | ||||
-rw-r--r-- | src/nautilus-property-browser.c | 33 | ||||
-rw-r--r-- | src/nautilus-sidebar-title.c | 4 | ||||
-rw-r--r-- | src/nautilus-theme-selector.c | 20 |
4 files changed, 20 insertions, 45 deletions
diff --git a/src/nautilus-first-time-druid.c b/src/nautilus-first-time-druid.c index d26449f2d..57290b852 100644 --- a/src/nautilus-first-time-druid.c +++ b/src/nautilus-first-time-druid.c @@ -195,18 +195,17 @@ update_selection_changed (GtkWidget *radio_buttons, gpointer user_data) /* utility to allocate an anti-aliased description label */ static GtkWidget* -make_anti_aliased_label (const char *description) +make_anti_aliased_label (const char *text) { GtkWidget *label; - label = nautilus_label_new (); + label = nautilus_label_new (text); nautilus_label_set_font_from_components (NAUTILUS_LABEL (label), "helvetica", "medium", NULL, NULL); nautilus_label_set_font_size (NAUTILUS_LABEL (label), 14); nautilus_label_set_text_justification (NAUTILUS_LABEL (label), GTK_JUSTIFY_LEFT); - nautilus_label_set_text (NAUTILUS_LABEL (label), description); return label; } @@ -459,10 +458,9 @@ set_up_update_feedback_page (NautilusDruidPageEazel *page) gtk_box_pack_start (GTK_BOX (main_box), label, FALSE, FALSE, 8); - download_label = nautilus_label_new (); + download_label = nautilus_label_new (_("Downloading Nautilus updates...")); nautilus_label_set_font_from_components (NAUTILUS_LABEL (download_label), "helvetica", "medium", NULL, NULL); nautilus_label_set_font_size (NAUTILUS_LABEL (download_label), 18); - nautilus_label_set_text (NAUTILUS_LABEL (download_label), _("Downloading Nautilus updates...")); gtk_widget_show (download_label); diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c index 0ff324c5c..b79877ecd 100644 --- a/src/nautilus-property-browser.c +++ b/src/nautilus-property-browser.c @@ -181,18 +181,6 @@ nautilus_property_browser_initialize_class (GtkObjectClass *object_klass) widget_class->drag_end = nautilus_property_browser_drag_end; } -/* utility to allocate an anti-aliased label */ -static GtkWidget* -make_anti_aliased_label (const char *description) -{ - GtkWidget *label; - - label = nautilus_label_new (); - nautilus_label_set_text (NAUTILUS_LABEL (label), description); - return label; -} - - /* initialize the instance's fields, create the necessary subviews, etc. */ static void @@ -281,14 +269,14 @@ nautilus_property_browser_initialize (GtkObject *object) gtk_container_add(GTK_CONTAINER(temp_frame), temp_hbox); /* add the title label */ - property_browser->details->title_label = make_anti_aliased_label (_("Select A Category:")); + property_browser->details->title_label = nautilus_label_new (_("Select A Category:")); nautilus_label_set_font_size (NAUTILUS_LABEL (property_browser->details->title_label), 18); gtk_widget_show(property_browser->details->title_label); gtk_box_pack_start (GTK_BOX(temp_hbox), property_browser->details->title_label, FALSE, FALSE, 8); /* add the help label */ - property_browser->details->help_label = make_anti_aliased_label (""); + property_browser->details->help_label = nautilus_label_new (""); nautilus_label_set_font_size (NAUTILUS_LABEL (property_browser->details->help_label), 12); gtk_widget_show(property_browser->details->help_label); @@ -316,7 +304,7 @@ nautilus_property_browser_initialize (GtkObject *object) property_browser->details->add_button = gtk_button_new (); gtk_widget_show(property_browser->details->add_button); - property_browser->details->add_button_label = make_anti_aliased_label (_("Add new...")); + property_browser->details->add_button_label = nautilus_label_new (_("Add new...")); nautilus_label_set_font_size (NAUTILUS_LABEL (property_browser->details->add_button_label), 12); gtk_widget_show(property_browser->details->add_button_label); @@ -329,7 +317,7 @@ nautilus_property_browser_initialize (GtkObject *object) property_browser->details->remove_button = gtk_button_new(); gtk_widget_show(property_browser->details->remove_button); - property_browser->details->remove_button_label = make_anti_aliased_label (_("Add new...")); + property_browser->details->remove_button_label = nautilus_label_new (_("Add new...")); nautilus_label_set_font_size (NAUTILUS_LABEL (property_browser->details->remove_button_label), 12); gtk_widget_show(property_browser->details->remove_button_label); @@ -1498,11 +1486,12 @@ make_properties_from_directory_path (NautilusPropertyBrowser *property_browser, gtk_box_pack_start(GTK_BOX(temp_vbox), event_box, FALSE, FALSE, 0); filtered_name = format_name_for_display (current_file_info->name); - /* this is temporarily disabled to due scrolling bug that Ramiro will fix soon - label = make_anti_aliased_label (filtered_name); + label = nautilus_label_new (filtered_name); + nautilus_buffered_widget_set_background_type (NAUTILUS_BUFFERED_WIDGET (label), + NAUTILUS_BACKGROUND_SOLID); + nautilus_buffered_widget_set_background_color (NAUTILUS_BUFFERED_WIDGET (label), + NAUTILUS_RGB_COLOR_WHITE); nautilus_label_set_font_size (NAUTILUS_LABEL (label), 12); - */ - label = gtk_label_new (filtered_name); g_free(filtered_name); gtk_box_pack_start (GTK_BOX(temp_vbox), label, FALSE, FALSE, 0); @@ -1645,7 +1634,7 @@ make_properties_from_xml_node (NautilusPropertyBrowser *property_browser, xmlNod gtk_box_pack_start (GTK_BOX (container), label_box, FALSE, FALSE, 0); label_text = make_color_label (color_str); - label = make_anti_aliased_label (label_text); + label = nautilus_label_new (label_text); nautilus_label_set_font_size (NAUTILUS_LABEL (label), 10); g_free (label_text); @@ -1727,7 +1716,7 @@ make_category_link(NautilusPropertyBrowser *property_browser, char* name, char * gtk_box_pack_start (GTK_BOX (temp_vbox), button, FALSE, FALSE, 1); /* use the name as a label */ - label = make_anti_aliased_label (display_name); + label = nautilus_label_new (display_name); nautilus_label_set_font_size (NAUTILUS_LABEL (label), 12); gtk_box_pack_start (GTK_BOX (temp_vbox), label, FALSE, FALSE, 0); diff --git a/src/nautilus-sidebar-title.c b/src/nautilus-sidebar-title.c index 94a2f0601..1b3b99696 100644 --- a/src/nautilus-sidebar-title.c +++ b/src/nautilus-sidebar-title.c @@ -594,7 +594,7 @@ sidebar_create_smooth_components_if_needed (NautilusSidebarTitle *sidebar_title) /* Label */ if (sidebar_title->details->smooth_title_label == NULL) { - sidebar_title->details->smooth_title_label = nautilus_label_new (); + sidebar_title->details->smooth_title_label = nautilus_label_new (""); sidebar_title->details->smooth_title_label_font = NAUTILUS_SCALABLE_FONT (nautilus_scalable_font_new ("helvetica", "bold", NULL, NULL)); @@ -607,7 +607,7 @@ sidebar_create_smooth_components_if_needed (NautilusSidebarTitle *sidebar_title) /* More info */ if (sidebar_title->details->smooth_more_info_label == NULL) { - sidebar_title->details->smooth_more_info_label = nautilus_label_new (); + sidebar_title->details->smooth_more_info_label = nautilus_label_new (""); sidebar_title->details->smooth_more_info_label_font = NAUTILUS_SCALABLE_FONT (nautilus_scalable_font_new ("helvetica", "medium", NULL, NULL)); diff --git a/src/nautilus-theme-selector.c b/src/nautilus-theme-selector.c index 73c5dba64..f74e361e9 100644 --- a/src/nautilus-theme-selector.c +++ b/src/nautilus-theme-selector.c @@ -122,18 +122,6 @@ nautilus_theme_selector_initialize_class (GtkObjectClass *object_klass) object_klass->destroy = nautilus_theme_selector_destroy; } -/* utility to make anti-aliased labels */ - -static GtkWidget* -make_anti_aliased_label (const char *description) -{ - GtkWidget *label; - - label = nautilus_label_new (); - nautilus_label_set_text (NAUTILUS_LABEL (label), description); - return label; -} - /* initialize the instance's fields, create the necessary subviews, etc. */ static void @@ -188,14 +176,14 @@ nautilus_theme_selector_initialize (GtkObject *object) gtk_container_add(GTK_CONTAINER(temp_frame), temp_hbox); /* add the title label */ - theme_selector->details->title_label = make_anti_aliased_label (_("Nautilus Theme:")); + theme_selector->details->title_label = nautilus_label_new (_("Nautilus Theme:")); nautilus_label_set_font_size (NAUTILUS_LABEL (theme_selector->details->title_label), 18); gtk_widget_show(theme_selector->details->title_label); gtk_box_pack_start (GTK_BOX(temp_hbox), theme_selector->details->title_label, FALSE, FALSE, 8); /* add the help label */ - theme_selector->details->help_label = make_anti_aliased_label (_("Click on a theme to change the\nappearance of Nautilus.")); + theme_selector->details->help_label = nautilus_label_new (_("Click on a theme to change the\nappearance of Nautilus.")); nautilus_label_set_font_size (NAUTILUS_LABEL (theme_selector->details->help_label), 12); gtk_widget_show(theme_selector->details->help_label); @@ -248,7 +236,7 @@ nautilus_theme_selector_initialize (GtkObject *object) theme_selector->details->add_button = gtk_button_new (); gtk_widget_show(theme_selector->details->add_button); - theme_selector->details->add_button_label = make_anti_aliased_label (_("Add new theme")); + theme_selector->details->add_button_label = nautilus_label_new (_("Add new theme")); nautilus_label_set_font_size (NAUTILUS_LABEL (theme_selector->details->add_button_label), 14); gtk_widget_show(theme_selector->details->add_button_label); @@ -260,7 +248,7 @@ nautilus_theme_selector_initialize (GtkObject *object) /* now create the "remove" button */ theme_selector->details->remove_button = gtk_button_new(); - theme_selector->details->remove_button_label = make_anti_aliased_label (_("Remove theme")); + theme_selector->details->remove_button_label = nautilus_label_new (_("Remove theme")); gtk_widget_show(theme_selector->details->remove_button_label); gtk_container_add (GTK_CONTAINER(theme_selector->details->remove_button), theme_selector->details->remove_button_label); gtk_box_pack_end (GTK_BOX (theme_selector->details->bottom_box), |