fixed bug 3463, get sound diagnostics when mousing over non-sound files,

fixed bug 3463, get sound diagnostics when mousing over non-sound
	files, by only testing for sound if we're over a sound file

	also, made the shadow type of the throbber frame be specified by the
	theme.
This commit is contained in:
Andy Hertzfeld 2000-10-04 08:26:51 +00:00
parent 2b6b3a15dd
commit 03c38354e2
7 changed files with 67 additions and 16 deletions

View file

@ -1,3 +1,23 @@
2000-10-04 Andy Hertzfeld <andy@eazel.com>
* src/file-manager/fm-icon-view.c:
(icon_container_preview_callback):
fixed bug 3463, get sound diagnostics when mousing over non-sound
files, by only testing for sound if we're over a sound file
* src/nautilus-window-toolbars.c: (set_up_throbber_frame_type),
(allocate_throbber), (theme_changed_callback),
(nautilus_window_initialize_toolbars),
(nautilus_window_toolbar_remove_theme_callback):
made the shadow type of the throbber frame be specified by the
theme.
* icons/ardmore/ardmore.xml:
* icons/default.xml:
* icons/eazel/eazel.xml:
* icons/vector/vector.xml:
changed the shadow types in some themes
2000-10-03 Robey Pointer <robey@eazel.com>
* components/services/install/lib/eazel-install-protocols.c:

View file

@ -3,7 +3,7 @@
<sidebar SIDEBAR_BACKGROUND_TILE_IMAGE="./bluewall.png" SIDEBAR_BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/>
<directory BACKGROUND_TILE_IMAGE="./blueridge.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/>
<desktop BACKGROUND_TILE_IMAGE="backgrounds/fleur_de_lis.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/>
<toolbar ICON_THEME="eazel"/>
<toolbar ICON_THEME="eazel" FRAME_TYPE="none"/>
<zoom_control NUMBER_V_OFFSET="-6" DIGIT_WIDTH="6"/>
<description TEXT="This theme uses photo-realistic folders."/>
</theme>

View file

@ -5,5 +5,6 @@
<directory BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/>
<icon HIGHLIGHT_BACKGROUND_COLOR="rgb:0000/0000/0000" HIGHLIGHT_TEXT_COLOR="rgb:FFFF/FFFF/FFFF" TEXT_FILL_COLOR="rgb:FFFF/FFFF/FFFF"/>
<description TEXT="This simple theme uses the standard GNOME icons."/>
<toolbar FRAME_TYPE="in"/>
<thumbnails FRAME_OFFSETS="3,3,6,6"/>
</theme>

View file

@ -3,6 +3,6 @@
<sidebar SIDEBAR_BACKGROUND_TILE_IMAGE="backgrounds/cork.png" SIDEBAR_BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/>
<directory BACKGROUND_TILE_IMAGE="backgrounds/blue_gray_rough.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/>
<desktop BACKGROUND_TILE_IMAGE="backgrounds/fleur_de_lis.png" BACKGROUND_COLOR="rgb:FFFF/FFFF/FFFF"/>
<toolbar ICON_THEME="eazel"/>
<toolbar ICON_THEME="eazel" FRAME_TYPE="none"/>
<zoom_control NUMBER_V_OFFSET="-6" DIGIT_WIDTH="6"/>
</theme>

View file

@ -2,7 +2,7 @@
<theme name="vector">
<sidebar SIDEBAR_BACKGROUND_TILE_IMAGE="backgrounds/blue_sky.png"/>
<directory BACKGROUND_COLOR="rgb:FFFF/FFFF/3333-rgb:FFFF/9999/3333:h"/>
<toolbar ICON_THEME="eazel"/>
<toolbar ICON_THEME="eazel" FRAME_TYPE="out"/>
<desktop BACKGROUND_TILE_IMAGE="backgrounds/clouds.png"/>
<zoom_control NUMBER_V_OFFSET="2" />
<description TEXT="This experimental theme uses vector-based icons."/>

