Commit Graph

365 Commits

Author SHA1 Message Date
Benjamin Otte
a620a1d688 win32: Remove unused functions / header includes 2016-02-11 03:44:48 +01:00
Alberts Muktupāvels
7ac337a9af gtksettings: fix critical warning
Commit 5186aeb90f introduced critical
warning - g_value_copy: assertion 'g_value_type_compatible (...)' failed.

https://bugzilla.gnome.org/show_bug.cgi?id=761381
2016-02-04 11:45:50 +02:00
Alberts Muktupāvels
5186aeb90f gtksettings: reset property to correct default value
https://bugzilla.gnome.org/show_bug.cgi?id=76138
2016-02-02 18:15:07 +02:00
Alberto Ruiz
496f0892fc introspection: This patch fixes nullable return values fixes for the following symbols in gtk
gtk_accel_group_query
  gtk_accel_group_from_accel_closure
  gtk_accel_label_get_accel_widget
  gtk_accessible_get_widget
  gtk_actionable_get_action_name
  gtk_app_chooser_get_app_info
  gtk_app_chooser_button_get_heading
  gtk_app_chooser_dialog_get_heading
  gtk_application_get_window_by_id
  gtk_assistant_get_nth_page
  gtk_binding_set_find
  gtk_builder_get_object
  gtk_builder_lookup_callback_symbol
  gtk_builder_get_application
  gtk_button_get_image
  gtk_cell_area_get_focus_from_sibling
  gtk_cell_renderer_start_editing
  gtk_cell_view_get_model
  gtk_cell_view_get_displayed_row
  gtk_clipboard_get_owner
  gtk_container_get_focus_child
  gtk_container_get_focus_vadjustment
  gtk_container_get_focus_hadjustment
  gtk_dialog_get_widget_for_response
  gtk_drag_get_source_widget
  gtk_drag_dest_get_target_list
  gtk_drag_source_get_target_list
  gtk_entry_completion_get_model
  gtk_entry_completion_compute_prefix
  gtk_expander_get_label_widget
  gtk_file_chooser_get_filename
  gtk_file_chooser_get_current_folder
  gtk_file_chooser_get_uri
  gtk_file_chooser_get_current_folder_uri
  gtk_file_chooser_get_preview_widget
  gtk_file_chooser_get_preview_file
  gtk_file_chooser_get_preview_filename
  gtk_file_chooser_get_preview_uri
  gtk_file_chooser_get_extra_widget
  gtk_file_chooser_get_filter
  gtk_file_chooser_native_get_accept_label
  gtk_file_chooser_native_get_cancel_label
  gtk_file_filter_get_name
  gtk_font_chooser_get_font_family
  gtk_font_chooser_get_font_face
  gtk_font_chooser_get_font
  gtk_font_chooser_get_font_desc
  gtk_font_chooser_get_font_map
  gtk_frame_get_label
  gtk_gesture_get_device
  gtk_gesture_get_window
  gtk_gl_area_get_error
  gtk_header_bar_get_title
  gtk_header_bar_get_subtitle
  gtk_header_bar_get_custom_title
  gtk_icon_info_get_filename
  gtk_icon_view_get_path_at_pos
  gtk_icon_view_get_model
  gtk_image_get_pixbuf
  gtk_image_get_animation
  gtk_label_get_mnemonic_widget
  gtk_label_get_attributes
  gtk_check_version
  gtk_menu_button_get_popup
  gtk_menu_button_get_menu_model
  gtk_menu_button_get_align_widget
  gtk_menu_button_get_popover
  gtk_menu_item_get_submenu
  gtk_menu_item_get_accel_path
  gtk_native_dialog_get_title
  gtk_native_dialog_get_transient_for
  gtk_notebook_get_nth_page
  gtk_notebook_get_tab_label_text
  gtk_notebook_get_menu_label
  gtk_notebook_get_menu_label_text
  gtk_notebook_get_group_name
  gtk_notebook_get_action_widget
  gtk_offscreen_window_get_surface
  gtk_offscreen_window_get_pixbuf
  gtk_paned_get_child1
  gtk_paned_get_child2
  gtk_places_sidebar_get_location
  gtk_places_sidebar_get_nth_bookmark
  gtk_plug_get_socket_window
  gtk_popover_get_default_widget
  gtk_progress_bar_get_text
  gtk_recent_filter_get_name
  gtk_recent_manager_lookup_item
  gtk_settings_get_default
  gtk_socket_get_plug_window
  gtk_stack_sidebar_get_stack
  gtk_stack_switcher_get_stack
  gtk_style_context_get_section
  gtk_style_context_get_parent
  gtk_style_context_get_frame_clock
  gtk_test_find_widget
  gtk_text_buffer_get_mark
  gtk_text_tag_table_lookup
  gtk_text_view_get_tabs
  gtk_text_view_toggle_cursor_visible
  gtk_text_view_get_window
  gtk_toolbar_get_nth_item
  gtk_tool_button_get_label
  gtk_tool_button_get_icon_name
  gtk_tool_button_get_label_widget
  gtk_tool_button_get_icon_widget
  gtk_tool_palette_get_drop_item
  gtk_tool_palette_get_drop_group
  gtk_tree_model_filter_convert_child_path_to_path
  gtk_tree_model_filter_convert_path_to_child_path
  gtk_tree_model_sort_convert_child_path_to_path
  gtk_tree_model_sort_convert_path_to_child_path
  gtk_tree_view_get_column
  gtk_tree_view_get_bin_window
  gtk_tree_view_column_get_widget
  gtk_tree_view_column_get_tree_view
  gtk_widget_get_frame_clock
  gtk_window_group_get_current_device_grab
  GtkTextBufferSerializeFunc
2016-01-08 12:18:23 +00:00
Alberts Muktupāvels
8ffa8b3a49 gtksettings: notify after property reset 2015-12-23 05:55:47 +02:00
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