Commit Graph

56274 Commits

Author SHA1 Message Date
Timm Bäder
40ae5c1319 Merge branch 'benzea/foreach-documentation' into 'master'
container: Document that removal from foreach is permissible

Closes #1461

See merge request GNOME/gtk!423
2018-11-19 13:38:34 +00:00
Benjamin Berg
8c9c3e4426 container: Document that removal from foreach is permissible
It is permissable to remove a widget using gtk_container_remove from the
gtk_container_foreach callback handler. Document this fact to make it
more discoverable.

Fixes #1461
2018-11-19 13:58:34 +01:00
Timm Bäder
d0f4fcb6fd Merge branch 'akitouni/gdkvulkan-doc-typo' into 'master'
vulkancontext: fix typos in documentation

See merge request GNOME/gtk!417
2018-11-19 07:41:36 +00:00
Timm Bäder
4142d0a69a Merge branch 'more-nullable' into 'master'
g-i: Add some nullable annotations

See merge request GNOME/gtk!419
2018-11-19 07:40:39 +00:00
Christoph Reiter
b061821f24 g-i: Add some nullable annotations
Based on grepping arg docs for NULL.
See https://gitlab.gnome.org/GNOME/pygobject/issues/261
2018-11-18 13:36:50 +01:00
Abderrahim Kitouni
e0833e492c vulkancontext: fix typos in documentation 2018-11-17 19:35:47 +01:00
Timm Bäder
55faaf1aa1 Merge branch 'jjardon/no_G_TYPE_INSTANCE_GET_PRIVATE' into 'master'
Stop using G_TYPE_INSTANCE_GET_PRIVATE completely

See merge request GNOME/gtk!402
2018-11-15 09:59:01 +00:00
Timm Bäder
7aa02b9e95 Merge branch 'include-ft2build.h' into 'master'
font chooser: Properly include freetype headers

Closes #1432

See merge request GNOME/gtk!413
2018-11-14 13:30:28 +00:00
Timm Bäder
c65c6ba11f widget: Fix size-allocate signal docs 2018-11-13 20:54:18 +01:00
Timm Bäder
359d874ddb Use g_clear_pointer to unparent widgets 2018-11-13 20:53:14 +01:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Timm Bäder
1f1306a53b docs: Add GtkEventControllerLegacy 2018-11-13 15:40:42 +01:00
Timm Bäder
ce3d5fcb0a vulkancontext: Add missing error switch 2018-11-13 15:28:46 +01:00
Timm Bäder
28bd56454d appchooserbutton: Remove priv pointer 2018-11-13 15:19:07 +01:00
Timm Bäder
75deff035b testappchooserbutton: Fix for class hierarchy change 2018-11-13 15:19:07 +01:00
Timm Bäder
87ee7e31a4 appchooserbutton: Inherit from GtkWidget 2018-11-13 15:19:05 +01:00
Timm Bäder
5a3ecb9703 render: Fix a position/size mixup
Fixes the foreigndrawing demo.
2018-11-13 14:10:17 +01:00
Timm Bäder
e656f66720 toolbar: Remove dead code
The size definitely changes, otherwise ->size_allocate does not get
called.
2018-11-13 14:10:17 +01:00
Timm Bäder
0d47a6c970 toolbar: Remove some unused defines 2018-11-13 14:10:16 +01:00
Matthias Clasen
39f8e1e137 wayland: Adapt to settings portal api change
ReadAll now accepts an array of patterns.
2018-11-12 13:51:56 -05:00
Carlos Garnacho
d7c2e5844b Merge branch 'scroll-event-propagation' into 'master'
eventcontrollerscroll: Conditionally propagate ::scroll

Closes #45

See merge request GNOME/gtk!250
2018-11-12 10:05:46 +00:00
Ernestas Kulik
edc4b2f7d0 eventcontrollerscroll: Conditionally propagate ::scroll
Currently, gtk_event_controller_scroll_handle_event() always returns
TRUE if it is handled, which stops the propagation of the event. If
there’s a single GtkEventControllerScroll in the widget hierarchy, that
means that no others will run, depending on the propagation phase. In
Nautilus, this can be observed when adding a scroll controller to the
GtkScrolledWindow (ctrl-scrolling controls the zoom level) - either the
scrolling or the zooming breaks.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/45
2018-11-12 10:35:37 +01:00
Leonardo Taccari
b3ba2961d2 font chooser: Properly include freetype headers
freetype headers should be included via <ft2build.h> and then
indirectly via FT_*_H macros.

