made the property browser update when the theme changes; fixed bug in

made the property browser update when the theme changes; fixed
	bug in making theme selectors, and added emblems that I forgot
	to add on Friday.
This commit is contained in:
Andy Hertzfeld 2000-07-10 18:14:47 +00:00
parent 44d6765c35
commit 84cdcd49ef
8 changed files with 69 additions and 11 deletions

View file

@ -1,3 +1,22 @@
2000-07-10 Andy Hertzfeld <andy@eazel.com>
* src/nautilus-property-browser.c:
(nautilus_property_browser_initialize),
(nautilus_property_browser_destroy),
(nautilus_property_browser_theme_changed),
(theme_clicked_callback):
made the property browser update itself when the theme changes
* libnautilus-extensions/nautilus-theme.c:
(nautilus_theme_make_selector):
fixed bug where we were calling g_file_exists with NULL
by testing for NULL instead of calling it at all.
* data/emblems/Makefile.am:
* data/emblems/personal.png:
* icons/Makefile.am:
* icons/emblem-personal.svg:
added the emblems that I tried to on Friday but forgot to cvsadd
2000-07-10 Ramiro Estrugo <ramiro@eazel.com>
*

View file

@ -11,6 +11,7 @@ emblems_DATA = \
favorite.png \
important.gif \
new.gif \
personal.png \
remote.gif \
$(NULL)

BIN
data/emblems/personal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -24,6 +24,7 @@ icon_DATA =\
emblem-new.gif \
emblem-noread.png \
emblem-nowrite.png \
emblem-personal.svg \
emblem-remote.gif \
emblem-symbolic-link.png \
emblems.png \

12
icons/emblem-personal.svg Normal file
View file

@ -0,0 +1,12 @@
<svg width="27" height="29">
<!-- PersonalEmblem.eps converted by ill2svg.pl -->
<defs>
</defs>
<g> <!-- Layer: Layer 1 -->
<g style="fill: #295eaa">
<path d="M0.916 21.867C1.32 22.07 2.797 22.401 5.1 22.812C8.679 23.453 9.515 24.93 12.66 26.727C14.079 27.538 15.9 28.348 16.508 28.415C19.798 28.781 20.495 27.555 22.312 26.863C25.147 25.783 25.958 24.433 26.329 21.969C26.722 19.364 25.822 18.29 23.798 13.97C22.751 11.739 22.167 7.167 21.594 4.155C20.978 0.917 18.583 1.333 18.827 4.223C19.044 6.784 19.167 7.25 19.343 9.717C19.459 11.346 18.75 10.5 18.25 9.25C16.928 5.945 16.5 4.25 15.5 2.167C14.135 -0.677 11.917 -0.083 12.823 3.194C13.366 5.158 16.374 11.742 14.989 11.641C14.456 11.602 10.433 3.845 8.407 1.313C6.965 -0.489 5.572 0.403 5.572 1.719C5.572 2.971 11.647 12.755 11.243 13.261C10.749 13.878 8.103 9.92 5.876 7.186C3.748 4.574 2.535 4.655 1.929 6.073C1.32 7.49 8.206 16.198 9.017 17.817C9.825 19.438 9.228 19.731 7.699 19.539C6.079 19.336 4.628 18.898 2.198 19.505C0.866 19.838 0.173 21.328 0.916 21.867z"/>
<!-- 0 1 1 1 0.8824 0.4431 0.0431 0.0078 (N) * -->
<!-- (N) * -->
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -182,17 +182,21 @@ nautilus_theme_make_selector (const char *theme_name)
pixbuf_file = nautilus_pixmap_file(temp_str);
g_free (temp_str);
if (!g_file_exists (pixbuf_file)) {
g_free (pixbuf_file);
if (pixbuf_file == NULL) {
temp_str = g_strdup_printf ("%s/%s", theme_name, "i-directory.svg");
pixbuf_file = nautilus_pixmap_file(temp_str);
g_free (temp_str);
if (!g_file_exists (pixbuf_file)) {
g_free (pixbuf_file);
if (pixbuf_file == NULL) {
pixbuf_file = nautilus_pixmap_file ("i-directory.png");
}
}
/* if we can't find anything, return NULL */
if (pixbuf_file == NULL) {
return NULL;
}
/* load the icon that we found and return it */
if (nautilus_str_has_suffix(pixbuf_file, ".svg")) {
FILE *f = fopen (pixbuf_file, "rb");
if (f != NULL) {

View file

@ -182,17 +182,21 @@ nautilus_theme_make_selector (const char *theme_name)
pixbuf_file = nautilus_pixmap_file(temp_str);
g_free (temp_str);
if (!g_file_exists (pixbuf_file)) {
g_free (pixbuf_file);
if (pixbuf_file == NULL) {
temp_str = g_strdup_printf ("%s/%s", theme_name, "i-directory.svg");
pixbuf_file = nautilus_pixmap_file(temp_str);
g_free (temp_str);
if (!g_file_exists (pixbuf_file)) {
g_free (pixbuf_file);
if (pixbuf_file == NULL) {
pixbuf_file = nautilus_pixmap_file ("i-directory.png");
}
}
/* if we can't find anything, return NULL */
if (pixbuf_file == NULL) {
return NULL;
}
/* load the icon that we found and return it */
if (nautilus_str_has_suffix(pixbuf_file, ".svg")) {
FILE *f = fopen (pixbuf_file, "rb");
if (f != NULL) {

View file

@ -112,6 +112,7 @@ static void nautilus_property_browser_drag_data_get (GtkWidget
GtkSelectionData *selection_data,
guint info,
guint32 time);
static void nautilus_property_browser_theme_changed (gpointer user_data);
/* misc utilities */
static char *strip_extension (const char *string_to_strip);
@ -278,6 +279,11 @@ nautilus_property_browser_initialize (GtkObject *object)
(NautilusPreferencesCallback) nautilus_property_browser_preferences_changed,
property_browser);
/* add a callback for when the theme changes */
nautilus_preferences_add_callback (NAUTILUS_PREFERENCES_THEME,
nautilus_property_browser_theme_changed,
property_browser);
/* initially, display the top level */
nautilus_property_browser_set_path(property_browser, BROWSER_CATEGORIES_FILE_NAME);
}
@ -299,6 +305,9 @@ nautilus_property_browser_destroy (GtkObject *object)
nautilus_preferences_remove_callback(NAUTILUS_PREFERENCES_CAN_ADD_CONTENT,
(NautilusPreferencesCallback) nautilus_property_browser_preferences_changed,
NULL);
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
nautilus_property_browser_theme_changed,
property_browser);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
@ -1433,14 +1442,22 @@ make_properties_from_xml_node (NautilusPropertyBrowser *property_browser, xmlNod
}
}
/* handle theme changes by updating the browser contents */
static void
nautilus_property_browser_theme_changed (gpointer user_data)
{
NautilusPropertyBrowser *property_browser;
property_browser = NAUTILUS_PROPERTY_BROWSER(user_data);
nautilus_property_browser_update_contents (property_browser);
}
/* handle clicks on the theme selector by setting the theme */
static void
theme_clicked_callback(GtkWidget *widget, char *theme_name)
{
NautilusPropertyBrowser *property_browser = NAUTILUS_PROPERTY_BROWSER(gtk_object_get_user_data(GTK_OBJECT(widget)));
nautilus_theme_set_theme (theme_name);
nautilus_property_browser_update_contents (property_browser);
}
static gboolean