Commit Graph

32736 Commits

Author SHA1 Message Date
Benjamin Otte
d8d5cc9788 bindings: Hide structs 2019-06-18 15:54:07 -04:00
Benjamin Otte
2687a2eb8d bindings: Remove unused member variables 2019-06-18 15:53:48 -04:00
Matthias Clasen
7dbeee5d50 color chooser widget: Use the new action machinery
Port GtkColorChooserWidget to use widget class actions.

Note that this also changes the names of
the GtkColorChooserWidget actions away from a generic
"context" prefix.
2019-06-18 14:48:02 -04:00
Matthias Clasen
01e89f9142 link button: Use the new action machinery
Port GtkLinkButton to use widget class actions.

Note that this also changes the names of
the GtkLinkButton actions away from a generic
"context" prefix.
2019-06-18 14:47:33 -04:00
Matthias Clasen
dafb7054a1 window: Use the new action machinery
Change the default.activate action to use the
new action machinery.
2019-06-18 14:47:33 -04:00
Matthias Clasen
04bace1982 textview: Use the new action machinery
Port GtkTextView to use widget class actions.

Note that this also changes the names of
the GtkTextView actions away from a generic
"context" prefix.
2019-06-18 14:47:33 -04:00
Matthias Clasen
90701cb655 label: Use the new action machinery
Port GtkLabel to use widget class actions.

Note that this also changes the names of
the GtkLabel actions away from a generic
"context" prefix.
2019-06-18 14:47:33 -04:00
Matthias Clasen
ccccaa2681 password entry: Adapt to action name change
Also fix updating the icon when changing visibility
via the context menu.
2019-06-18 14:47:33 -04:00
Matthias Clasen
421e9c3502 text: Use the new action machinery
Port GtkText to use widget class actions.

Note that this also changes the names of
the GtkText actions away from a generic
"context" prefix.
2019-06-18 14:47:33 -04:00
Matthias Clasen
ef031e1a9d Allow registering actions per-class
Add a facility to register and install actions
at class init time. The intended use for these
actions is for

a) context and other model-based menus
b) key bindings

Most of these actions are going to be stateless,
so add separate apis for the simple and stateful
cases.