Fixes issue #1432.
2018-11-09 22:13:30 +01:00
Timm Bäder
c2c1acc73e calendar: Remove unused struct member 2018-11-09 20:18:13 +01:00
Timm Bäder
c44728282c scrolledwindow: Remove some useless code
This is all being done already be the add_class/remove_class calls
before.
2018-11-09 19:37:55 +01:00
Timm Bäder
85a002bf9f scale: Don't set label css name to "label"
That's already the css name of all labels.
2018-11-09 18:59:30 +01:00
Timm Bäder
6eba544ad4 colorscale: Remove x/y arguments from snapshot_scale
We only pass 0 anyway.
2018-11-09 18:01:58 +01:00
Jakub Steiner
f610fbfc0e Adwaita: use HIG grey for bg_color
- refresh with a light bg color, use the new color palette
2018-11-09 15:37:08 +01:00
Jakub Steiner
1e2d11cc62 Adwaita: fix osd bg color
- don't try deriving from bg_color, osd should be consistent
  for light & dark.

FIxes issue #1449
2018-11-09 11:19:41 +01:00
Adrien Plazas
f1e24ca30a Adwaita: Propagate bg color to titlebar separator descendants
Gives the same background color to all separators descending from a
title bar than to its direct childrens.

This prevents separators which are in a titlebar but not direct children
from the widget with the titlebar style class from being almost
transparent and hence it prevent them from revealing the clear color of
the window's titlebar (black).

https://gitlab.gnome.org/GNOME/gtk/issues/1231
2018-11-09 08:49:38 +01:00
Jakub Steiner
1787f04097 Merge branch 'wip/jimmac/insensitive-progress' into 'master'
Adwaita: draw insensitive progressbars

See merge request GNOME/gtk!360
2018-11-09 07:27:49 +00:00
Jakub Steiner
671f69c6ca Merge branch 'wip/jimmac/hig-colors-gtk4' into 'master'
Adwaita: use new HIG colors

See merge request GNOME/gtk!407
2018-11-09 07:25:05 +00:00
Jakub Steiner
7b51de6bbd Adwaita: use new HIG colors
- blue selection color, success & destructive colors updates
- blueish tint for dark

