Commit Graph

360 Commits

Author SHA1 Message Date
Matthias Clasen
98fd5bda58 Tweak the gtk-font-name setting docs
Clarify that only parts of the font name are used.

https://bugzilla.gnome.org/show_bug.cgi?id=758367
2015-11-23 08:18:37 -05:00
Matthias Clasen
1f585151fd Load settings.ini from all data dirs
An error in the loading function was making us load the file from
the first data dir repeatedly, instead.

https://bugzilla.gnome.org/show_bug.cgi?id=757377
2015-10-31 18:16:10 -04:00
Matthias Clasen
2f0d4b6868 Add gtk_settings_reset_property
This api undoes an application-specific override and makes the
setting follow the system-wide values again.

https://bugzilla.gnome.org/show_bug.cgi?id=755008
2015-10-03 22:42:12 -04:00
Matthias Clasen
3c54fbd3ac Use stupid quotes instead of dumb quotes
Following a similar change in GLib a while ago.

'bla' may by stupid, but it looks less dumb than `bla'.
2015-09-23 07:01:16 -04:00
Matthias Clasen
29c799a1e7 Use g_object_get_qdata instead of g_object_get_data
This is less expensive.
2015-09-12 12:50:39 -04:00
Matthias Clasen
b8e82a1548 settings: Reuse a value
We've already gotten the value type, use it.
2015-09-09 06:32:45 -04:00
Matthias Clasen
4785f460d3 settings: Convert more fully to g_object_notify_by_pspec
It turns out that we always have the pspec at hand already.
2015-09-08 08:07:32 -04:00
Matthias Clasen
9b494df91e settings: Avoid one case of g_object_notify
We already have the GParamSpec in hands, lets just use it instead
of looking it up again.
2015-09-07 11:36:37 -04:00
Emmanuele Bassi
06488adc9a docs: Fix GtkSettings property stanzas
Otherwise gtk-button-images and gtk-menu-images will not be recognised
as properties.

https://bugzilla.gnome.org/show_bug.cgi?id=754421
2015-09-01 23:46:40 +01:00
Matthias Clasen
6f194564ff Use pango_fc_font_map_config_changed
Use pango_fc_font_map_confit_changed() instead of
pango_fc_font_map_cache_clear().

https://bugzilla.gnome.org/show_bug.cgi?id=748772
2015-07-31 00:50:47 -04:00
Kalev Lember
6b05a686dc GtkSettings: Fix a documentation typo 2015-07-12 20:18:17 +02:00
nick
802b006b37 settings: Include pangofc-fontmap.h header on Wayland
In case the X11 backend is not enabled, we still need to include the
pangofc-fontmap.h header file, as we use the Pango/FontConfig API in
both the X11 and Wayland case.

https://bugzilla.gnome.org/show_bug.cgi?id=751625
2015-06-29 20:41:04 +01:00
Matthias Clasen
2caa1deb5b Fix up index for some 3.14 symbols
Marking these as "Since: 3.14.1" may be more accurate, but
it causes gtk-doc to not put these symbols in any versioned
index at all (it generates an unused index for 3.14.1). So,
lets lie a little, and say these symbols were added in 3.14.
2015-06-20 10:28:03 -04:00
Emmanuele Bassi
8b06900362 settings: Fix the type annotation for color-hash
The (element-type) annotation cannot be used with properties that return
container types like GHashTable; we need to use the (type) annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=750489
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
d11e81257e docs: Improve deprecation notices for GtkSettings
The button and menu item icons settings are deprecated; application
developers should control whether or not a widget should show an icon,
using the existing API.

https://bugzilla.gnome.org/show_bug.cgi?id=750718
2015-06-11 11:45:03 +01:00
Руслан Ижбулатов
26c24328d5 GDK: Add cursor theme support to W32 backend
Load themed cursors from the same places they are loaded on freedesktop systems,
but use W32 API functions to do so (works for .cur/.ani cursors instead of X
cursors).

Refactor the code for cursor handling. Prefer loading cursors by name.

Do not load actual cursors when loading the theme. Find the files and remember
the arguments/calls for loading them instead. Keeping HCURSOR instance in the
hashmap would result in multiple GdkCursors using the same HCURSOR. Given that
we use DestroyCursor() to off them, this would cause problems (at the very
least - DestroyCursor() would fail).

Store GdkCursor instances in a cache. Update cached cursors when theme changes.

Recognize "system" theme as a special (and default) case. When it is set,
prefer system cursors and fall back to Adwaita cursors and (as a last resort)
built-in X cursors. Otherwise prefer theme cursors and fall back to system and
X cursors.

Force GTK to use "left_ptr" cursor when no cursor is set. Using NULL makes
it use the system default "arrow", which is not the intended behaviour when
a non-system theme is selected.

Ignore cursor size setting and query the OS for the required cursor size, as
Windows (almost) does not allow setting cursors of arbitrary size.

https://bugzilla.gnome.org/show_bug.cgi?id=749287
2015-05-20 08:42:24 +00:00
Emmanuele Bassi
487332c458 settings: Wayland-only systems also use fontconfig
We're relying on the X11 backend being compiled in, but that may not be
the case.

https://bugzilla.gnome.org/show_bug.cgi?id=748782
2015-05-05 11:22:53 +01:00
Matthias Clasen
ff558d3d39 Drop PANGO_ENABLE_BACKEND
Not needed for a long time now.

https://bugzilla.gnome.org/show_bug.cgi?id=748783
2015-05-04 08:02:32 -04:00
Philip Withnall
3d88899072 gtk: Fix various tiny typos in documentation comments
e.g. Invalid syntax in introspection annotations, typos in object names,
accidentally using a gtk-doc comment for an internal function.
2015-02-18 11:38:37 +00:00
Benjamin Otte
808bfe0a98 settings: Provide a default style cascade per scale
This guarantees we only create 1 extra style cascade in total for hidpi
and not one per style context.

Style cascades are now nested like this:

GtkSettings root cascade (scale == 1)
 |
 +-- GtkSettings per scale cascade (for any scale, no custom providers)
 |
 +-- GtkStyleContext custom cascade (for any scale, custom providers)

This requires a bunch of care when changing cascade-related properties
inside GtkStyleContext, so that it ends up with a properly setup
cascade, but I think I got those cases right.

The only thing we don't do yet is reverting to a GtkSettings cascade
when the last custom provider is removed from a custom cascade.
2015-02-06 11:26:31 +01:00
Matias De lellis
7ff3ef3e68 GtkSettings: Consider default settings for font hinting and antialias
Arrange things so that gtk-xdg-hinting==-1 and gtk-xfg-antialias==-1
end up as CAIRO_HINT_STYLE_DEFAULT and CAIRO_ANTIALIAS_DEFAULT in the
cairo font options.

This will not change anything on Linux desktops where xsettings will
always provide values different from -1. But on other platforms, we
can benefit from getting the platform-specific defaults in cairo.

Based on the first patch in:
https://bugzilla.gnome.org/show_bug.cgi?id=735316
2015-01-30 18:29:53 -05:00
Benjamin Otte
b49c7c3421 styleprovider: Fold get_change() vfunc into lookup() 2014-12-10 03:49:40 +01:00
Matthias Clasen
32e8c39ffd Move print preview command to gtksettings.c
Having this in the source seems more appropriate.
2014-11-30 23:43:52 -05:00
Matthias Clasen
10f3d330be Fix docs for gtk_settings_set_property_value 2014-10-22 00:32:38 -04:00
Matthias Clasen
ce915dc6f0 Deprecate gtk_settings_install_property APIs
These are not useful outside GTK+.
2014-10-19 22:33:24 -04:00
Matthias Clasen
4f5db65a06 Deprecate some GtkSettings api
The gtk_settings_set_...property functions don't really add
anything over g_object_set(), and we never documented them.
2014-10-19 21:22:02 -04:00
Matthias Clasen
c8a6b8786a Clarify GtkSettings documentation
Just recommend g_object_set to override settings. The
gtk_settings_set_..._property functions don't really add
any value.
2014-10-19 20:47:05 -04:00
Matthias Clasen
1d8a1a04f6 Add settings for titlebar actions
These match the GSettings that mutter/metacity/gnome-shell have
for this. We change the default for the middle-click action to
none, since lower is just a terrible default.

We're slightly bending the rules here, since we're adding new
settings after .0, but a) it is just barely after .0, and b) settings
are not really application API.

https://bugzilla.gnome.org/show_bug.cgi?id=729782
2014-09-25 14:54:02 -04:00
Matthias Clasen
18931cf0db GtkSettings: Add a private getter for the source
Settings have a little more metadata than plain properties. They
can come from different sources. Make this information available
so we can show it in the inspector.

https://bugzilla.gnome.org/show_bug.cgi?id=736971
2014-09-22 19:40:49 -04:00
Руслан Ижбулатов
694c8d32d5 Fix various warnings about unused things
https://bugzilla.gnome.org/show_bug.cgi?id=734735
2014-08-13 23:38:47 +00:00
Owen W. Taylor
fc6e2cc4b2 Handle resolution changes in the GDK backend code
gdk_x11_display_set_window_scale() affects the interpretation of the
Xft/DPI XSETTING - it is substituted inside GDK with the value of
Gdk/UnscaledDPI xsetting. However, this change is not propagated to
GTK+ and from GTK+ back to gdk_screen_set_resolution() until the
main loop is run.

Fix this by handling the screen resolution directly in gdk/x11.
This requires duplication of code between GDK and GTK+ since we still
have to handle DPI in GTK+ in the case that GdkSettings:gtk-xft-dpi
is set by the application.

https://bugzilla.gnome.org/show_bug.cgi?id=733076
2014-07-13 15:35:23 -04:00
Matthias Clasen
f547466029 Make Adwaita the default theme across platforms
This ensures that we have a polished out-of-the-box appearance
on all platforms.
2014-07-09 21:19:09 -04:00
Matthias Clasen
6abcda8391 Use a define for the default icon theme name
We're using this name in two places, so match what we are doing
for the default theme name, and use a macro.
2014-07-09 21:18:18 -04:00
Matthias Clasen
196b9f8eea GtkSettings: fully undeprecate blink settings
We decided in f8412eca34 that
we still need to react to these for a11y reasons, but left
the (then) harmless property deprecation in place. Now, the
deprecation causes runtime warnings for merely reading the
property, so drop it.

https://bugzilla.gnome.org/show_bug.cgi?id=732667
2014-07-03 08:35:34 -04:00
Matthias Clasen
1cd9ba187e GtkSettings: defensive defaults
Change the default value of the gtk-decoration-layout setting
to menu:minimize,maximize,close. The masses want it that way.
2014-06-27 21:29:18 -04:00
Evan Nemerson
07d825574f gtk: add missing type annotations ported from Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=730745
2014-05-27 21:10:33 -07:00
Matthias Clasen
2488b954f2 Don't use hicolor as the default icon-theme
The icontheme lookup code has a special-case that prefers builtin icons
if the theme name is "hicolor". This is problematic for our reftests,
which run in a barebones environment with not settings.
2014-05-26 23:17:32 -04:00
Carlos Garnacho
1403ebb097 settings: Add gtk-long-press-time setting
This setting determines the duration of a button/touch press to
be considered a long press.
2014-05-23 19:54:24 +02:00
Matthias Clasen
49cf5142ba Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
2014-05-22 09:09:55 -04:00
Matthias Clasen
e5a1734ce9 docs: enum cleanup
scrolledwindow part 2
2014-05-20 09:54:01 -04:00
Matthias Clasen
ca79019586 GtkSettings: load modules from settings.ini
The initialization is really suboptimal here. This fix at least
makes it so that we don't forget to load modules.

https://bugzilla.gnome.org/show_bug.cgi?id=730306
2014-05-19 14:09:16 -04:00
Matthias Clasen
644f08a771 Remove debug spew 2014-05-07 06:51:51 -04:00
Volker Sobek
f8b6bfe744 docs: Remove '\' escape character from literals
commit 7f6a964c47 replaced entities, but
escaped the replacement text also inside literals, which resulted in the
escaping '\' to also appear in the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=727322
2014-04-04 01:24:35 -04:00
Matthias Clasen
15004e5930 Allow selecting a dark variant with GTK_THEME
Dark themes need to be debugged, too.

Author:    Matthias Clasen <mclasen@redhat.com>
2014-03-06 19:30:33 -05:00
Matthias Clasen
fac8d6deea Allow applications to use gtk-menu-bar-accel in 3.12
gnome-terminal is still using this setting, so we'll let
applications override it for another cycle. It is no longer
backed by a system-wide setting, though, and it will still
go away eventually.

This partically reverts b26c74e5da
2014-03-03 18:58:36 -05:00
Matthias Clasen
ba0542dc51 Allow applications to use gtk-enable-mnemonics in 3.12
gnome-terminal is still using this setting, so we'll let
applications override it for another cycle. It is no longer
backed by a system-wide setting, though, and it will still
go away eventually.

This partically reverts 7e3a494fac
2014-03-03 18:58:26 -05:00
William Jon McCann
e3df44c6f7 Don't leak the theme name 2014-02-21 15:22:38 -05:00
Benjamin Otte
6de50aa7d9 settings: Store style cascade in settings object
This ensures that the initialization for the CSS theme happens when the
style cascade gets queried.

https://bugzilla.redhat.com/show_bug.cgi?id=1064922
https://bugzilla.mozilla.org/show_bug.cgi?id=972382
2014-02-20 02:10:07 +01: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 /&ast; anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00