gnome helpers: No need to hardcode icon search paths anymore
This commit is contained in:
parent
7562e95099
commit
0a8647900a
|
@ -12,10 +12,10 @@
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
@ -25,16 +25,10 @@ namespace SparkleShare {
|
||||||
public static Gdk.Pixbuf GetIcon (string name, int size)
|
public static Gdk.Pixbuf GetIcon (string name, int size)
|
||||||
{
|
{
|
||||||
IconTheme icon_theme = new IconTheme ();
|
IconTheme icon_theme = new IconTheme ();
|
||||||
|
|
||||||
// foreach (string search_path in IconTheme.Default.SearchPath)
|
|
||||||
// icon_theme.AppendSearchPath (search_path);
|
|
||||||
|
|
||||||
// FIXME: Temporary workaround for a bug in IconTheme.SearchPath in Gtk# on 64-bit systems
|
|
||||||
// https://github.com/mono/gtk-sharp/commit/9c54fd5ae77f63d11fdc6873a3cb90691990e37f
|
|
||||||
icon_theme.AppendSearchPath ("/usr/share/icons");
|
|
||||||
icon_theme.AppendSearchPath ("/usr/local/share/icons");
|
|
||||||
icon_theme.AppendSearchPath ("/opt/local/share/icons");
|
|
||||||
icon_theme.AppendSearchPath (new string [] {SparkleUI.AssetsPath, "icons"}.Combine ());
|
icon_theme.AppendSearchPath (new string [] {SparkleUI.AssetsPath, "icons"}.Combine ());
|
||||||
|
|
||||||
|
foreach (string search_path in IconTheme.Default.SearchPath)
|
||||||
|
icon_theme.AppendSearchPath (search_path);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return icon_theme.LoadIcon (name, size, IconLookupFlags.GenericFallback);
|
return icon_theme.LoadIcon (name, size, IconLookupFlags.GenericFallback);
|
||||||
|
|
Loading…
Reference in a new issue