diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | data/browser.xml | 8 | ||||
-rw-r--r-- | icons/Makefile.am | 1 | ||||
-rw-r--r-- | icons/chit_frame.png | bin | 820 -> 861 bytes | |||
-rw-r--r-- | icons/themes.png | bin | 0 -> 1774 bytes | |||
-rw-r--r-- | src/nautilus-first-time-druid.c | 2 | ||||
-rw-r--r-- | src/nautilus-property-browser.c | 68 |
7 files changed, 70 insertions, 24 deletions
@@ -1,3 +1,18 @@ +2000-07-11 Andy Hertzfeld <andy@eazel.com> + + * src/nautilus-property-browser.c: (strip_extension), + (format_name_for_display), (make_background_chit), + (make_properties_from_directory_path), (make_category_link), + (nautilus_property_browser_update_contents): + made various improvements suggested by Arlo and cleaned up + the code a bit. There's more changes coming soon. + * src/nautilus-first-time-druid.c: (set_up_service_signup_page): + improved the services description a bit + * data/browser.xml: + * icons/Makefile.am: + * icons/themes.png: + added an icon for the themes button + 2000-07-11 Eskil Heyn Olsen <eskil@eazel.com> * components/services/inventory/nautilus-view/Makefile.am: diff --git a/data/browser.xml b/data/browser.xml index e6f7a4d93..73651adc2 100644 --- a/data/browser.xml +++ b/data/browser.xml @@ -1,8 +1,8 @@ <?xml version="1.0"?> <categories> - <category name="backgrounds" image="backgrounds.png" mode="directory" path="nautilus/backgrounds" type="property/bgimage" description="Drag a background tile to an object to change it"/> - <category name="emblems" image="emblems.png" mode="directory" path="nautilus/emblems" type="property/keyword" description="Drag an emblem to an object to add it to the object"/> - <category name="colors" image="colors.png" mode="inline" type="application/x-color" description="Drag a color to an object to change it to that color"> + <category name="backgrounds" display_name="Backgrounds" image="backgrounds.png" mode="directory" path="nautilus/backgrounds" type="property/bgimage" description="Drag a background tile to an object to change it"/> + <category name="emblems" display_name="Emblems" image="emblems.png" mode="directory" path="nautilus/emblems" type="property/keyword" description="Drag an emblem to an object to add it to the object"/> + <category name="colors" display_name="Colors" image="colors.png" mode="inline" type="application/x-color" description="Drag a color to an object to change it to that color"> <color>rgb:FFFF/FFFF/3333</color> <color>rgb:FFFF/CCCC/3333</color> <color>rgb:FFFF/9999/3333</color> @@ -28,5 +28,5 @@ <color>rgb:CCCC/CCCC/CCCC</color> <color>rgb:FFFE/FFFE/FFFE</color> </category> - <category name="Themes" image="colors.png" mode="themes" path="icons" type="property/theme" description="Click on a theme button to switch to that theme"/> + <category name="Themes" display_name="Themes" image="themes.png" mode="themes" path="icons" type="property/theme" description="Click on a theme button to switch to that theme"/> </categories> diff --git a/icons/Makefile.am b/icons/Makefile.am index 693fb0601..ffaf9a45d 100644 --- a/icons/Makefile.am +++ b/icons/Makefile.am @@ -155,6 +155,7 @@ icon_DATA =\ search.png \ tableft.png \ tabright.png \ + themes.png \ trash-empty.png \ trash-full.png \ uparrow.png \ diff --git a/icons/chit_frame.png b/icons/chit_frame.png Binary files differindex 66540ab89..ecd3151bc 100644 --- a/icons/chit_frame.png +++ b/icons/chit_frame.png diff --git a/icons/themes.png b/icons/themes.png Binary files differnew file mode 100644 index 000000000..9c1e4ab24 --- /dev/null +++ b/icons/themes.png diff --git a/src/nautilus-first-time-druid.c b/src/nautilus-first-time-druid.c index 864efa464..30201cb6e 100644 --- a/src/nautilus-first-time-druid.c +++ b/src/nautilus-first-time-druid.c @@ -181,7 +181,7 @@ set_up_service_signup_page (NautilusDruidPageStandard *page) gtk_container_add (GTK_CONTAINER (container), main_box); /* allocate a descriptive label */ - label = gtk_label_new (_("Eazel offers a number of services to help you manage your system and files, some of them free of charge. Click the sign-up button below to find out more about signing up. ")); + label = gtk_label_new (_("Eazel offers a growing number services to help you install and manage your files across the network. Click the sign-up button below to find out more about signing up for them. ")); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_widget_show (label); diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c index 1b2dacc49..b72c56e2b 100644 --- a/src/nautilus-property-browser.c +++ b/src/nautilus-property-browser.c @@ -27,6 +27,8 @@ #include <config.h> #include <math.h> +#include <ctype.h> + #include "nautilus-property-browser.h" #include <parser.h> @@ -120,8 +122,8 @@ static GdkPixbuf* make_background_chit (GdkPixbuf *background_tile, static char *strip_extension (const char *string_to_strip); static char *get_xml_path (NautilusPropertyBrowser *property_browser); -#define BROWSER_BACKGROUND_COLOR "rgb:DDDD/EEEE/FFFF" -#define BROWSER_TITLE_COLOR "rgb:FFFF/FFFF/FFFF" +#define BROWSER_BACKGROUND_COLOR "rgb:FFFF/FFFF/FFFF" +#define BROWSER_TITLE_COLOR "rgb:DDDD/DDDD/DDDD" #define THEME_SELECT_COLOR "rgb:FFFF/9999/9999" #define BROWSER_CATEGORIES_FILE_NAME "browser.xml" @@ -1195,7 +1197,7 @@ element_clicked_callback(GtkWidget *widget, GdkEventButton *event, char *element /* utility routine to strip the extension from the passed in string */ static char* -strip_extension(const char* string_to_strip) +strip_extension (const char* string_to_strip) { char *result_str, *temp_str; if (string_to_strip == NULL) @@ -1208,6 +1210,32 @@ strip_extension(const char* string_to_strip) return result_str; } +/* utility to format the passed-in name for display by stripping the extension, mapping underscore + and capitalizing as necessary */ + +static char* +format_name_for_display (const char* name) +{ + gboolean need_to_cap; + int index, length; + char *formatted_str; + + formatted_str = strip_extension (name); + + need_to_cap = TRUE; + length = strlen (formatted_str); + for (index = 0; index < length; index++) { + if (need_to_cap && islower (formatted_str[index])) + formatted_str[index] = toupper (formatted_str[index]); + + if (formatted_str[index] == '_') + formatted_str[index] = ' '; + need_to_cap = formatted_str[index] == ' '; + } + + return formatted_str; +} + /* handle preferences changing by updating the browser contents */ static void @@ -1234,18 +1262,19 @@ static GdkPixbuf* make_background_chit (GdkPixbuf *background_tile, GdkPixbuf *frame) { GdkPixbuf *pixbuf; - double scale_x, scale_y; + int frame_width, frame_height; - /* start with the frame */ - pixbuf = gdk_pixbuf_copy (frame); - - scale_x = ((double) MAX_ICON_WIDTH) / gdk_pixbuf_get_width (background_tile); - scale_y = ((double) MAX_ICON_HEIGHT) / gdk_pixbuf_get_height (background_tile); - /* draw the scaled tile on top of it */ - - gdk_pixbuf_scale (background_tile, pixbuf, 3, 3, MAX_ICON_WIDTH - 2, MAX_ICON_HEIGHT - 2, - 0.0, 0.0, scale_x, scale_y, GDK_INTERP_BILINEAR); + frame_width = gdk_pixbuf_get_width (frame); + frame_height = gdk_pixbuf_get_height (frame); + + /* scale the background tile to the proper size */ + pixbuf = gdk_pixbuf_scale_simple (background_tile, frame_width, frame_height, GDK_INTERP_BILINEAR); + + /* composite the mask on top of it */ + gdk_pixbuf_composite (frame, pixbuf, 0, 0, frame_width, frame_height, + 0.0, 0.0, 1.0, 1.0, GDK_INTERP_BILINEAR, 255); + gdk_pixbuf_unref (background_tile); return pixbuf; } @@ -1321,7 +1350,7 @@ make_properties_from_directory_path(NautilusPropertyBrowser *property_browser, c gtk_container_add(GTK_CONTAINER(event_box), pixmap_widget); gtk_box_pack_start(GTK_BOX(temp_vbox), event_box, FALSE, FALSE, 0); - filtered_name = strip_extension(current_file_info->name); + filtered_name = format_name_for_display (current_file_info->name); label = gtk_label_new(filtered_name); g_free(filtered_name); gtk_box_pack_start (GTK_BOX(temp_vbox), label, FALSE, FALSE, 0); @@ -1675,7 +1704,7 @@ make_category(NautilusPropertyBrowser *property_browser, const char* path, const /* this is a utility routine to generate a category link widget and install it in the browser */ static void -make_category_link(NautilusPropertyBrowser *property_browser, char* name, char* image, int index) +make_category_link(NautilusPropertyBrowser *property_browser, char* name, char *display_name, char* image, int index) { GtkWidget *label, *pix_widget, *button, *temp_vbox; @@ -1692,7 +1721,7 @@ make_category_link(NautilusPropertyBrowser *property_browser, char* name, char* gtk_widget_set_usize(button, 96, 80); /* use the name as a label */ - label = gtk_label_new(name); + label = gtk_label_new (display_name); gtk_box_pack_start (GTK_BOX (temp_box), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -1775,16 +1804,17 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro char* category_image = xmlGetProp (cur_node, "image"); char* category_type = xmlGetProp (cur_node, "type"); char* category_description = xmlGetProp (cur_node, "description"); + char* display_name = xmlGetProp (cur_node, "display_name"); if (property_browser->details->category && !strcmp(property_browser->details->category, category_name)) { char *category_path = xmlGetProp (cur_node, "path"); char *category_mode = xmlGetProp (cur_node, "mode"); - make_category(property_browser, category_path, category_mode, cur_node, category_description); - nautilus_property_browser_set_drag_type(property_browser, category_type); + make_category (property_browser, category_path, category_mode, cur_node, category_description); + nautilus_property_browser_set_drag_type (property_browser, category_type); break; } else if (property_browser->details->category == NULL) { - make_category_link (property_browser, category_name, category_image, index++); + make_category_link (property_browser, category_name, display_name, category_image, index++); } } } |