Addresses issue #1443
2018-11-08 16:58:13 +01:00
Timm Bäder
45b909f2c5 testpopup: Fix GtkEventControllerMotion::motion callback signature 2018-11-08 05:48:14 +01:00
Timm Bäder
0b4ee06f8e eventcontrollerlegact: Fix ::event docs
As discussed in !388.
2018-11-08 05:48:14 +01:00
Timm Bäder
797739198f icontheme: Stop exporting gtk_icon_info_new_for_file 2018-11-08 05:48:14 +01:00
Timm Bäder
0c017ff109 icontheme: Stop exporting gtk_icon_theme_color_symbolic_pixbuf 2018-11-08 05:48:14 +01:00
Timm Bäder
aad3686726 icontheme: Drop remaining emblem code 2018-11-08 05:48:14 +01:00
Timm Bäder
fe7a2635d0 icontheme: Don't reference nonexistent parameter in docs 2018-11-08 05:48:14 +01:00
Timm Bäder
2834b38d2c icontheme: Use a bit field in AsyncSymbolicData
176 -> 144 bytes
2018-11-08 05:48:14 +01:00
Timm Bäder
29563a33ba icontheme: Stop strdup'ing css colors when loading
... symbolic icons.
2018-11-08 05:48:10 +01:00
Timm Bäder
5936d7f8f2 gl renderer: Properly retrieve matrix scale
So rotating offscreen nodes works.
2018-11-08 05:13:50 +01:00
Timm Bäder
481a78eee7 widget: Avoid some more ->priv accesses 2018-11-08 05:13:50 +01:00
Timm Bäder
ac4134c298 range: Remove multipress_gesture member
We don't need it in the instance struct since we only set it up and then
access it in its signal callbacks.
2018-11-08 05:13:50 +01:00
Timm Bäder
145659af93 widget: Some whitespace fixes 2018-11-08 05:13:50 +01:00
Daniel Boles
31b8e0f109 Popover: Minimally document the ::closed signal
This is better than nothing at all. The wording is taken from Carlos's
commit message when he added this shortly before 3.12 (but skip Since).
Skip the bit from his commit message explaining what this replaced; we
don't need to say all the less good things our convenience API replaces.
2018-11-07 20:33:15 +00:00
Daniel Boles
18199a3cef testtreelistmodel: Don't use non-standard function
as per efd3758f6a strcasecmp() is not a C
standard thing (not that we bothered including any header for it anyway)
and so this test failed to build on Windows with Microsoft Visual C.
2018-11-07 20:32:55 +00:00
Daniel Boles
3194c39471 TreeMenu: Don't manually reinvent g_list_index()
g_list_index() "Gets the position of the element containing the given
data (starting from 0)." That is exactly what we were manually doing.
2018-11-07 20:32:55 +00:00
Javier Jardón
9d51a8f53a gtk/gtktoolbutton.c: Document why we need to still use G_TYPE_INSTANCE_GET_PRIVATE
This is the excellent explanation from Emmanuele at
https://gitlab.gnome.org/GNOME/gtk/merge_requests/402#note_361210:
"
Every time you instantiate a type, the instance_init() function is called for each
parent type T_p of your type T; to preserve invariants, the class pointer inside
the instance data is set to the parent type before each invocation, until you hit
your type T. This means that calling GET_CLASS() inside an instance_init() function
will give you a pointer to the class vtable for the parent type T_p while you're
iterating over parent types. What if you want to access the actual class vtable of
the type T, though? Well, you can because the actual signature of instance_init() is:

  void (* GInstanceInitFunc) (GTypeInstance *instance, gpointer g_class);

i.e. all instance_init() functions get passed the instance they are initialising
and the class vtable of the real type you're instantiating.

This is how GtkToolButton works: it "peeks ahead" at instance initialisation time,
to use the button_type class field of the actual type you're instantiating,
and calls g_object_new() with it to store the resulting object in its own private
data structure.

This whole contrived mechanism is needed to allow out-of-tree tool buttons to just
set the button type on their class init, and have their parent class create the
button they want, instead of asking all tool buttons to do this themselves and have
a virtual function called get_button() for GtkToolButton to call whenever it needs
to operate on the button instance.

Now we're coming to a close: we cannot use the G_DEFINE_TYPE macro because the
instance_init() function it creates internally will not pass the class pointer
to your custom instance_init(). Since we cannot use G_DEFINE_TYPE, we also cannot use
G_ADD_PRIVATE either.

This is the reason why, when I ported GTK 3 to the new private instance data structure
macros, I left GtkToolButton alone. I should have left a comment there, because @matthiasc
tried doing that as well, and then had to revert it in commit 1c4a7bd5. So: my bad,
sorry about that.

If we want to drop the G_TYPE_INSTANCE_GET_PRIVATE and the g_type_class_add_private() calls,
we cannot use G_DEFINE_TYPE, but what we can do is unrolling what the macros do themselves:

- add a global GtkToolButton_private_offset variable
- add a static inline gtk_tool_button_get_instance_private() that does return
(G_STRUCT_MEMBER_P (self, GtkToolButton_private_offset));
- call g_type_add_instance_private (g_define_type_id, sizeof (GtkToolButtonPrivate)) inside
gtk_tool_button_get_type() and store the result in GtkToolButton_private_offset
- replace g_type_class_add_private() inside gtk_tool_button_class_init() with
g_type_class_adjust_private_offset (klass, &GtkToolButton_private_offset)
"
2018-11-07 17:50:04 +00:00
Javier Jardón
c37c86a9bf gtk/gtktextview.c: Remove unused GTK_TEXT_VIEW_GET_PRIVATE() macro 2018-11-06 13:45:58 +00:00