We avoid creating an action group for these by
teaching the action muxer about these actions.
The action muxer also maintains the enabled
state for these actions.
2019-06-18 14:47:33 -04:00
Matthias Clasen
9b62da10e6 Give the action muxer a widget
This will be used in the future to obtain
widget class actions.
2019-06-18 06:12:50 -04:00
Jakub Steiner
aa6f5dae5a Adwaita: tone down infobars
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1957
2019-06-18 10:25:54 +02:00
Matthias Clasen
a5c327bb02 popover: Drop unused api
The inspector is no longer using this
list model, so drop the api.
2019-06-16 23:03:34 -04:00
Matthias Clasen
bda5a8214b inspector: Don't duplicate popovers
Popovers are now regular children in the widget
tree, no need to duplicate them as toplevels
in the object tree.
2019-06-16 23:03:27 -04:00
Matthias Clasen
3ad8797068 inspector: Add a refresh button for actions
Action state updates may not always be precise.
2019-06-16 23:03:19 -04:00
Matthias Clasen
2457ed03c2 inspector: Fix centering of subtitles 2019-06-16 23:03:12 -04:00
Matthias Clasen
cc667926d6 Drop gtk_widget_get_action_group
Ths api exposes too much of the internal
action muxer setup; we want to add actions
to the muxer without an action group.
2019-06-15 21:41:11 -04:00
Matthias Clasen
bc56860fa1 places sidebar: Stop using gtk_widget_get_action_group
We create this action group ourselves,
we can keep track of it.
2019-06-15 21:41:03 -04:00
Matthias Clasen
820929958d file chooser: Stop using gtk_widget_get_action_group
We create this action group ourselves,
we can keep track of it.
2019-06-15 21:40:55 -04:00
Matthias Clasen
72d306c132 entry: Remove hacky code
We can leave it up to apps to not set less-than-useful
combinations, such as show-emoji-icon, but a no-emoji
input hint.
2019-06-15 21:40:50 -04:00
Matthias Clasen
9bb2d1eb5c widget: Remove gtk_widget_list_action_prefixes
This function was added just for the inspector,
and is not used there anymore. Drop it.
2019-06-15 21:40:38 -04:00
Matthias Clasen
d2e0d3222f widget: Cosmetics 2019-06-15 21:40:33 -04:00
Matthias Clasen
44970b5182 inspector: Fix actionable handling 2019-06-15 21:40:28 -04:00
Matthias Clasen
00c828e752 inspector: Redo the action page
Instead of iterating action groups manually,
just show what the action muxer provides. This
gives an accurate view of what actions are
available in a widgets context, and saves us
the trouble of juggling prefixes manually.
2019-06-15 21:40:22 -04:00
Matthias Clasen
3b565d7f6e action muxer: cosmetics 2019-06-15 21:40:17 -04:00
Matthias Clasen
db7f0189dd action muxer: Add some convenience api
Instead of duplicating this code in multiple places,
add an api to look up an action group for a prefixed
name, and return the unprefixed name at the same time.
2019-06-15 21:40:12 -04:00
Matthias Clasen
d2a794b411 menu tracker item: Improve logging
Pass the action name along, so we can put
it in log messages.
2019-06-15 21:40:06 -04:00
Guillaume Maudoux
76b2f97602 PrintUnixDialog: Slightly ease page range entry
Page ranges entry can now be focused directly, and will automatically
select the page ranges button when doing so.
This avoids the sometimes counter-intuitive previous behavior where the
entry was automatically focused when toggling the radio button, but the
user may still find themselves clicking uselessly in the text entry
because they scheduled it in their mental model.
2019-06-13 21:11:56 +00:00
Matthias Clasen
1d92fb1013 print operation: Reinstate the priv pointer
The attempt to drop it in 6a669265ac
was incomplete, and non-working.
2019-06-13 15:58:07 -04:00
Matthias Clasen
f1fe54f337 headerbar: Fix fallback appmenu
We were using menubuttons here in a way that
does not work anymore. Make it work again.
2019-06-13 19:39:45 +00:00
Matthias Clasen
1e3ec7c1f9 message dialog: Stop hardcoding title styles
Instead, use a new title style class to let
themes influence title formatting. Note that
the theme style will be overridden if the
application uses markup for presentation,
such as <b> or <i>.
2019-06-13 16:29:29 +00:00
Matthias Clasen
6f12c39a04 color chooser: Use a popover menu
Make the color chooser use a popover menu
and actions.
2019-06-13 11:59:51 +00:00
Matthias Clasen
6452aeef3c link button: Use new context menu api 2019-06-13 11:59:51 +00:00
Matthias Clasen
10ce2076f9 treeview: Stop disabling the context menu 2019-06-13 11:59:51 +00:00
Matthias Clasen
0509f8cff3 places sidebar: remove populate-popup 2019-06-13 11:59:51 +00:00
Matthias Clasen
3dd7b41077 cell renderer: remove populate-popup 2019-06-13 11:59:51 +00:00
Matthias Clasen
f12057b9dc textview: Support toggle actions
When creating a touch selection bubble, create toggle
buttons for toggle actions.
2019-06-13 11:59:50 +00:00
Matthias Clasen
037e205da0 textview: Redo context menus
Drop the ::populate-popup signal and implement
the new context menu api.
2019-06-13 11:59:50 +00:00
Matthias Clasen
964b2574cf label: Redo context menus
Drop the ::populate-popup signal and implement
the new context menu api. Things are a bit more
complicated here, since we have different menus
on links and selectable text.
2019-06-13 11:59:50 +00:00
Matthias Clasen
1b21d6ecba password entry: Adapt to new context menu api 2019-06-13 11:59:50 +00:00
Matthias Clasen
6030465cdf text: Add a context action for visibility
This will be used by GtkPasswordEntry for amending
the context menu.
2019-06-13 11:59:50 +00:00
Matthias Clasen
a28d5d1888 text, entry: Implement context menu api
Drop the ::populate-popup signal and implement
the new context menu api.
2019-06-13 11:59:50 +00:00
Matthias Clasen
cbc0a8447d popover menu: Unify hover and focus
Menus traditionally don't have separate
hover and focus locations. Make the same
change here that we already did for
popover menubars: Track the active item
and set its selected state. Both keynav
and mouse change the active item.
2019-06-12 21:50:46 -04:00
Matthias Clasen
a7e121384c popover menubar: Use a pseudo state
Use :selected instead of .active to
mark the active item.
2019-06-12 21:50:37 -04:00
Matthias Clasen
6c7cb8d862 popover: Improve the move-focus fix
Avoid breaking menubar keynav (we still
need the focus change to be propagated
down from the root).
2019-06-12 21:50:29 -04:00
Matthias Clasen
5b0002a9dc popover menu bar: Don't leave active item behind
When the mouse leaves the bar, turn the lights off.
2019-06-12 21:50:22 -04:00
Matthias Clasen
c16f10abea popover menu: Add our own activate key bindings
This solves issues with parent widgets, like combobox
or entry, installing their own bindings for these
keys, overriding the activation behavior that
is implemented in gtkwindow.
2019-06-12 21:50:08 -04:00
Matthias Clasen
d0a38c677c popover: Bring back the activate-default signal
As long as key bindings only work via action
signals, we need a signal here in order to
override the Enter/Space bindings for popover
menus.
2019-06-12 21:49:59 -04:00
Matthias Clasen
a56f99355a popover menu: Add our own focus key bindings
This solves issues with parent widgets, like textview
or scrolled window or combobox installing their own
bindings for these keys, overriding the focus behavior
that is implemented in gtkwindow.
2019-06-12 21:49:52 -04:00
Matthias Clasen
5df592d33e color editor: Don't leak adjustments 2019-06-12 21:38:39 -04:00
Matthias Clasen
aa69ca4ef4 color editor: Fix numerical oddities
This is probably ue to a pass through gtk-builder-tool.
2019-06-12 21:38:28 -04:00
Matthias Clasen
28c40a4c3d Merge branch 'wip/dboles/scrolledwindow-annotations' into 'master'
ScrolledWindow: Replace deprecated annotations; add (nullable) to set_[hvadjustment]()