View file

@ -1833,17 +1833,16 @@ icon_container_preview_callback (NautilusIconContainer *container,
result = 0;
if (nautilus_sound_can_play_sound ()) {
/* preview files based on the mime_type. */
/* for now, we just handle mp3s, soon we'll do more general sounds, eventually, more general types */
mime_type = nautilus_file_get_mime_type(file);
if (nautilus_istr_has_prefix (mime_type, "audio/")) {
/* preview files based on the mime_type. */
/* at first, we just handle sounds */
mime_type = nautilus_file_get_mime_type(file);
if (nautilus_istr_has_prefix (mime_type, "audio/")) {
if (nautilus_sound_can_play_sound ()) {
result = 1;
preview_sound (file, start_flag);
}
g_free (mime_type);
}
}
}
g_free (mime_type);
/* display file name in status area at low zoom levels, since the name is not displayed or hard to read */
if (fm_icon_view_get_zoom_level (icon_view) <= NAUTILUS_ZOOM_LEVEL_SMALLER) {

View file

@ -40,6 +40,7 @@
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gnome-extensions.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
#include <libnautilus-extensions/nautilus-string.h>
#include <libnautilus-extensions/nautilus-theme.h>
/* forward declarations */
@ -336,6 +337,34 @@ set_up_toolbar_images (NautilusWindow *window)
set_up_button (window->stop_button, GNOME_STOCK_PIXMAP_STOP);
}
static void
set_up_throbber_frame_type (NautilusWindow *window)
{
GtkWidget *frame;
char *frame_type;
GtkShadowType shadow_type;
frame = window->throbber->parent;
frame_type = nautilus_theme_get_theme_data ("toolbar", "FRAME_TYPE");
shadow_type = GTK_SHADOW_NONE;
if (nautilus_strcmp (frame_type, "in") == 0) {
shadow_type = GTK_SHADOW_IN;
} else if (nautilus_strcmp (frame_type, "out") == 0) {
shadow_type = GTK_SHADOW_OUT;
} else if (nautilus_strcmp (frame_type, "none") == 0) {
shadow_type = GTK_SHADOW_NONE;
} else {
shadow_type = GTK_SHADOW_NONE;
}
g_free (frame_type);
gtk_frame_set_shadow_type (GTK_FRAME (frame), shadow_type);
}
static GtkWidget*
allocate_throbber (GtkWidget *toolbar)
{
@ -346,7 +375,6 @@ allocate_throbber (GtkWidget *toolbar)
gtk_widget_show (throbber);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_widget_show (frame);
gtk_container_add (GTK_CONTAINER (frame), throbber);
@ -359,10 +387,12 @@ allocate_throbber (GtkWidget *toolbar)
return throbber;
}
/* handle theme changes */
static void
set_up_toolbar_images_callback (gpointer callback_data)
theme_changed_callback (gpointer callback_data)
{
set_up_toolbar_images (NAUTILUS_WINDOW (callback_data));
set_up_throbber_frame_type (NAUTILUS_WINDOW (callback_data));
}
/* allocate a new toolbar */
@ -384,6 +414,7 @@ nautilus_window_initialize_toolbars (NautilusWindow *window)
window->throbber = allocate_throbber (toolbar);
set_up_toolbar_images (window);
set_up_throbber_frame_type (window);
gnome_app_set_toolbar (app, GTK_TOOLBAR (toolbar));
@ -402,7 +433,7 @@ nautilus_window_initialize_toolbars (NautilusWindow *window)
/* add callback for preference changes */
nautilus_preferences_add_callback
(NAUTILUS_PREFERENCES_THEME,
set_up_toolbar_images_callback,
theme_changed_callback,
window);
}
@ -411,7 +442,7 @@ nautilus_window_toolbar_remove_theme_callback (NautilusWindow *window)
{
nautilus_preferences_remove_callback
(NAUTILUS_PREFERENCES_THEME,
set_up_toolbar_images_callback,
theme_changed_callback,
window);
}