X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmoonshot-utils.vala;h=d2f4ed49b9a5fb0cde840e169e7ee850ad2e6f89;hb=5690f70b3bf7f67b932ba641d00c7fb2b9d2ecdf;hp=f0cb38b3e6023c115b4587908cba2aaa3d84ec79;hpb=97e862eda4275a41f2450009803fcf8d9b6f08bd;p=moonshot-ui.git diff --git a/src/moonshot-utils.vala b/src/moonshot-utils.vala index f0cb38b..d2f4ed4 100644 --- a/src/moonshot-utils.vala +++ b/src/moonshot-utils.vala @@ -30,14 +30,14 @@ * SUCH DAMAGE. */ #if OS_WIN32 -extern string? g_win32_get_package_installation_directory_of_module (void *module); +extern string? g_win32_get_package_installation_directory_of_module(void *module); #endif -public Gdk.Pixbuf? find_icon_sized (string name, Gtk.IconSize icon_size) +public Gdk.Pixbuf? find_icon_sized(string name, Gtk.IconSize icon_size) { int width, height; - Gtk.icon_size_lookup (icon_size, out width, out height); - return find_icon (name, width); + Gtk.icon_size_lookup(icon_size, out width, out height); + return find_icon(name, width); } /* Portability hack: making Gtk icon themes work on Windows is @@ -52,27 +52,27 @@ public Gdk.Pixbuf? get_pixbuf(IdCard id) return find_icon("avatar-default", 48); } -public Gdk.Pixbuf? find_icon (string name, int size) +public Gdk.Pixbuf? find_icon(string name, int size) { if (!gtk_available) return null; try { -#if OS_WIN32 - string? base_path = g_win32_get_package_installation_directory_of_module (null); + #if OS_WIN32 + string? base_path = g_win32_get_package_installation_directory_of_module(null); // Hack to allow running within the source tree - int last_dir_index = base_path.last_index_of_char ('\\'); - if (base_path.substring (last_dir_index) == "\\.libs" || base_path.substring (last_dir_index) == "src") + int last_dir_index = base_path.last_index_of_char('\\'); + if (base_path.substring(last_dir_index) == "\\.libs" || base_path.substring(last_dir_index) == "src") base_path = base_path.slice(0, last_dir_index); - string? filename = Path.build_filename (base_path, "share", "icons", "%s.png".printf (name)); - return new Gdk.Pixbuf.from_file_at_size (filename, size, size); + string? filename = Path.build_filename(base_path, "share", "icons", "%s.png".printf(name)); + return new Gdk.Pixbuf.from_file_at_size(filename, size, size); -#else - var icon_theme = Gtk.IconTheme.get_default (); - return icon_theme.load_icon (name, size, Gtk.IconLookupFlags.FORCE_SIZE); -#endif + #else + var icon_theme = Gtk.IconTheme.get_default(); + return icon_theme.load_icon(name, size, Gtk.IconLookupFlags.FORCE_SIZE); + #endif } catch (Error e) {