See merge request GNOME/gtk!868
2019-06-12 16:18:36 +00:00
Emmanuele Bassi
0269d670b5 Merge branch 'layout-avoid-native' into 'master'
layout managers: Handle native children

See merge request GNOME/gtk!926
2019-06-12 11:18:05 +00:00
Jakub Steiner
af7b3df659 Adwaita: update treeview progressbars
- The style resembles Clearlooks and is way outdated.

https://gitlab.gnome.org/GNOME/gtk/issues/1938
2019-06-12 12:40:41 +02:00
Matthias Clasen
f5ce5a0abd Merge branch 'wip/chergert/profiler-gtk4-dbus-api' into 'master'
gtkapplication: track changes to profiler D-Bus API

See merge request GNOME/gtk!919
2019-06-12 01:04:53 +00:00
Matthias Clasen
21a5c7f0eb layout managers: Handle native children
Add a convenience api to skip children
that should not be included in the layout,
and call gtk_native_check_resize on all
native children outside of the vfunc.
2019-06-11 14:52:30 -04:00
Matthias Clasen
f03c7c379a text: Fix selection bubble handling
Same fix as the previous commit.
2019-06-11 17:46:01 +00:00
Matthias Clasen
67c82e8bd9 text view: Fix selection bubble handling
We can't call gtk_widget_destroy on something
that wasn't added as a child to a container -
it ends up calling gtk_container_remove, which
asserts if it doesn't find the child.
2019-06-11 17:45:55 +00:00
Matthias Clasen
37090a7ab4 popover menu: Set autohide
This is the expected behavior for menus.
2019-06-11 17:38:22 +00:00
Matthias Clasen
ddee5cfc43 widget: Improve focus handling
Make gtk_widget_real_focus do the right
thing for focusable widgets with children.

