Hodong Kim
19b1fcfee3
Fix a typo
2019-06-24 18:42:40 +00:00
Daniel Boles
98cfbd3712
ShortcutsSection: Fix tiny grammar-o "in for"→"in"
2019-06-24 18:02:15 +01:00
Matthias Clasen
2405e2711e
Add a non-varargs variant of activate_action
...
I recently turned gtk_widget_activate_action()
into a varargs function. That is more convenient
from C, but we need a non-varargs variant for
bindings. So add the old API back, under the
name gtk_widget_activate_action_variant(),
with a rename-to annotation.
2019-06-24 15:51:39 +00:00
Matthias Clasen
3acc014499
Make gtk_widget_activate_action better
...
As a convenience API, this should be easy to use,
so don't expect callers to manually create a
variant, do it for them.
Update all callers.
2019-06-23 22:51:55 +00:00
Matthias Clasen
3ebe30bf32
widget: create parent muxers lazily
...
We need to create a muxer eagerly for every
widget that has class actions, since those
are otherwise missed in the action lookup
on the muxer side. But otherwise, there is
no reason to create parent muxers aggressively,
as long as we update the parent muxers on
root/unroot.
This reduces the number of muxers we create
in widget-factory from 210 to around 50.
2019-06-23 17:59:41 +00:00
Matthias Clasen
996f011ed8
window: Fix the default value of mnemonics-visible
...
They aren't visible, so why should the property
be TRUE?
2019-06-23 10:59:17 -04:00
Timm Bäder
0611370a5f
Merge branch '362-gtk-fileopen-dialog-need-filetype-mime-sort-option-2_GTK4' into 'master'
...
GtkFileChooser: add a sortable "Type" column
Closes #362
See merge request GNOME/gtk!874
2019-06-23 07:58:26 +00:00
Matthias Clasen
8fd968e5bf
action muxer: Don't activate disabled actions
...
We really shouldn't.
2019-06-23 01:39:26 +00:00
Matthias Clasen
203d612afd
widget: Clarify docs for action inheritance
...
Spell out how action inheritance works wrt to prefixes.
2019-06-22 19:17:30 -04:00
Matthias Clasen
ad4a81e9df
action muxer: Change inheritance
...
Previously, we would not look any further for
an action once we found a match for the prefix,
defining inheritance by groups. Change this to
inheritance for individual actions, since we
are moving towards individual actions as the
main ingredient in GTKs action support.
2019-06-22 22:51:23 +00:00
Matthias Clasen
95e5472ade
action muxer: Remove unused api
2019-06-22 22:38:14 +00:00
Matthias Clasen
06ff4a8b6f
textview: Stop using action muxer needlessly
...
This lets us drop some private api.
2019-06-22 22:34:26 +00:00
Matthias Clasen
1f0904d3df
widget: Teach query_action about property actions
...
This might be useful for documentation purposes.
2019-06-22 17:04:01 -04:00
Matthias Clasen
35a88c1440
widget: Rename a function
...
set_enabled is shorter and more to the point
than enabled_changed, now that we no longer have
a callback to query the state.
Adapt all callers.
2019-06-22 17:03:51 -04:00
Matthias Clasen
d1f4068b94
Replace stateful actions by property actions
...
The only cases of stateful actions we've seen
so far have been boolean properties, and we
don't really want to add much state handling
API, so lets just go with property actions
for now.
Adapt the only user in GtkText.
2019-06-22 17:03:38 -04:00
Matthias Clasen
7e73da5f73
widget: Add parameter type back to install_action
...
Adapt all callers.
2019-06-22 16:48:16 -04:00
Nelson Benítez León
c789a39660
GtkFileChooser: add a sortable "Type" column
...
along with a new 'type-format' setting that allows
to choose the output format for the "Type" column.
The options implemented for this setting are:
'mime' : Output from g_content_type_get_mime_type().
'description' : Output from g_content_type_get_description().
'category' : It uses the corresponding generic icon
of the mime type to group by categories (aka basic types).
This produces a more compact output than previous options,
and allows for type families to be grouped together, so eg.
after sorting by "Type" column, jpeg and png images will
be placed together, or the various types of archiver files
will also be grouped together.
This format was copied from and currently used by Nautilus
list view, so we also improve consistency with Nautilus.
Bugzilla entry for Nautilus implementation is:
https://bugzilla.gnome.org/show_bug.cgi?id=683722
The list of type families or categories can be checked on:
https://developer.gnome.org/icon-naming-spec/#mimetypes
This 'category' format is set as default.
Issue #362
2019-06-22 13:22:59 -04:00
Matthias Clasen
3c6045e300
css: Fix some doc typos
2019-06-22 09:49:50 -04:00
Matthias Clasen
9389768a17
Add GTK_CSS_PARSER_WARNING_UNIMPLEMENTED
...
gtk-doc was complaining about it missing,
and it is used in some ifdefed code.
2019-06-22 09:48:34 -04:00
Matthias Clasen
412006ad23
Add owner types for widget actions
...
This lets us filter out actions from parent classes
when introspecting.
2019-06-22 09:38:30 -04:00
Matthias Clasen
ea456b80da
Make actions minimally introspectable
...
This will let us autogenerate some docs for
actions, in the future.
2019-06-21 22:47:40 -04:00
Matthias Clasen
152eabbaba
widget actions: Add an explicit state type
...
Make the state type part of the API for installing
stateful widget actions. That lets us introspect it.
Update all callers.
2019-06-21 22:47:40 -04:00
Matthias Clasen
9be0b3d76f
application: Stop extracting accels from menus
...
This functionality has been superseded by
gtk_application_set_accels_for_action in GTK3,
and we don't want to carry it forward in GTK4.
2019-06-21 22:47:40 -04:00
Matthias Clasen
9b0d87c5a7
window: Cosmetics
2019-06-21 02:55:27 +00:00
Matthias Clasen
a515fca63f
inspector: Fix actions visibility
...
We need to always hide the page when setting
an object, otherwise the initial visibility
sticks.
2019-06-20 22:49:22 -04:00
Matthias Clasen
b6baa15e0a
inspector: Use event controller names
...
Use these in the same place we use widget names.
2019-06-20 22:48:42 -04:00
Matthias Clasen
955ae40cd6
event controller: Add a name property
...
This helps identifying controllers in the inspector.
2019-06-20 22:48:33 -04:00
Matthias Clasen
dee9e40ad3
Build fix
2019-06-20 22:47:35 -04:00
Matthias Clasen
a933a9bc79
Fix initial mnemonic visibility
...
We were showing mnemonics initially, which is not desired.
2019-06-21 02:38:05 +00:00
Matthias Clasen
6a4a082660
main: Move visible mnemonics handling
...
No need to special-case this anymore; we can use
a regular event controller in GtkWindow for this.
2019-06-21 02:37:51 +00:00
Matthias Clasen
a7cdcdf92c
main: Move visible focus handling
...
No need to special-case this anymore; we can use
a regular event controller in GtkWindow for this.
2019-06-21 02:37:12 +00:00
Daniel Boles
a7a0a34da1
Overlay: Document overlay children aren't measured
...
Some users expect that the Overlay will automatically request enough
size for its overlay children as well as its main child. It doesn't,
because it's just a GtkBin. Add a short paragraph pointing that out.
Close https://gitlab.gnome.org/GNOME/gtk/issues/1939
2019-06-20 21:41:59 +01:00
Daniel Boles
a03e531772
FileChooserButton: Document the CSS nodes & class
...
The only glancing mention of this we had was that GtkButton mentioned it
in passing when discussing how `button` could get contextual classes,
and even that's not relevant in master anymore... so drop it from there.
2019-06-20 20:51:37 +01:00
Daniel Boles
217f9ea3b8
ListBox: Document buildable child type placeholder
...
andyholmes on IRC asked about this and it wasn't documented, so fix that
2019-06-18 21:45:08 +01:00
Daniel Boles
ab7b9d882e
Window: Hyperlink to GtkBuildable from its section
2019-06-18 21:45:08 +01:00
Benjamin Otte
27d6276212
bindings: Make gtk_binding_entry_add_signall() private
...
This function needs a replacement and that will appear after
refactorings.
2019-06-18 15:54:27 -04:00
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
Matthias Clasen
d6d5d60703
Drop an empty function
...
gtk_window_constrain_position is not doing anything
anymore, so no need to call it.
2019-05-29 18:04:08 +00:00
Matthias Clasen
ece7fff339
window: Drop more unused fields
...
need_default_position is never used.
2019-05-29 18:04:08 +00:00
Matthias Clasen
147adc0bc5
window: Drop some unused fields
...
initial_x/y and initial_pos_set are never used.
2019-05-29 18:04:08 +00:00
Matthias Clasen
b636e32d85
widget: Stop using gdk_device_get_position
...
Root coordinates are going away. Stop
setting them in crossing events, so we
can drop this api.
2019-05-29 18:04:08 +00:00
Matthias Clasen
a8899cc6a3
window: Drop gtk_window_set_position
...
This is heavily using global coordinates, and
can't be guaranteed to work across wms / platforms.
2019-05-29 18:04:08 +00:00
Matthias Clasen
f0ef5332be
a11y: Stop using gdk_surface_get_frame_extnts
...
This api is going away.
2019-05-29 18:04:08 +00:00
Matthias Clasen
83827d3199
a11y: Stop using gdk_surface_get_origin
...
Global coordinates are going away.
Stop supporting ATK_XY_SCREEN.
2019-05-29 18:04:08 +00:00
Matthias Clasen
fcc8a365b9
main: Use gdk_surface_translate_coordinates
...
This gets rid of another use of global coordinates.
2019-05-29 18:04:08 +00:00
Matthias Clasen
7f65e5f96b
Rename GtkGestureMultiPress to GtkGestureClick
...
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Colomban Wendling
745a7cf29e
HighContrast: Improve contrast of notebook tabs
2019-05-29 17:46:41 +02:00
Benjamin Otte
56db17e5e8
Revert "window: Chain up in show/hide"
...
This reverts commit 863f4d13ff
.
2019-05-29 16:52:13 +02:00
Benjamin Otte
863f4d13ff
window: Chain up in show/hide
2019-05-29 16:34:56 +02:00
Benjamin Otte
cabe39862b
widget: Add marshallers to signals
...
Yay for better sysprof logs!
2019-05-29 16:34:56 +02:00
Benjamin Otte
2380f9673b
widget: Do proper clean up in real_hide()
...
Do the same things set_visible_flag() does.
2019-05-29 16:34:56 +02:00
Benjamin Otte
170c25a9d2
widget: Move functions around
...
Copy them further up so that we can use them there in the next commit.
2019-05-29 16:34:56 +02:00
Benjamin Otte
e85f1e176a
widget: Insist on proper vfunc calling
...
Insist that ->show() is only called for invisible and ->hide only for
visible widgets.
2019-05-29 16:34:56 +02:00
Benjamin Otte
a079fd2def
widget: Fix transform refcounting in allocate()
...
Make the transform (transfer full).
1. This makes sure we actually reference the transform. Previously we
did not.
2. Most callers create a new transform to pass to us. Now they don't
have to uref it anymore.
2019-05-29 16:34:56 +02:00
Benjamin Otte
89fb752a8f
css: Use %f, not %.17f
...
The testusite failures explain why:
We don't want to print "1.00000000000000000", but "1".
2019-05-29 14:30:13 +02:00
Benjamin Otte
d71c196c5c
css: Don't print numbers with exponent
...
CSS does not do exponents, so printing numbers close to 0 as 1.234e-15
does not work.
Also up the accuracy to 17 digits because that's what everyone else
uses.
2019-05-29 07:14:31 +02:00
Matthias Clasen
ead96b65fd
notebook: Drop position from ::create-window
...
Global coordinates are going away.
2019-05-28 23:23:06 -04:00
Matthias Clasen
0cc94ed72e
Some entry completion fixes
...
This gets popover-based entry completion closer
to working as expected. And it drops a use of
gdk_surface_get_origin.
2019-05-28 23:23:06 -04:00
Matthias Clasen
dd5839dfe8
tree models: Use standard padding
2019-05-28 23:23:06 -04:00
Matthias Clasen
9abc7262b0
treeview column: Make final
2019-05-28 23:22:57 -04:00
Matthias Clasen
79940b32b5
treeview: Make final
...
Make GtkTreeSelection final as well.
2019-05-28 21:42:38 -04:00
Matthias Clasen
aec5e3d71e
flow box: Make final
...
We keep GtkFlowBoxChild subclassable, though.
2019-05-28 20:01:43 -04:00
Matthias Clasen
217115d35f
listbox Make final
...
We keep GtkListBoxRow subclassable, though.
2019-05-28 20:01:43 -04:00
Matthias Clasen
ee29b9ba95
notebook: Make final
2019-05-28 20:01:43 -04:00
Matthias Clasen
c34abb6775
label: Make final
2019-05-28 19:45:45 -04:00
Matthias Clasen
b523f2b46a
menubar: Make final
2019-05-28 19:43:43 -04:00
Matthias Clasen
6836bfc208
toolbar: make final
2019-05-28 23:38:16 +00:00
Matthias Clasen
8695e8c1b8
menu: Make final
2019-05-28 23:38:16 +00:00
Matthias Clasen
6ffc9f9e6e
Forgotten file
2019-05-28 23:30:02 +00:00
Matthias Clasen
0a6813d0aa
menu tool button: Make final
2019-05-28 18:58:58 -04:00
Matthias Clasen
ef3e20cffe
radio tool button: Make final
2019-05-28 18:58:46 -04:00
Matthias Clasen
5db4530a22
toggle tool button: Use standard padding
2019-05-28 18:58:31 -04:00
Matthias Clasen
4b5fee943e
tool button: Use standard padding
2019-05-28 18:58:05 -04:00
Matthias Clasen
f0fd4843d5
iconview: Make final
2019-05-28 22:50:08 +00:00
Matthias Clasen
700e9e03c5
stack: Make final
2019-05-28 22:35:36 +00:00
Matthias Clasen
055a991e08
file chooser error stack: Don't derive from stack
...
We can just have a GtkStack, instead.
2019-05-28 22:35:36 +00:00
Matthias Clasen
bc739e607b
scrolled window: Make final
2019-05-28 22:35:36 +00:00
Matthias Clasen
211128fb7c
inspector: Stop deriving from scrolled window
2019-05-28 22:35:36 +00:00
Matthias Clasen
461e8e0218
places sidebar: Don't derive from scrolled window
...
We can just have a scrolled window, instead.
2019-05-28 22:35:36 +00:00
Matthias Clasen
a4b1ff7736
Forgotten file
2019-05-28 22:35:36 +00:00
Matthias Clasen
908632138c
inspector: Show surface and renderer
2019-05-28 20:25:17 +00:00
Руслан Ижбулатов
90058ed951
Don't assume that gdk_surface[_move]_resize() is asynchronous
...
On Windows that call resizes the native window immediately,
and the corresponding GDK event is emitted and processed
before the control is returned to gtk_window_move_resize().
Therefore, update freeze and configure_request_count increment
must happen before the call, not after it.
2019-05-28 20:25:17 +00:00
Руслан Ижбулатов
82c80c06e8
Add missing include
2019-05-28 20:25:17 +00:00
Matthias Clasen
5ccb081fdb
Avoid compiler warnings
...
Avoid priv being flagged as unused on win32.
2019-05-28 20:25:17 +00:00
Matthias Clasen
d08805d7f0
popover: Don't constantly redraw the beak
...
We don't want to constantly draw the arrow
if we don't have to. Save the render node
to achieve this.
2019-05-28 20:25:17 +00:00
Matthias Clasen
f154fd4c09
popover: Stop needles allocations
...
We were queuing an allocation whenever
the popover is flipped over, unnecessarily,
since we don't change the size of the surface.
This was showing up as popovers being invisible
when flipped over, under X.
2019-05-28 20:25:17 +00:00
Matthias Clasen
c638a0aa59
Adwaita: Remove Emoji completion special case
...
We can use GtkPopover::has-arrow now.
2019-05-28 20:25:16 +00:00
Matthias Clasen
db21cbdfb3
inspector: Avoid a critical warning
2019-05-28 20:25:16 +00:00
Matthias Clasen
ec413357c6
popover: Make it possible to not have an arrow
...
This will make popovers move flexible for other
uses, such as the Emoji completion popup.
2019-05-28 20:25:16 +00:00
Matthias Clasen
a841ff0316
popover: Set input shapes on wayland too
...
No reason not to do it. Wayland has input shapes.
2019-05-28 20:25:16 +00:00
Руслан Ижбулатов
83f952d771
IME IM: Be able to handle NULL widget correctly
2019-05-28 20:25:16 +00:00
Matthias Clasen
8f291be8c6
tooltip: fix critical warnings
...
We might trigger a requery while unrooted.
Deal with it.
2019-05-28 20:25:16 +00:00
Matthias Clasen
693b2aa4d1
Drop gtk_widget_get_toplevel
...
Not used anymore.
2019-05-28 20:25:16 +00:00
Matthias Clasen
7447abb52b
Stop using gtk_widget_get_toplevel
...
All uses of it can be replaced by gtk_widget_get_root.
2019-05-28 20:25:16 +00:00
Matthias Clasen
6674f2764e
Drop gtk_widget_is_toplevel
...
No longer used.
2019-05-28 20:25:16 +00:00
Matthias Clasen
948347afa9
Stop using gtk_widget_is_toplevel
2019-05-28 20:25:16 +00:00
Matthias Clasen
8fc6f07327
Drop gtk_widget_get_surface
...
It is no longer used.
2019-05-28 20:25:16 +00:00
Matthias Clasen
302d2a04ae
Stop using gtk_widget_get_surface
...
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
a65696fc9f
builder tool: Handle modal->autohide rename
...
Add a facility for renamed properties,
and use it for GtkPopover::modal.
2019-05-28 20:25:15 +00:00
Matthias Clasen
25aef96d5d
popover: Rename modal to autohide
...
This is the term we use for the surface,
and it matches the behavior a bit better
than modal.
Update all callers.
2019-05-28 20:25:15 +00:00
Matthias Clasen
09ec88d0ce
win32: Build fixes
2019-05-28 20:25:15 +00:00
Matthias Clasen
0b3a971056
window: Make unrealize work again
...
GtkWidgets unrealize accesses the frame clock
of the surface, so we need to keep the surface
in place until after we've chained up.
2019-05-28 20:25:15 +00:00
Matthias Clasen
b99962e7a2
Drop gtk_widget_set_surface
...
Not used anymore. Only GtkNative's have surfaces.
2019-05-28 20:25:15 +00:00
Matthias Clasen
43bed7986a
Drop GtkWidget::surface
...
Unneeded.
2019-05-28 20:25:15 +00:00
Matthias Clasen
0047492bf9
Work toward dropping widget->surface
...
Drop special-casing of GtkNative in
most widget vfuncs. GtkNative implementations
need to override these anyway.
2019-05-28 20:25:15 +00:00
Matthias Clasen
18788c2a86
Remove gtk_widget_get/set_has_surface
...
These serve no purpose anymore - widgets don't
have surfaces, unless they're a GtkNative.
2019-05-28 20:25:15 +00:00
Matthias Clasen
fd0a290d77
popover: Bring back the beak
...
Bring back the code that draws an arrow.
2019-05-28 20:25:15 +00:00
Matthias Clasen
61247a8921
widget: Remove a popover special case
...
We never run this since GtkPopover has its
own size_allocate, anyway.
2019-05-28 20:25:15 +00:00
Matthias Clasen
a33d4f0f49
text view: Allocate popovers
2019-05-28 20:25:15 +00:00
Matthias Clasen
6c3ffa1380
places sidebar: Allocate popovers
2019-05-28 20:25:15 +00:00
Matthias Clasen
07426da074
color swatch: Allocate popovers
2019-05-28 20:25:15 +00:00
Matthias Clasen
4cab6ae61a
entry: Allocate popovers
2019-05-28 20:25:15 +00:00
Matthias Clasen
507b2d332e
scale button: Allocate popovers
...
Call gtk_native_check_resize() from size_allocate,
as is required now. This gets volume buttons closer
to working again (dragging the slider still doesn't
work).
2019-05-28 20:25:15 +00:00
Matthias Clasen
e6f71d841e
text: Allocate popovers
...
We need to do the same thing the menu button
does, and call gtk_native_check_resize for
all our popovers
2019-05-28 20:25:15 +00:00
Matthias Clasen
1f2d3c0900
window: Don't inherit cursors across surfaces
...
I can't think of a case where this is the desired
behavior. So, instead of setting an explicit cursor
on all popups, just stop walking the parents at
surface boundaries.
2019-05-28 20:25:15 +00:00
Matthias Clasen
f3559fe0f0
widget: Optimize resize propagation
...
When a GtkNative widget is marked as resize_needed,
we need a current position for its parent and we need
the parent to be allocated (so we can position our
surface), but we don't need the parent to be marked
as resize_needed, since the parent size is entirely
independent of the popup size.
2019-05-28 20:25:15 +00:00
Matthias Clasen
27596c328a
widget: Improve warning messages
...
When we print warnings about a widget, using
gtk_widget_get_name() is slightly better than
G_OBJECT_TYPE_NAME(), since it will give us
the widgets unique name when available.
2019-05-28 20:25:15 +00:00
Matthias Clasen
49268c23fd
popover: Use GdkSurface::autohide
...
The new api is made for this case.
2019-05-28 20:25:14 +00:00
Matthias Clasen
d2951d3aac
Rename surface constructors
...
We want to use a gdk_surface_new_popup for popups,
and align the constructor names with the surface
types, so rename
gdk_surface_new_popup -> gdk_surface_new_temp
gdk_surface_new_popup_full -> gdk_surface_new_popup
The temp surface type will disappear eventually.
2019-05-28 20:25:14 +00:00
Matthias Clasen
346bd3f6b5
menu: Stop using gdk_surface_new_temp
...
We can just as well use gdk_surface_new_popup.
2019-05-28 20:25:14 +00:00
Matthias Clasen
bab5836e89
Drop gtk_widget_register_surface
...
This is no longer used.
2019-05-28 20:25:14 +00:00
Matthias Clasen
fa25b06a28
popover: Stop using gtk_widget_register_surface
...
The GtkRoot implementations are expected to handle
the necessary surface setup themselves, going forward.
2019-05-28 20:25:14 +00:00
Matthias Clasen
81a673c908
window: Stop using gtk_widget_register_surface
...
The GtkRoot implementations are expected to handle
the necessary surface setup themselves, going forward.
2019-05-28 20:25:14 +00:00
Matthias Clasen
55c286661b
menu: Stop using gtk_widget_register_surface
...
It does not seem to be necessary at all.
2019-05-28 20:25:14 +00:00
Matthias Clasen
989792cbc0
Drop child surfaces
...
Drop gdk_surface_child_new and the child surface type,
since we no longer use them. Deprecate surface apis
that only make sense with child surfaces.
2019-05-28 20:25:13 +00:00
Matthias Clasen
52c3507ae1
widget: Stop using child surface apis
...
All our surfaces are toplevels now, and thus all native.
2019-05-28 20:25:13 +00:00
Matthias Clasen
43d4c908c9
a11y: Stop supporting ATK_XY_SCREEN
...
We were already not supporting ATK_XY_PARENT, and we can't
support global positions, so just always do ATK_XY_WINDOW.
2019-05-28 20:25:13 +00:00
Matthias Clasen
d6a85188b6
xim: Stop using child surface apis
...
We no longer have child surfaces.
Drop code that only makes sense in
their presence.
2019-05-28 20:25:13 +00:00
Matthias Clasen
c3c33ac168
entry completion: Use a popover
...
This lets us remove a use of GTK_WINDOW_POPUP,
which should eventually be going away.
We need to disable treeview search, since it
creates a toplevel that will disrupt our grabbing
popup, causing it to be dismissed.
We don't need to grab ourselves, since the popover
code does it for us. We don't need to reposition our
window, since the popover takes care of that too.
2019-05-28 20:25:13 +00:00
Matthias Clasen
0d25233e39
main: Use gtk_widget_get_native
2019-05-28 20:25:13 +00:00
Matthias Clasen
66ccc825de
main: Remove special-case hiding popopvers
...
This is now happening in GDK, so we don't have
to do this here anymore.
2019-05-28 20:25:13 +00:00
Matthias Clasen
580aa8204f
widget: Remove some unneeded popover special-casing
2019-05-28 20:25:13 +00:00
Matthias Clasen
82d506acd8
Adwaita: Give popover menus a background
...
This makes the hover highlight on menu items visible.
2019-05-28 20:25:13 +00:00
Matthias Clasen
1cbc26d9ee
menubutton: Allocate the popover
...
This is temporary, until we've figured out
the proper way of hooking this up
2019-05-28 20:25:13 +00:00
Matthias Clasen
4bf4f04d1f
Adapt to new popover lifecycle
...
We need to unparent popovers in dispose.
2019-05-28 20:25:13 +00:00
Matthias Clasen
6ab8ab87c8
Reimplement GtkPopover
2019-05-28 20:25:13 +00:00
Matthias Clasen
2764652b3c
menushell: Keep outside clicks working
...
We need to unset event propagation limits here
to keep receiving outside clicks that cause us
to close the menu.
2019-05-28 20:25:13 +00:00
Matthias Clasen
2606ca0bd1
Introduce event controller propagation limits
...
Limit event handlers by default to only handle
events targeting the same surface as their widget.
2019-05-28 20:25:13 +00:00
Matthias Clasen
54662f4ca0
widget: Don't snapshot foreign children
...
When snapshotting, we walk down the widget tree.
We need to skip children that have a different
surface, since those will do their own snapshot.
2019-05-28 20:25:13 +00:00
Matthias Clasen
8713397948
root: Make gtk_root_get_display public
...
This is following the precedent of making
GtkNative getters public.
2019-05-28 20:25:02 +00:00
Matthias Clasen
f2447e06af
GtkRoot: Drop overlap with GtkNative
...
Drop the parts from the GtkRoot interface
that have been taken over by GtkNative.
2019-05-28 20:24:39 +00:00
Matthias Clasen
5de06f47cf
widget: Use GtkNative
2019-05-28 20:24:39 +00:00
Matthias Clasen
9059eee2f0
Review and replace uses of get_toplevel
...
Now that roots can have parent widgets, we need to
carefully examine all calls of gtk_widget_get_toplevel,
and replace them with gtk_widget_get_root if we want
the nearest root, and not the ultimate end of the parent
chain.
2019-05-28 20:24:39 +00:00
Matthias Clasen
c1d5e82d95
Use GtkNative APIs instead of GtkRoot
2019-05-28 20:24:39 +00:00
Matthias Clasen
7dcb163ee6
Add gtk_widget_get_native
...
This is a common enough operation to deserve api.
2019-05-28 20:24:39 +00:00
Matthias Clasen
d4257d20f8
root: Require GtkNative
2019-05-28 20:24:39 +00:00
Matthias Clasen
5bf2b633bb
window: Implement GtkNative
...
Adapt GtkWindow to implement both GtkRoot and GtkNative.
2019-05-28 20:24:39 +00:00
Matthias Clasen
d51c85cf4e
native: Add to docs
2019-05-28 20:24:37 +00:00
Matthias Clasen
12a16a298b
Introduce GtkNative
...
Split off the parts of GtkRoot that are specific
to widgets having a surface into the GtkNative
interface.
2019-05-28 19:54:32 +00:00
Matthias Clasen
618f1f08ec
main: guard window-specific code paths
...
This was overlooked when I first tried to
make things for GtkRoot.
2019-05-28 19:54:32 +00:00
Matthias Clasen
afcf3e66f6
widget: guard popover-specific code paths
...
This is essentially a special case just for GtkPopover,
which is the last widget with a child surface.
2019-05-28 19:54:32 +00:00
Matthias Clasen
ff1150d87c
Export gtk_widget_render privately
...
We need it in gtkwindow.c and gtkpopover.c.
2019-05-28 19:54:32 +00:00
Matthias Clasen
81548911de
file chooser widget: Drop the priv pointer
2019-05-28 03:02:33 +00:00
Matthias Clasen
236983d2aa
file chooser dialog: Drop the priv pointer
2019-05-28 02:48:26 +00:00
Matthias Clasen
2ae531ee9f
file chooser dialog: Make final
2019-05-28 02:42:14 +00:00
Matthias Clasen
e795c0c67e
file chooser widget: Make final
2019-05-28 02:41:15 +00:00
Matthias Clasen
6a7bf78b15
file chooser button: Make final
2019-05-28 02:40:08 +00:00
Matthias Clasen
933a9fba70
font chooser dialog: Drop the priv pointer
2019-05-27 22:37:41 -04:00
Matthias Clasen
27f854042d
font chooser widget: Drop the priv pointer
2019-05-27 22:27:47 -04:00
Matthias Clasen
19de2ce937
font chooser dialog: Make final
2019-05-28 00:57:47 +00:00
Matthias Clasen
1b34e15893
font chooser widget: Make final
2019-05-28 00:56:41 +00:00
Matthias Clasen
e11c1fcb91
font button: Make final
2019-05-28 00:55:28 +00:00
Matthias Clasen
dbdb137428
app chooser dialog: Drop the priv pointer
2019-05-27 20:51:46 -04:00
Matthias Clasen
e0a9952a56
app chooser widget: Drop the priv pointer
2019-05-27 20:44:01 -04:00
Matthias Clasen
b080a980d9
app chooser dialog: Make final
2019-05-27 20:30:59 -04:00
Matthias Clasen
5c16de71f5
app chooser widget: Make final
2019-05-27 20:30:48 -04:00
Matthias Clasen
5b4dfb3079
app chooser button: Make final
2019-05-27 20:30:35 -04:00
Matthias Clasen
4b4e370c9d
color chooser dialog: Drop the priv pointer
2019-05-27 20:23:50 -04:00
Matthias Clasen
d5fe6fa517
color chooser widget: Drop the priv pointer
2019-05-27 20:23:50 -04:00
Matthias Clasen
fe2865259f
color chooser dialog: Make final
2019-05-27 20:23:50 -04:00
Matthias Clasen
44640aeeea
color chooser widget: Make final
2019-05-27 20:23:50 -04:00
Matthias Clasen
36e76db0d0
color button: Make final
2019-05-27 20:23:50 -04:00
Matthias Clasen
2ef8bd0b95
entry completion: Make final
2019-05-27 20:23:50 -04:00
Matthias Clasen
90aebd4f84
text tag table: Make final
...
And also move private function to a private header.
2019-05-27 20:23:50 -04:00
Matthias Clasen
f111e3f467
text mark: Use standard padding
2019-05-27 20:23:50 -04:00
Matthias Clasen
1e2874fc59
text tag: Use standard padding
2019-05-27 20:23:50 -04:00
Matthias Clasen
b49d1e8c6b
overlay: Make final
2019-05-27 20:23:50 -04:00
Timm Bäder
e22073dc97
sizerequest: Fix request mode for layout managers
...
We can't just call GtkWidgetClass::get_request_mode() anymore. If the
widget has a layout manager, we need to ask that one.
2019-05-27 18:12:26 +02:00
Timm Bäder
4134b67827
layoutmanager: Never pass NULL pointers to ->measure
...
We don't do that in GtkWidgetClass::measure() implementations either, so
make the semantics match.
2019-05-27 18:12:26 +02:00
Timm Bäder
23ddac2e72
filechooserentry: Correctly annotate a return value as (nullable)
2019-05-27 18:12:26 +02:00
Timm Bäder
3a26efb5ca
filechooserentry: Rename function to make sense
...
This is GtkFileChooserEntry API, not GtkFileChooser API.
2019-05-27 18:12:25 +02:00
Matthias Clasen
cfe648eb11
Don't load print backends more than once
...
The modules don't depend on the default display
at all, and loading them more than once makes
the displayclose test fail here, locally.
2019-05-27 12:59:36 +00:00
Matthias Clasen
be305d6dab
check menu item: Drop the priv pointer
2019-05-27 00:41:58 -04:00
Matthias Clasen
5e4512d4c7
check menu item: Use standard padding
2019-05-27 04:33:30 +00:00
Matthias Clasen
273fa042a8
radio menu item: Drop the priv pointer
2019-05-27 00:32:39 -04:00
Matthias Clasen
d26eb4fce7
radio menu item: Make final
2019-05-27 04:26:34 +00:00
Matthias Clasen
5d3c85c7e9
radio button: Make final
2019-05-27 00:10:48 -04:00
Matthias Clasen
a29fe385df
check button: Use standard padding
2019-05-27 04:09:41 +00:00
Matthias Clasen
6d9bac47b3
toggle button: Use standard padding
2019-05-27 04:08:07 +00:00
Matthias Clasen
bf2ff5f582
grid: Use standard padding
2019-05-26 23:30:21 -04:00
Matthias Clasen
4e7f251b18
search bar: Make final
2019-05-26 23:27:15 -04:00
Matthias Clasen
749c9720ce
paned: Make final
2019-05-27 03:25:34 +00:00
Matthias Clasen
b68554b14a
spin button: Make final
2019-05-26 23:22:47 -04:00
Matthias Clasen
bba97eae36
search entry: Make final
2019-05-26 23:21:07 -04:00
Matthias Clasen
a2d2c8afc4
range: Use standard padding
2019-05-26 23:18:38 -04:00
Matthias Clasen
546cbd55eb
scale: Use standard padding
2019-05-26 23:17:28 -04:00
Matthias Clasen
4730b5c281
menu item: Use standard padding
2019-05-26 23:14:36 -04:00
Matthias Clasen
e57da00824
menu shell: Use standard padding
2019-05-26 23:13:55 -04:00
Matthias Clasen
a62a7ab282
menu button: Make final
2019-05-26 23:10:57 -04:00
Matthias Clasen
54f469bba4
revealer: Make final
2019-05-27 03:08:37 +00:00
Matthias Clasen
ff115472e3
entry: Use standard padding
2019-05-27 03:03:47 +00:00