Commit Graph

32779 Commits

Author SHA1 Message Date
Timm Bäder
a6a9853676 Adwaita: Fix popover style
We add the .background class to the popover node now.
2019-06-29 09:06:32 +02:00
Matthias Clasen
8fa7de5563 grid layout: Fix initial property values
Too bad that we don't cover layout children
in the default value test - it would have
caught this.
2019-06-28 12:42:06 +00:00
Jakub Steiner
9e6b4e82c9 Adwaita: allow flat list row buttons to be flat
- Be more specific about the list row image buttons

Addresses corner case of https://gitlab.gnome.org/GNOME/gtk/issues/1748
2019-06-27 12:15:51 +02:00
Jakub Steiner
4be2e804ae Adwaita: lighten dark switch sliders
- addresses legibility concerns

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1819
2019-06-27 10:58:18 +02:00
Alex Monday
1056e9976a Adwaita: Apply border-radius to .csd popovers
Fix popover_radius variable doesn't apply to .csd popover.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1984
2019-06-27 10:40:22 +02:00
Alex Monday
851bb61455 Adwaita: Fix padding/rounding on submenus
- Apply menubar submenu style for .csd submenus;
- Remove child subemenu style (looks like it is inherited
  from a parent).

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1976
2019-06-27 10:31:11 +02:00
Jakub Steiner
3aadc29af4 Adwaita: darken osd background for A:dark
- OSD background color was too close to $bg_color to make out outline

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1964
2019-06-27 10:30:01 +02:00
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