A case where this is (now) relevant is
an entry with a context popover.
2019-06-11 17:14:49 +00:00
Matthias Clasen
31066a697b window: Fix focus wraparound
If tab focus falls off the end, and we have an empty headerbar,
we end up with window->focus == NULL. Don't let that happen
2019-06-11 10:14:14 -04:00
Matthias Clasen
f1b9e7c23b Rename a bunch of private headers
We want to follow the convention that all
private headers have names ending in private.h
2019-06-10 03:10:13 +00:00
Matthias Clasen
9182f0fe9d Adwaita: Make selection in menus visible 2019-06-10 02:27:56 +00:00
Georges Basile Stavracas Neto
c82dcc8e3a
build: Install gtkpopovermenubar.h
It is not listed in 'gtk_public_headers', so it is not
installed, and breaks anyone including gtk.h
2019-06-09 15:40:55 -03:00
Matthias Clasen
3c1163e7f4 popovermenubar: Add docs 2019-06-09 17:42:11 +00:00
Matthias Clasen
8e5985d05e Typo fix 2019-06-09 17:42:10 +00:00
Matthias Clasen
17ec958f30 Rename GtkPopoverBar to GtkPopoverMenuBar
Clarity over beauty.
2019-06-09 17:42:07 +00:00
Matthias Clasen
65f71cdbae popover bar: Add setters
Add setters/getters for the menu-model property.
2019-06-09 17:40:51 +00:00
Matthias Clasen
d936967b7a Adwaita: Adapt to popover bar changes
Add some initial styling for popover bars
and popover menus. This needs revision.
2019-06-09 17:40:08 +00:00
Matthias Clasen
d78b6451b3 popoverbar: Use a box layout
Its the cool way to do layout these days.
2019-06-09 17:40:00 +00:00
Matthias Clasen
bc4f744562 main: Warn if GDK sends us bad focus events
The new rule for focus events from the windowing
system is: We only want them for toplevels. If you
put focus on popups, we don't want to know about
it, and you still need to deliver key events to
the toplevel.
2019-06-09 17:38:54 +00:00
Matthias Clasen
6342287288 popover menu: Disappear on focus out
We try to keep focus inside by wrapping arrow keynav.
But focus can still escape. If it does, we want to
disappear, like any good menu should.
2019-06-09 17:38:54 +00:00
Matthias Clasen
143ea34ca1 popover bar: Don't grab focus away from open menus
It makes them unhappy and disappear.
2019-06-09 17:38:54 +00:00
Matthias Clasen
abc9fef615 popover menu: Implement focus
We want to cycle around for up/down arrows.
2019-06-09 17:38:54 +00:00
Matthias Clasen
18fd512c80 popover bar: Implement focus
This is the proper way to do focus.
We want to cycle around for left/right arrows.
2019-06-09 17:38:54 +00:00
Matthias Clasen
f82898f393 model button: Make left/right switch submenus
This is expected menu keynav behavior: If the
focused item has a submenu, open it on right
arrow press. And if we are in a submenu title,
make left arrow press close it.
2019-06-09 17:38:54 +00:00
Matthias Clasen
ae8373f116 menu button: Use proper focus api
Widgets are supposed to call gtk_widget_child_focus.
Calling internal focus_move function directly makes
us skip the childs ::focus() implementation, which
is where the magic happens.
2019-06-09 17:38:54 +00:00
Matthias Clasen
f01e5d2267 popover bar: Add arrow keynav
Make left/right cycle the active item
among the bars children. Separate the styling
for the active item from :hover, since it is
a separate state, and only mixed up in menus
for historical reasons.
2019-06-09 17:38:54 +00:00
Matthias Clasen
0d800acd40 popover bar: Add a model property
This makes it less annoying to use in ui files.
2019-06-09 17:38:54 +00:00
Matthias Clasen
4ecaa754e2 popover bar: Break out items
These will grow enough functionality that its
worth having an object for it.
2019-06-09 17:38:54 +00:00
Matthias Clasen
6f689ec5b1 label: Fix mnemonic visibility handling
With non-widgets having children, we can no
longer assume that using gtk_container_forall
lets us walk the entire tree.
2019-06-09 17:38:54 +00:00
Matthias Clasen
583c6a9072 popover bar: towards menubar-like behavior
Make the open popover follow the pointer.
2019-06-09 17:38:54 +00:00
Matthias Clasen
c1791d030a widget: Ignore natives for picking
The natives transforms are not set up properly
to make this work, so ignore them here, for now.
This my need to be revisited later.
2019-06-09 17:38:54 +00:00
Matthias Clasen
d736778c2f popover: Respect alignment for positioning
We lost the code that takes the halign of
the popover into account when positioning it.
Bring it back, since we want to use it for
popover menus.
2019-06-09 17:38:54 +00:00
Matthias Clasen
f91cc6c473 Introduce a popover bar
This is meant to grow into a menubar replacement
with popovers. For now, it is just a box of menubuttons,
and not very much like a menubar at all.
2019-06-09 17:38:54 +00:00
Matthias Clasen
609f1659bd Rationalize popover menu apis
Make gtk_popover_new_from_model() return a GtkPopoverMenu,
rename it to gtk_popover_menu_new_from_model() and add
a relative_to argument to gtk_popover_menu_new().

