@@ -1457,42 +1457,6 @@ button_clicked_cb (GtkWidget *button,
14571457 g_signal_emit (path_bar , path_bar_signals [PATH_CLICKED ], 0 , button_data -> path );
14581458}
14591459
1460- static NemoIconInfo *
1461- get_type_icon_info (ButtonData * button_data , gint scale )
1462- {
1463- switch (button_data -> type )
1464- {
1465- case ROOT_BUTTON :
1466- return nemo_icon_info_lookup_from_name (NEMO_ICON_FILESYSTEM ,
1467- NEMO_PATH_BAR_ICON_SIZE , scale );
1468-
1469- case HOME_BUTTON :
1470- return nemo_icon_info_lookup_from_name (NEMO_ICON_HOME ,
1471- NEMO_PATH_BAR_ICON_SIZE , scale );
1472-
1473- case DESKTOP_BUTTON :
1474- return nemo_icon_info_lookup_from_name (NEMO_ICON_DESKTOP ,
1475- NEMO_PATH_BAR_ICON_SIZE , scale );
1476- case XDG_BUTTON :
1477- return nemo_icon_info_lookup_from_name (button_data -> xdg_icon ,
1478- NEMO_PATH_BAR_ICON_SIZE , scale );
1479- case NORMAL_BUTTON :
1480- if (button_data -> is_base_dir ) {
1481- return nemo_file_get_icon (button_data -> file ,
1482- NEMO_PATH_BAR_ICON_SIZE , 0 ,
1483- scale ,
1484- NEMO_FILE_ICON_FLAGS_NONE );
1485- }
1486- return NULL ;
1487- case DEFAULT_LOCATION_BUTTON :
1488- case MOUNT_BUTTON :
1489- default :
1490- return NULL ;
1491- }
1492-
1493- return NULL ;
1494- }
1495-
14961460static void
14971461button_data_free (ButtonData * button_data )
14981462{
@@ -1561,8 +1525,8 @@ set_label_padding_size (ButtonData *button_data)
15611525static void
15621526nemo_path_bar_update_button_appearance (ButtonData * button_data , gint scale )
15631527{
1564- NemoIconInfo * icon_info ;
1565- GdkPixbuf * pixbuf ;
1528+ GIcon * gicon ;
1529+
15661530 const gchar * dir_name = get_dir_name (button_data );
15671531
15681532 if (button_data -> label != NULL ) {
@@ -1582,31 +1546,29 @@ nemo_path_bar_update_button_appearance (ButtonData *button_data, gint scale)
15821546 }
15831547
15841548 if (button_data -> image != NULL ) {
1585- if (button_data -> custom_icon ) {
1586- cairo_surface_t * surface ;
1587- surface = gdk_cairo_surface_create_from_pixbuf (button_data -> custom_icon , scale , NULL );
1588- g_object_set (GTK_IMAGE (button_data -> image ), "surface" , surface , NULL );
1589- gtk_widget_show (GTK_WIDGET (button_data -> image ));
1590- } else {
1591- icon_info = get_type_icon_info (button_data , scale );
1592-
1593- pixbuf = NULL ;
1594-
1595- if (icon_info != NULL ) {
1596- pixbuf = nemo_icon_info_get_pixbuf_at_size (icon_info , NEMO_PATH_BAR_ICON_SIZE );
1597- g_object_unref (icon_info );
1598- }
1549+ switch (button_data -> type ) {
1550+ case ROOT_BUTTON :
1551+ gicon = g_themed_icon_new (NEMO_ICON_SYMBOLIC_FILESYSTEM );
1552+ break ;
1553+ case HOME_BUTTON :
1554+ case DESKTOP_BUTTON :
1555+ case XDG_BUTTON :
1556+ gicon = nemo_file_get_control_icon (button_data -> file );
1557+ break ;
1558+ case NORMAL_BUTTON :
1559+ if (button_data -> is_base_dir ) {
1560+ gicon = nemo_file_get_control_icon (button_data -> file );
1561+ break ;
1562+ }
1563+ case DEFAULT_LOCATION_BUTTON :
1564+ case MOUNT_BUTTON :
1565+ default :
1566+ gicon = NULL ;
1567+ }
15991568
1600- if (pixbuf != NULL ) {
1601- cairo_surface_t * surface ;
1602- surface = gdk_cairo_surface_create_from_pixbuf (pixbuf , scale , NULL );
1603- g_object_set (GTK_IMAGE (button_data -> image ), "surface" , surface , NULL );
1604- gtk_widget_show (GTK_WIDGET (button_data -> image ));
1605- g_object_unref (pixbuf );
1606- } else {
1607- gtk_widget_hide (GTK_WIDGET (button_data -> image ));
1608- }
1609- }
1569+ gtk_image_set_from_gicon (GTK_IMAGE (button_data -> image ),
1570+ gicon ,
1571+ GTK_ICON_SIZE_MENU );
16101572 }
16111573
16121574}
@@ -1718,25 +1680,25 @@ setup_button_type (ButtonData *button_data,
17181680 }
17191681 } else if (path_bar -> priv -> xdg_documents_path != NULL && g_file_equal (location , path_bar -> priv -> xdg_documents_path )) {
17201682 button_data -> type = XDG_BUTTON ;
1721- button_data -> xdg_icon = g_strdup (NEMO_ICON_FOLDER_DOCUMENTS );
1683+ button_data -> xdg_icon = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER_DOCUMENTS );
17221684 } else if (path_bar -> priv -> xdg_download_path != NULL && g_file_equal (location , path_bar -> priv -> xdg_download_path )) {
17231685 button_data -> type = XDG_BUTTON ;
1724- button_data -> xdg_icon = g_strdup (NEMO_ICON_FOLDER_DOWNLOAD );
1686+ button_data -> xdg_icon = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER_DOWNLOAD );
17251687 } else if (path_bar -> priv -> xdg_music_path != NULL && g_file_equal (location , path_bar -> priv -> xdg_music_path )) {
17261688 button_data -> type = XDG_BUTTON ;
1727- button_data -> xdg_icon = g_strdup (NEMO_ICON_FOLDER_MUSIC );
1689+ button_data -> xdg_icon = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER_MUSIC );
17281690 } else if (path_bar -> priv -> xdg_pictures_path != NULL && g_file_equal (location , path_bar -> priv -> xdg_pictures_path )) {
17291691 button_data -> type = XDG_BUTTON ;
1730- button_data -> xdg_icon = g_strdup (NEMO_ICON_FOLDER_PICTURES );
1692+ button_data -> xdg_icon = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER_PICTURES );
17311693 } else if (path_bar -> priv -> xdg_templates_path != NULL && g_file_equal (location , path_bar -> priv -> xdg_templates_path )) {
17321694 button_data -> type = XDG_BUTTON ;
1733- button_data -> xdg_icon = g_strdup (NEMO_ICON_FOLDER_TEMPLATES );
1695+ button_data -> xdg_icon = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER_TEMPLATES );
17341696 } else if (path_bar -> priv -> xdg_videos_path != NULL && g_file_equal (location , path_bar -> priv -> xdg_videos_path )) {
17351697 button_data -> type = XDG_BUTTON ;
1736- button_data -> xdg_icon = g_strdup (NEMO_ICON_FOLDER_VIDEOS );
1698+ button_data -> xdg_icon = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER_VIDEOS );
17371699 } else if (path_bar -> priv -> xdg_public_path != NULL && g_file_equal (location , path_bar -> priv -> xdg_public_path )) {
17381700 button_data -> type = XDG_BUTTON ;
1739- button_data -> xdg_icon = g_strdup (NEMO_ICON_FOLDER_PUBLIC_SHARE );
1701+ button_data -> xdg_icon = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER_PUBLIC_SHARE );
17401702 } else if (setup_file_path_mounted_mount (location , button_data ,
17411703 gtk_widget_get_scale_factor (GTK_WIDGET (path_bar )))) {
17421704 /* already setup */
0 commit comments