summaryrefslogtreecommitdiff
path: root/gtk/gtkicontheme.c
Commit message (Collapse)AuthorAgeFilesLines
* docs: Point at for_scale() variantsEmmanuele Bassi2015-11-091-0/+12
| | | | | | Using lookup_icon() and lookup_by_gicon() with a size multiplied by a scaling factor is almost certainly going to get worse results than using their for_scale() variants.
* icon theme: Ensure to propagate an errorMatthias Clasen2015-11-091-1/+5
| | | | | | | | If the svg pixbuf loader is not available, we end up with criticals from gtk_css_image_icon_theme_draw because gtk_icon_info_load_symbolic returns NULL without setting an error. Avoid this by propagating the load error.
* gtkicontheme: Check a return valueMatthias Clasen2015-07-171-3/+2
| | | | | We were already looking at the error anyway, but rewriting things this way lets coverity see the light.
* icontheme: don't modify symbolic SVG dimensions when recoloringCosimo Cecchi2015-06-121-11/+21
| | | | | | | | | | When recoloring symbolic SVG, do not modify the original width and height of the passed-in file; the function later will scale the image through gdk_pixbuf_new_from_stream_at_scale(), but we should still use the original size to create the proxy SVG, or the image will possibly be doubly-resized or blurry. https://bugzilla.gnome.org/show_bug.cgi?id=750605
* icon theme: Fix compiler warningsMatthias Clasen2015-06-021-1/+0
| | | | Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
* icontheme: allow directories with mtime 0Daniel Drake2015-02-231-6/+12
| | | | | | | | | | | | | In order to provide a constant mtime between OS build and deploy time, while also maintaining a hardlink content-addressed model independent of timestamps, ostree sets all mtimes to 0. The icon cache code currently ignores directories with mtime 0, assuming they don't exist. Track directory existence in a more precise way. https://bugzilla.gnome.org/show_bug.cgi?id=745052
* icontheme: use desired size instead of negative for DIR_UNTHEMED SVGsCosimo Cecchi2015-02-231-2/+2
| | | | | | | | | | | | | | | When loading SVGs from ICON_THEME_DIR_UNTHEMED GtkIconInfos, such as those created for a GLoadableIcon, the size of the pixbuf to load is set as a product of icon_info->scale. But a few lines above, icon_info->scale is set to -1 for ICON_THEME_DIR_UNTHEMED GtkIconInfos, so we'll end up always passing a negative size to the GdkPixbuf loader, which is interpreted as the nominal size of the image file. Instead load the SVG at the desired scaled size in that case. This fixes blurry icon in the notification panel in gnome-shell. https://bugzilla.gnome.org/show_bug.cgi?id=744991
* icontheme: fill correct information when loading GResource-backed GIconsCosimo Cecchi2015-02-231-1/+15
| | | | | | | | | | When loading a GResource-backed GFileIcon into a GtkIconInfo we currently fail to populate the is_resource private field. Also, since is_svg is set by looking at the filename, and g_file_get_path() returns NULL for a GResourceFile, is_svg was always FALSE. https://bugzilla.gnome.org/show_bug.cgi?id=744991
* Reduce symbolic icon warnings to a debug messageMatthias Clasen2015-01-311-6/+8
| | | | | These icons are out there in the wild, and the warning causes distcheck to fail. So, reduce it to a debug message.
* docs: Explain 'icon theme context' better in gtkicontheme.cKjell Ahlstedt2014-12-071-3/+8
| | | | | | | | Add links from gtk_icon_theme_list_contexts() to gtk_icon_theme_list_icons(), and from there to the Icon Theme Specification and the Icon Naming Specification. https://bugzilla.gnome.org/show_bug.cgi?id=461249
* GtkIconTheme: Improve an error messageMatthias Clasen2014-11-031-2/+2
| | | | | Mention the name of the theme when an icon lookup fails. https://bugzilla.gnome.org/show_bug.cgi?id=687963
* GtkIconTheme: Repair symbolic fallback with rtl/ltrMatthias Clasen2014-09-211-6/+8
| | | | | | | | | | | | For symbolic icons, we prefer symbolics in inherited themes over generic icons in the theme itself. So far this was implemented by looking at icon_name[0] and looking that up in inherited themes if it is symbolic. But with automatic rtl/ltr handling, the first icon name will always have an -rtl or -ltr suffix, and an icon with that suffix is not going to exist in most cases. To fix this, look for shorter icon names too, as long as they are still symbolic. https://bugzilla.gnome.org/show_bug.cgi?id=737000
* Trivial: clarify a commentMatthias Clasen2014-09-211-1/+1
| | | | | Using 'highcolor' here seems confusing, since there is a theme by that name. Just say full-color.
* GtkIconTheme: Make suffix_from_name NULL-safeMatthias Clasen2014-09-051-12/+13
| | | | | | This can happen sometimes with GFileIcons that are not representable as a local path. Better not to crash in this case.
* Change way alpha is used when recoloring symbolicsAlexander Larsson2014-08-121-7/+28
| | | | | | | | | | | | | | | | | If the foreground color has an alpha != 1 we used to just pass that into the svg. This is useful to e.g. render an insensitive icon. However, that is not an ideal model for symbolics. For instance, if the icon uses overlapping areas when drawing, expecting these to be opaque then the transparent color will result in a different alpha value for the overlapping area. Also, non-foreground symbolic colors are still rendered opaque, and the recoloring of pngs can't handle transparent colors. So, instead we extract any alpha from the foreground, render using the opaque colors and then apply the foreground alpha to the entire result. This means we get an even transparency, even for other colors, and we can apply alpha for the pngs too. https://bugzilla.gnome.org/show_bug.cgi?id=734668
* icon-theme: Support recolorable .symbolic.png filesAlexander Larsson2014-08-031-27/+203
| | | | | | | | If an icon theme has a file called "foo-symbolic.symbolic.png" which was converted from svg using gtk-encode-symbolic-svg we will read it in an recolor, allowing symbolic icons without using librsvg. https://bugzilla.gnome.org/show_bug.cgi?id=730450
* GtkIconTheme: Make spinners scale in hi-dpiMatthias Clasen2014-07-171-5/+16
| | | | | | | | | | | The Adwaita icon theme ships spinners in a scalable directory with MaxSize=32 and Scale=1. One way to make them scale up in hi-dpi would be to add an @2 directory with MaxSize=32 and Scale=2, but that directory would also be consulted in non hi-dpi situations and give us an effective spinner max size of 64. Instead, treat svg icons implicitly as hi-dpi, and scale them up to MaxSize * 2 when in hi-dpi.
* GktIconTheme: Be even more careful with pathsРуслан Ижбулатов2014-07-151-6/+9
| | | | | | This is a followup for 5a252f13a863c00ccd9901afa110e85836a6af4c https://bugzilla.gnome.org/show_bug.cgi?id=733189
* GktIconTheme: Be more careful with pathsMatthias Clasen2014-07-141-5/+8
| | | | | | | Slapping file:// in front of a path does not guarantee a working uri (e.g. if you are on windows and the path looks like F:\\...). Therefore, go back to using g_file_new_for_path if we don't have to deal with a resource.
* Use a define for the default icon theme nameMatthias Clasen2014-07-091-2/+2
| | | | | We're using this name in two places, so match what we are doing for the default theme name, and use a macro.
* GtkIconTheme: Rename a macroMatthias Clasen2014-07-091-7/+7
| | | | | | We use DEFAULT_THEME_NAME in gtksettings.c as well, and this can be a confusing when grepping, so rename this to FALLBACK_ICON_THEME.
* icontheme: Use correct URI for icons in resource pathsStefano Facchini2014-07-091-2/+15
| | | | | Fix based on a patch by Stefano Faccini, https://bugzilla.gnome.org/show_bug.cgi?id=732894
* Deprecate gtk_icon_theme_add_builtin_iconMatthias Clasen2014-06-301-0/+6
| | | | | Builtin icons are deprecated in favor of loading icons from resource paths.
* Make gtk_icon_theme_add_resource_path public APIMatthias Clasen2014-06-301-0/+19
| | | | | | | This makes it possible to look up icons in resources using the icon theme api, and should be used as a replacement for installing icons below $pkgdatadir/icons and adding that location to the search path.
* GtkIconTheme: Allow unthemed icons from resource pathsMatthias Clasen2014-06-301-52/+83
| | | | | This makes it pretty straightforward to add individual icons that don't need to be present in multiple sizes.
* Drop an extra dir from builtin iconsMatthias Clasen2014-06-301-1/+1
| | | | | | Make icon lookup from resources work without the extra hicolor component in the path. It is redundant, since we always treat builtin icons as part of hicolor anyway.
* GtkIconTheme: Only look at resources for hicolorMatthias Clasen2014-06-301-21/+24
| | | | | We want to treat icons coming from resources as builtins that are looked at as part of Hicolor.
* GtkIconTheme: Drop an unused parameterMatthias Clasen2014-06-301-21/+6
| | | | We're always passing FALSE for scale_only, so why bother.
* Treat unthemed icons the same as force_size for scalingMatthias Clasen2014-06-301-1/+2
| | | | This is closer to what we were doing in the past.
* GtkIconTheme: Copy all fields in icon_info_dupMatthias Clasen2014-06-231-0/+5
| | | | | | This functionality is only exercised by gnome-shell, currently. Therefore, forgetting to copy a field here means an instant gnome-shell crash :-(. More tests needed.
* GtkIconTheme: Be more careful when warningMatthias Clasen2014-06-231-4/+4
| | | | | It sucks when printing a warning causes gnome-shell to crash, so be more careful about icon names being NULL here.
* GtkIconTheme: keep misplaced symbolics workingMatthias Clasen2014-06-231-1/+26
| | | | | | | | | | Recent changes made it a breaking mistake to install symbolic icons of the wrong size into a theme directory, or into the legacy unthemed icon location. Since this change affects many apps, do the extra work to keep these icons working, but emit warnings, in the hope that this will lead to cleaning up the mess over time.
* Move some comments aroundMatthias Clasen2014-06-221-7/+4
|
* Some documentation rewordingMatthias Clasen2014-06-221-17/+15
|
* GtkIconTheme: Drop an unused variableMatthias Clasen2014-06-221-3/+0
| | | | | We no longer need a separate field for symbolic icon size, now that we are using the directory size.
* GtkIconTheme: Load symbolic icons at the same sizeMatthias Clasen2014-06-221-25/+11
| | | | | | | | | | Reuse the scale information that we have from loading icons normally, when loading a symbolic icon, so that we apply the same size constraints. This commit assumes that svgs have the nominal size of the directory they are in, which will be true for all current symbolic icons.
* GtkIconInfo: Small struct packing improvementMatthias Clasen2014-06-221-1/+1
| | | | This makes the GtkIconInfo struct a bit smaller.
* GtkIconInfo: Drop an unused fieldMatthias Clasen2014-06-221-5/+0
| | | | | The GtkIconInfo threshold field was never used, so lets not carry it around.
* GtkIconTheme: Respect limits in theme dirsMatthias Clasen2014-06-221-17/+16
| | | | | | | | | | | | | | | Previously, we were taking thresholds and min/max sizes into account when choosing the best theme dir, but when it came to loading the icon, we always scaled icons from scalable directories all the way, ignoring the min/max size limits. This commit changes things around so that we now load icons in Threshold directories at their nominal size, and scale icons in Scalable directories only up to the specified limits. To override this and keep the previous behaviour of scaling all the way to the desired size, use the GTK_ICON_THEME_FORCE_SIZE flag.
* GtkIconTheme: Drop an unused functionMatthias Clasen2014-06-201-9/+0
|
* GtkIconTheme: Small cleanupMatthias Clasen2014-06-201-16/+6
| | | | Make the default symbolic colors a little more readable in the code.
* GtkIconTheme: Trivial cleanupMatthias Clasen2014-06-201-30/+29
| | | | | Drop the _-prefix from a static function. We've agreed to no stop using those prefixes.
* GtkIconTheme: Don't create empty IconThemeDir structsMatthias Clasen2014-06-201-39/+44
| | | | | Starting gtk3-demo currently creates ~1200 of these, most of them for nonexisting directories. Lets try to avoid that.
* Revert "Document gtk_icon_theme_add_resource_path"Matthias Clasen2014-06-201-16/+0
| | | | This reverts commit 988b6b483dc9c21d050161d26652bb1006b9c686.
* Revert "Deprecate gtk_icon_theme_add_builtin_icon"Matthias Clasen2014-06-201-5/+0
| | | | This reverts commit 923eeda2d3cae13d02b0a9d2e5774b12eed999e0.
* Deprecate gtk_icon_theme_add_builtin_iconMatthias Clasen2014-06-201-0/+5
|
* Document gtk_icon_theme_add_resource_pathMatthias Clasen2014-06-201-0/+16
|
* GtkIconTheme: Include legacy stock icons from resourcesMatthias Clasen2014-06-201-0/+26
| | | | | | Add /org/gtk/libgtk/icons as a resource path, and ensure that we always parse an index.theme file for hicolor which makes the builtin icons available as part of the hicolor theme.
* GtkIconTheme: Allow loading icons from resourcesMatthias Clasen2014-06-201-17/+108
| | | | | | We add a new API, gtk_icon_theme_add_resource_path, which can be used to add resource path as a base location for icon theme content, similar to gtk_icon_theme_append_search_path.
* GtkIconTheme: Drop the all_icons hash tableMatthias Clasen2014-06-201-17/+2
| | | | It is not used anywhere anymore.