Update all callers.
2019-06-09 17:38:54 +00:00
Matthias Clasen
724f315ae6 Stop exporting gtk_popover_bind_model
We can't improve popover menus as long as we
have to be able to work with any old popover
we're given. Remove this, so we can make
gtk_popover_new_from_model return a subclass.
2019-06-09 17:38:54 +00:00
Matthias Clasen
59ed4da717 box layout: Handle native children
These need to be skipped in measuring,
and we need to call gtk_native_check_resize
on them during allocation.

This was showing up as the new-style
context menu in widget-factory forcing
its relative-to box to grow when its
shown.
2019-06-09 17:38:53 +00:00
Matthias Clasen
640c7939ea modelbutton: Sizing fixes
We only want to reserve indicator size if
there are any checks or radios in the popover.
Unfortunately, GtkIcon has a hardcoded min-size
of 16, defeating this use. Work around by
wrapping each indicator in a box, and showing/
hiding the actual indicator.
2019-06-09 17:38:53 +00:00
Matthias Clasen
698e39bcac popover menu: Fix style classes
We want the same style classes that are produced
when creating a popover from a menu model.
2019-06-09 17:38:53 +00:00
Matthias Clasen
e080f35d25 menu section box: Add style classes for display hints
This makes it easier to realize some of the new
styles for popover menus.
2019-06-09 17:38:53 +00:00
Matthias Clasen
3313322864 menu section box: Introduce more section variants
Allow display-hint to be circular-buttons or
inline-buttons, to produce variations of horizontal
button layouts.
2019-06-09 17:38:53 +00:00
Matthias Clasen
dd572ed10a model button: Look up accels if needed
When we are not given an explicit accel (as is
the case when the popover is constructed from
a model), then look it up from the GtkApplication
at map time.
2019-06-09 17:38:53 +00:00
Matthias Clasen
fc3d3fb3af model button: Show shortcuts
Most of the machinery for this is already
in place. We just need to add an accel property
to GtkMenuButton and pass it through.
2019-06-09 17:38:53 +00:00
Matthias Clasen
eda31dff5d model button: Redo layout
Move checks to the left, and introduce a size group
to align things. The size group is provided by the
parent, using the new ::indicator-size-group property.
2019-06-09 17:38:53 +00:00
Matthias Clasen
30f6bea25f model button: Drop centered, inverted properties
These properties were only useful for titles,
and we have a role for that now.
2019-06-09 17:38:53 +00:00
Matthias Clasen
fc6010be37 model button: Add a role for titles
This gets us out of using direct presentational
markup like 'inverted' and 'centered' and will
make it easier to play with different layout.

