Commit Graph

279 Commits

Author SHA1 Message Date
Matthias Clasen
fe92c4478e Move some comments around 2014-06-22 22:04:00 -04:00
Matthias Clasen
a44f01c573 Some documentation rewording 2014-06-22 16:46:11 -04:00
Matthias Clasen
6cc32c24be GtkIconTheme: Drop an unused variable
We no longer need a separate field for symbolic icon size,
now that we are using the directory size.
2014-06-22 11:52:11 -04:00
Matthias Clasen
b96058c3b7 GtkIconTheme: Load symbolic icons at the same size
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.
2014-06-22 11:52:11 -04:00
Matthias Clasen
acb276c644 GtkIconInfo: Small struct packing improvement
This makes the GtkIconInfo struct a bit smaller.
2014-06-22 11:52:11 -04:00
Matthias Clasen
f2b98f45db GtkIconInfo: Drop an unused field
The GtkIconInfo threshold field was never used, so lets not
carry it around.
2014-06-22 11:52:10 -04:00
Matthias Clasen
a10412f49e GtkIconTheme: Respect limits in theme dirs
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.
2014-06-22 11:52:10 -04:00
Matthias Clasen
240daf55a1 GtkIconTheme: Drop an unused function 2014-06-20 20:40:52 -04:00
Matthias Clasen
2472cf22db GtkIconTheme: Small cleanup
Make the default symbolic colors a little more readable in the code.
2014-06-20 20:40:52 -04:00
Matthias Clasen
669bc909d8 GtkIconTheme: Trivial cleanup
Drop the _-prefix from a static function.
We've agreed to no stop using those prefixes.
2014-06-20 20:40:51 -04:00
Matthias Clasen
5ddacf094e GtkIconTheme: Don't create empty IconThemeDir structs
Starting gtk3-demo currently creates ~1200 of these, most
of them for nonexisting directories. Lets try to avoid that.
2014-06-20 12:15:25 -04:00
Matthias Clasen
4f1ff179bb Revert "Document gtk_icon_theme_add_resource_path"
This reverts commit 988b6b483d.
2014-06-20 08:46:42 -04:00
Matthias Clasen
a31e8369f8 Revert "Deprecate gtk_icon_theme_add_builtin_icon"
This reverts commit 923eeda2d3.
2014-06-20 08:46:24 -04:00
Matthias Clasen
923eeda2d3 Deprecate gtk_icon_theme_add_builtin_icon 2014-06-20 01:17:47 -04:00
Matthias Clasen
988b6b483d Document gtk_icon_theme_add_resource_path 2014-06-20 01:17:47 -04:00
Matthias Clasen
49bcaf844c GtkIconTheme: Include legacy stock icons from resources
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.
2014-06-20 01:17:46 -04:00
Matthias Clasen
968ea4186d GtkIconTheme: Allow loading icons from resources
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.
2014-06-20 01:17:46 -04:00
Matthias Clasen
13c354db8d GtkIconTheme: Drop the all_icons hash table
It is not used anywhere anymore.
2014-06-20 01:17:46 -04:00
Matthias Clasen
11ec8f7285 GtkIconTheme: Stop using the all_icons hash table
This hash table was used in gtk_icon_theme_has_icon; we can
implement that function just as well without it and save some
memory.
2014-06-20 01:17:45 -04:00
Matthias Clasen
6549031030 Formatting fixes 2014-06-20 01:17:45 -04:00
Matthias Clasen
aa44c0ca53 GtkIconTheme: Drop the code for parsing .icon files
Modern icon themes don't ship .icon files anyway.
2014-06-20 01:17:45 -04:00
Matthias Clasen
84bc9bba42 GtkIconTheme: Deprecate functionality related to .icon files
This functionality is not used at all in modern icon themes.
2014-06-20 01:17:45 -04:00
Matthias Clasen
36be12578c Drop the builtin icon cache
We don't need it anymore, now that the non-standard stock icons
are using resources.
2014-06-20 01:17:44 -04:00
Matthias Clasen
c9e848b659 GtkIconTheme: Fix svg loading with FORCE_SIZE
Paradoxically, we were loading svgs at the nominal size when
FORCE_SIZE is specified, while scaling them exactly when it
isn't.
	../build/win32/vs10/gtk.vcxproj
2014-06-18 19:09:37 -04:00
Alexander Larsson
3574a809fa icon theme: Fix crash for builtin icons
This pushes the initialization of is_svg to an earlier point
when the GtkIconInfo is created. This is needed because an icon
info doesn't necessarily always have a filename that we can later
extract the suffix from. For instance, builtin icons have NULL
filename.

https://bugzilla.gnome.org/show_bug.cgi?id=721895
2014-06-17 13:54:13 -04:00
Jasper St. Pierre
c2bf7a887c gtkicontheme: Fix a missing case where we forget to set is_svg
When duplicating the icon_info, we forgot to set is_svg. This meant that
any application that used gtk_icon_info_load_icon_async wouldn't have
is_svg set properly.