Use the new role when creating popover
menus from models.
2019-06-09 17:38:53 +00:00
Matthias Clasen
0d59ece4a4 model button: Small fixes
Make iconic model buttons work better.
2019-06-09 17:38:53 +00:00
Christian Hergert
4a954a9a1c gtkapplication: track changes to profiler D-Bus API
Recently, to make things more forward-portable, Sysprof and Mutter altered
the API for org.gnome.Sysprof3.Profiler. This tracks those changes.
2019-06-06 17:24:33 -07:00
Christian Hergert
828c36636c va_marshaller: add various va_marshallers
We don't need to cover every case with a va_marshaller, but there are a
number of them that are useful because they will often only be connected
to by a single signal handler.

Generally speaking, if I opened into a file to add a va_marshaller, I just
set all of them.
2019-06-06 15:30:42 -07:00
Matthias Clasen
0aa9e16294 Bring brink skip_allocate
This was removed by accident in 580aa8204f,
together with some no longer needed popover
special-casing.
2019-06-05 00:31:53 +00:00
Benjamin Otte
bb5871fd81 docs: Remove mention of queue_draw_area()
and queue_draw_region(). They're gone since 73650c6da2.
2019-06-04 14:59:32 +00:00
Timm Bäder
ac333d712d snapshot: Make append_node_internal transfer-full
There is only one case where we do *not* directly unref the node again
after calling this.
2019-06-04 16:48:08 +02:00
Benjamin Otte
836635d1ae builder: Allow values of type GType
In particular this allows setting the item-type property of GListStore.
2019-06-04 06:11:44 +02:00
Benjamin Otte
6a0e0031b1 builder: Make GListStore buildable
Treats GListStore like any other object and allows <child> to add items
to it.
2019-06-04 06:11:44 +02:00
Timm Bäder
88344ccf4e widget: Unref priv->{allocated_,}transform 2019-06-03 17:03:02 +02:00
Matthias Clasen
c7ccaa5ef2 menu: Update scrollbar policy
We want to avoid sizing problems for small menus
due to the vertical scrollbar imposing a min-height on
its slider.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1930
2019-06-03 14:49:13 +00:00
Michael Natterer
caf50bcb93 gtk: fix weed_out_neg_zero() in spinbutton and scale
It was not copying the terminating \0 in the string, breaking output
in spinbutton (didn't try scale). Fixes #3452.


(cherry picked from commit ae2ef1472c)
2019-06-03 00:34:44 +00:00
Christian Hergert
41e373f10c gtk: fix all uses of g_cclosure_marshal_generic
This adds specific marshallers for all of the locations where a generic
marshaller is being used. It also provides va_marshallers to reduce the
chances that we get stack traces from perf going through ffi_call_unix64.

This is forward ported from gtk-3-24.

# Conflicts:
#	gtk/gtkeventcontrollerkey.c
#	gtk/gtkeventcontrollermotion.c
#	gtk/gtkgesture.c
#	gtk/gtkgesturemultipress.c
2019-06-02 14:24:51 -07:00
Matthias Clasen
aa267c1c84 Add gtkmenubarprivate.h
Move private api into a private header.
2019-06-01 21:56:49 +00:00
Matthias Clasen
3dea73bd4a Cosmetics
Remove comments that are old enough to still
talk about option menus and item factories.
2019-06-01 21:56:49 +00:00
Matthias Clasen
03964b5edb Remove an unused enum
No use of GtkArrowPlacement anywhere.
2019-06-01 04:11:22 +00:00
Matthias Clasen
0c7e567c32 Merge branch 'global-coords' into 'master'
Drop global coordinates

See merge request GNOME/gtk!899
2019-06-01 03:53:13 +00:00
Matthias Clasen
fcdea03796 Fix menu item accessible
The menu shell is not a direct parent anymore.
2019-06-01 03:39:12 +00:00
Matthias Clasen
feef0ef93a menu: Fix destruction
Now that menubar and menu are containers
with internal structure, we need to be
careful about doing the right thing in
forall and dispose.
2019-06-01 03:32:10 +00:00
Matthias Clasen
6c201e7927 menu: Fix keynav between submenus
Left/Right arrow now work again to enter
or leave a submenu.
2019-05-31 23:36:35 +00:00
Matthias Clasen
ace30d42ea menu: Bring back the scroll keybindings
Home, End, Page Up/Down, work again.
2019-05-31 23:36:35 +00:00
Matthias Clasen
e599336ad4 menu: Keep selected item in view
This gets us most of the way to working scrolling.
2019-05-31 23:36:35 +00:00
Matthias Clasen
8ba3c75682 More menu work 2019-05-31 23:36:35 +00:00
Matthias Clasen
3f6272f56e More menu restructuring
Make GtkMenuBar use a box as well,
and let GtkMenuShell get the items
from GtkMenuBar and GtkMenu via
a vfunc. Use that to fix the keynav
implementation in GtkMenuShell.
2019-05-31 23:36:35 +00:00
Matthias Clasen
13e010deb6 menu: Use a scrolled window
This brings back some support for scrolling.
We still need to reinstate some of the
scroll-to-selected and keynav functionality.
2019-05-31 23:36:35 +00:00
Matthias Clasen
ae1ba79f63 menu: Use a box
This makes some of the GtkMenuShell api
no longer work, since we don't let the
menu shell code maintain the list of
children anymore.
2019-05-31 23:36:35 +00:00
Matthias Clasen
17cd6d7f44 widget: Stop setting root coords in events
Nothing should use them anymore.
2019-05-31 23:36:35 +00:00
Matthias Clasen
f645c4e923 menu: Remove global coordinates
This commit removes support for scrolling and
for the keep-up triangle from GtkMenu, and gets
rid of all use of global coordinates.
2019-05-31 23:36:34 +00:00
Benjamin Otte
4e464b4960 menu: Only set position in one place 2019-05-31 23:36:34 +00:00
Benjamin Otte
d971c4e69d menu: Simplify function
No need to do complicated math when we can just look at the allocation.
2019-05-31 23:36:34 +00:00
Benjamin Otte
e702a33432 menuitem: Introduce gtk_menu_item_get_menu_shell()
Returns the parent menu shell or NULL.

Replace all calls to gtk_widget_get_parent() with this function.
2019-05-31 23:36:34 +00:00
Lubomir Rintel
8799e5798b builder-tool: Rewrite GtkDialog
Changes

  <object class="GtkDialog">
    <child internal-child="vbox">
      <...>
        <child internal-child="action_area">...</child>
        ...
      </...>
      <packing />
    </child>
  <object>

to

  <object class="GtkDialog">
    <child internal-child="content_area">
      <...>
        ...
      </...>
    </child>
    <child internal-child="action_area">...</child>
  <object>
2019-05-31 17:03:12 +00:00
Matthias Clasen
97e15b8718 scrolled window: respect overlay-scrolling setting
If the gtk-overlay-scrolling setting is FALSE,
don't use overlay scrollbars.
2019-05-31 15:04:23 +00:00
Matthias Clasen
2ae6f1a741 Add a gtk-overlay-scrolling setting
This is in preparation for letting user opt out of
overlay scrolling in the control-center.
2019-05-31 14:07:15 +00:00
Matthias Clasen
8145872e27 Merge branch 'wip/chergert/remove-cclosure' into 'master'
gtk: rely on default marshallers

See merge request GNOME/gtk!893
2019-05-31 10:57:27 +00:00
Benjamin Otte
4df049e81c Merge branch 'for-master' into 'master'
For master

See merge request GNOME/gtk!892
2019-05-31 04:07:11 +00:00
Christian Hergert
bd26cce812 gtk: rely on default marshallers
Similar to previous removals of g_cclosure_marshal_VOID__VOID we can remove
other marshallers for which are a simple G_TYPE_NONE with single parameter.
In those cases, GLib will setup both a c_marshaller and va_marshaller for
us. Before this commit, we would not get a va_marshaller because the
c_marshaller is set.

Related to GNOME/Initiatives#10
2019-05-30 20:56:50 -07:00
Benjamin Otte
6b2518a190 widget: fix CSS transforms with margins
The CSS transform should operate on the border-box, not the margin box.
So we need to shrink the bounds by the margin before we apply the CSS
transform.
2019-05-31 05:36:50 +02:00
Niels De Graef
df9aed6c61 Fix some GObject introspection annotations
Fixes several warnings by the GIR compiler.
2019-05-30 20:34:43 +02:00
Benjamin Otte
1e0c0c0ba7 rendernodeparser: Parse cairo script
Use cairo-script-interpreter to parse the scripts that generate cairo
nodes.

This requires libcairoscriptinterpreter.so to work properly, but if
it isn't found we disable this (unimportant for normal functioning)
code and just emits a parser warning.
The testsuite requires it however or it will fail.

A new test is included that tests all of this.
2019-05-30 15:32:36 +02:00
Matthias Clasen
2f37207487 Remove leftover debug spew 2019-05-30 08:19:08 -04:00
Matthias Clasen
d71bf4d35c Add gtknative.h to public headers 2019-05-30 08:18:29 -04:00
Matthias Clasen
93a34eb62d Merge branch 'lr/builder-tool-templates' into 'master'
builder-tool: Rewrite GtkBuilder templates too

See merge request GNOME/gtk!888
2019-05-30 11:56:05 +00:00
Lubomir Rintel
1e7225aa1c builder-tool: Set the parent of newly created GtkAssistantPage
...and its property. Otherwise simplify_element() blows up when looking
up the hierarchy to determine a property type.

  $ gtk4-builder-tool simplify --3to4 /dev/stdin <<EOF
  > <?xml version="1.0" encoding="UTF-8"?>
  > <!-- Generated with glade 3.20.2 -->
  > <interface domain="nm-applet">
  >   <object class="GtkAssistant">
  >     <child>
  >       <object class="GtkBox" id="confirm_page">
  >       </object>
  >       <packing>
  >         <property name="page_type">confirm</property>
  >         <property name="complete">True</property>
  >       </packing>
  >     </child>
  >   </object>
  > </interface>
  > EOF
  /dev/stdin: Packing property GtkAssistant::page_type not found
  /dev/stdin: Packing property GtkAssistant::complete not found
  Segmentation fault (core dumped)
2019-05-30 11:39:09 +02:00
Lubomir Rintel
2d55fce23d builder-tool: Rewrite GtkBuilder templates too 2019-05-30 10:34:24 +02:00
Matthias Clasen
e0cc72e94f Fix shortcuts window sizing
We were deferring the reflow until map, but this
leads to the section initially having an enormous
height and the window picks up that size before
we have a chance to reflow, This could be seen
in the "Builder" demo in gtk4-demo.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/11
2019-05-29 17:06:27 -04:00
Christian Hergert
82afe850e8 marshallers: add missing g_cclosure_marshal_VOID__VOID fixes 2019-05-29 13:48:33 -07:00
Christian Hergert
f507a79056 marshallers: ensure g_cclosure_marshal_VOID__VOIDv is used
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
2019-05-29 13:22:31 -07:00
Matthias Clasen
90f330e27a Merge branch 'gesture-click' into 'master'
Rename GtkGestureMultiPress to GtkGestureClick

See merge request GNOME/gtk!878
2019-05-29 18:39:09 +00:00
Matthias Clasen
2be733497b Merge branch 'global-coords' into 'master'
Drop global coordinates

See merge request GNOME/gtk!879
2019-05-29 18:29:57 +00:00
Matthias Clasen
b867cbe0d8 Cosmetics
Remove an unused variable.
2019-05-29 18:04:08 +00:00
Matthias Clasen
956e94a8d4 Remove a misleading comment
We don't have windowed widgets anymore, and
gdk_surface_move_resize is about to go away.
2019-05-29 18:04:08 +00:00
Matthias Clasen
2081bf346e window: Remove move unused fields
position_constraints_changed is never used.
2019-05-29 18:04:08 +00:00
Matthias Clasen
74db7cbe00 window: Never call gdk_surface_move
With gtk_window_set_position gone, we should never
come up with a new position to set in this code.

Leave a warning in place and remove the gdk_surface_move
calls.
2019-05-29 18:04:08 +00:00