This fixes blurry icons in the gnome-shell app picker.
2014-06-16 10:47:34 -04:00
Matthias Clasen
62f8dae7a8 gtkicontheme: Don't query CONTENT_TYPE to determine svg
We already know based on the suffix of the filename.

https://bugzilla.gnome.org/show_bug.cgi?id=721895
2014-06-14 18:54:24 -04:00
Matthias Clasen
fea939b3d7 GtkIconTheme: Don't treat svg icons specially
This changes makes svg icons go through the same scale calculation
code as png icons. As a consequence, an svg that is put into the
32x32 directory will actually be loaded at size 32, even if it
gets requested at a bigger size. This will let us avoid giant
spinners.

https://bugzilla.gnome.org/show_bug.cgi?id=731658
2014-06-14 15:10:49 -04:00
Evan Nemerson
54ec42f035 gtk: port many nullability annotation fixes from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-30 13:24:20 -07:00
Evan Nemerson
a77765f172 gtk: add missing ownership annotations ported from Vala
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:33 -07:00
Matthias Clasen
72c79deb3b GtkIconTheme: Add more debug spew
Still trying to track down test problems in gnome-continuous.
2014-05-24 18:20:31 -04:00
Matthias Clasen
0f5814aa33 icontheme: Add a test for lookup order
Add tests that verify the expected lookup order between -symbolic,
-rtl/-ltr and generic fallback.
2014-05-14 04:28:36 +02:00
Matthias Clasen
b0b205040c GtkIconTheme: Support looking up directional variants
Add two new icon lookup flags, GTK_ICON_LOOKUP_DIR_LTR and _RTL,
which tell GtkIconTheme to look for icon variants which have a
-ltr or -rtl suffix. GtkIconHelper adds these lookup flags when
looking up icons.

Note that due to the way this overlaps with symbolic icon lookup,
directional variants of symbolic icons must be called -symbolic-rtl, not
-rtl-symbolic.

https://bugzilla.gnome.org/show_bug.cgi?id=729980
2014-05-14 04:28:36 +02:00
Benjamin Otte
89d6598d5b icontheme: Split out symbolicness tests into own function 2014-05-14 04:28:36 +02:00
Benjamin Otte
5d1b5c13fb icontheme: Don't force missing icon
When forcing regular or symbolic icons, fall back to the default
specified icons. This ensures that when no symbolic icon is present, an
icon will still appear - the regular one.
2014-05-14 04:28:34 +02:00
Benjamin Otte
9619b8cff4 API: icontheme: Add 2 new GtkIconLookupFlags
GTK_ICON_LOOKUP_FORCE_REGULAR and GTK_ICON_LOOKUP_FORCE_SYMBOLIC can be
used to force a regular or symbolic icon to be loaded, even if the icon
names specify a different version.

This is intended to support the CSS property -gtk-icon-style.
2014-05-14 04:28:34 +02:00
Matthias Clasen
7b17060654 GtkIconFactory: Remove outdated information from the docs
The stock browser was removed from gtk3-demo.
2014-05-11 22:02:45 -04:00
Matthias Clasen
b6e724e76f Add Adwaita to the list of default icon themes
Hardcode the fallback to Adwaita. I'm leaving gnome in here for
now, since we're in the middle of the transition. It will be
removed before 3.14.
2014-04-26 10:14:38 -04:00
Bastien Nocera
f71f7215ab all: Name more idles and timeouts
Following up from 438cd857c4,
name more timeouts and idles.

The original grep was missing checking for gdk_threads_add_*()
functions (at least for some of the files).

https://bugzilla.gnome.org/show_bug.cgi?id=726870
2014-03-26 20:09:30 -04:00
Cosimo Cecchi
99dc47e7fd icontheme: fix emblemed icons fallout
Commit faba7df4fe changed the logic in
apply_emblems() so that GtkIconInfo->emblems_applied would be set to
TRUE even in case there was no emblem info available, which confuses the
theme cache.
This commit changes the logic back, so that NULL is returned from
apply_emblems_to_pixbuf() when there are no emblems available, fixing
the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=726830
2014-03-24 20:17:21 -04:00
Balint Reczey
4ce5fcc5c8 documentation: clarify gtk_icon_theme_add_builtin_icon() usage
https://bugzilla.gnome.org/show_bug.cgi?id=726135
2014-03-12 22:55:52 -04:00
Cosimo Cecchi
faba7df4fe icontheme: support emblems in symbolic icons
We were failing to apply emblems in the symbolic icons code path.

https://bugzilla.gnome.org/show_bug.cgi?id=725683
2014-03-04 17:38:32 -08:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
c779b42476 Docs: use // for comments in examples
Without sgml mode, we can't escape /* as /* anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
Matthias Clasen
2671fa98f8 Revert "gtkicontheme: Don't query CONTENT_TYPE to determine if something is an SVG"
This reverts commit f929a61399.

It caused blurry icons in gnome-shell, and we haven't been able
to track down why yet.
2014-02-12 22:36:59 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
William Jon McCann
285d216d3e docs: use apostrophe in *'ll 2014-02-07 13:35:54 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00