Commit Graph

32288 Commits

Author SHA1 Message Date
Timm Bäder
ddd044f283 entry: Remove some unused constants 2019-04-13 06:18:43 +02:00
Benjamin Otte
9e8e3eb0ca Merge branch 'listbox-separators' into 'master'
Listbox separators

See merge request GNOME/gtk!747
2019-04-13 00:38:14 +00:00
Matthias Clasen
87121998a2 Merge branch 'test-locale-change' into 'master'
testutils: Run in UTF8 locale

See merge request GNOME/gtk!734
2019-04-13 00:28:08 +00:00
Matthias Clasen
68d6c51dbc inspector: Use the new show-separators property
Add separators to the list boxes on the Settings page.
2019-04-12 20:25:54 -04:00
Matthias Clasen
4551aef081 Adwaita: Implement list separators
Just put a top border on every row.
2019-04-12 20:25:16 -04:00
Matthias Clasen
0249bd4f8a listbox: Add a ::show-separators property
This is getting translated into a .separators style
class on the list box css node.
2019-04-12 20:24:40 -04:00
Matthias Clasen
9a1da43890 inspector: Fix editing in the property list
The type-to-search was interfering with using
entries in the list. Avoid that by watching
where the focus is.
2019-04-12 19:48:23 -04:00
Benjamin Otte
c78ba42051 testutils: Run in UTF8 locale
before, code was using the "C" locale, but that one uses ASCII. Instead,
run in the "C.utf8" locale.

Nobody expects code to not support UTF8 and no end user runs their
machine in an ASCII setup, so it makes no sense to default to that.
2019-04-13 01:40:10 +02:00
Christoph Reiter
b66e4cd64c gtkcomposetable: use g_size_checked_mul() for overflow checking
The check was added in !741, this replaces it with g_size_checked_mul()
2019-04-12 22:41:58 +02:00
Matthias Clasen
e81f033ece Merge branch 'validate-alloc-size' into 'master'
Check the size of the g_new arguments

See merge request GNOME/gtk!741
2019-04-12 19:11:30 +00:00
Matthias Clasen
a2db956492 inspector: Show readonly property values 2019-04-12 15:08:01 -04:00
Matthias Clasen
8d51038cb1 inspector: Cosmetics 2019-04-12 15:08:01 -04:00
Matthias Clasen
86c86e0860 inspector: Revamp attribute and action info
This also needs to be turned into single-line data.
2019-04-12 15:08:01 -04:00
Matthias Clasen
324f5472a2 Fix a crash
We had a signal handler with a wrong signature, causing
a crash when looking  at the GtkSettings properties in
the inspector.
2019-04-12 15:08:01 -04:00
Emmanuele Bassi
1b6252ebf0 Merge branch 'default-request-mode' into 'master'
Add default GtkLayoutManagerClass.get_request_mode()

See merge request GNOME/gtk!738
2019-04-12 17:59:04 +00:00
Emmanuele Bassi
b4c8ba4de7 Check the size of the g_new arguments
We're passing integers without validating their size, and newer GCC are
very cross about it, with warnings like:

    warning: argument 1 range [18446744071562067968, 18446744073709551615]
    exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]

We should check we're not overflowing the allocation size, by limiting
the range of values we can use.

First of all, we need to use `gsize` instead of a random `int`, since we're
allocating data.

Additionally, we need to check that the multiplication that computes the
size of the allocation doesn't overflow the maximum value of a `gsize`.
2019-04-12 18:58:34 +01:00
Benjamin Otte
f310609a66 builder: Parse GskTransform properties
In particular, this allows parsing the GtkFixed position properties.
2019-04-12 19:34:29 +02:00
Benjamin Otte
e1cd996617 selector: Inlcude : sign when reporting errors 2019-04-12 19:34:28 +02:00
Benjamin Otte
24cc721bc6 cssprovider: Mark whole @import statement on import error 2019-04-12 19:34:28 +02:00
Benjamin Otte
d41580adfc calc: Have better error location range 2019-04-12 19:34:28 +02:00
Benjamin Otte
3ab65b7da2 csspositionvalue: Redo the parser
The old one incorrectly rejected "center left" and "center right".
2019-04-12 19:34:28 +02:00
Benjamin Otte
79238b0d8f cssparser: Add error functions that take locations
... and use them to report better error locations for the warning when
blocks aren't terminated properly.
2019-04-12 19:34:28 +02:00
Benjamin Otte
2e0a56665a css: Move gtkcsssection.[ch] into gtk/css 2019-04-12 19:34:28 +02:00
Benjamin Otte
76826cfa2f cssparser: Pass in error locations explicitly
And for the quick function, use the start/end location of the current
token.
2019-04-12 19:34:28 +02:00
Benjamin Otte
37671d2bd0 cssprovider: Redo error emission
Emit all errors via the parser, don't try to have a custom error
handling machinery.

The only exception is the initial file load error - we need to do that
one directly, because there is no parser.
2019-04-12 19:34:28 +02:00
Benjamin Otte
04d24b7cd2 csssection: Make printing functions public 2019-04-12 19:34:28 +02:00
Benjamin Otte
085d34cbb0 cssprovider: Advance parser to start of declaration
This way, the block will reference the right location.
2019-04-12 19:34:28 +02:00
Benjamin Otte
46143492a2 cssprovider: Change section handling
Instead of building a full tree of sections that then nobody cares
about, just create sections as necessary for when we use it in the
inspector.
2019-04-12 19:34:28 +02:00
Benjamin Otte
a475d72d47 cssparser: Improve location APIs
1. Export multiple locations
2. Return the location instead of passing one in
2019-04-12 19:34:28 +02:00
Benjamin Otte
a8f712b09a cssection: Return locations, not numbers
Now that we have GtkCssLocation, actually use it.
2019-04-12 19:34:28 +02:00
Benjamin Otte
2fb202187c css: Remove GtkCssSectionType
It's unused.
2019-04-12 19:34:28 +02:00
Benjamin Otte
207c0b32b4 csssection: Redo constructors
Remove the unused one and rename the old one to new_from_parser().
2019-04-12 19:34:28 +02:00
Benjamin Otte
35f60dc918 csssection: Store a GtkCssLocation 2019-04-12 19:34:28 +02:00
Benjamin Otte
1cd9396154 css: Review error messages
... and move them from _gtk_css_parser_error() to the proper new error
message.
2019-04-12 19:34:28 +02:00
Benjamin Otte
de73ac980f css: Use gtk_css_parser_consume_any() for transition shorthand 2019-04-12 19:34:28 +02:00
Benjamin Otte
a31e5f7a8c cssshadow: Use gtk_css_parser_consume_any()
This way, the arguments can now really be speicified in any order.

A new testcase testing all the ordering possibilities has been added.
2019-04-12 19:34:28 +02:00
Benjamin Otte
e0a01ba174 css: Redo for new parser
This commit is still way too big, but I couldn't make it smaller.

It transitions the old CSS parser to the new parser. CSS parsing is now
tokenized, everything else is probably still buggy.
2019-04-12 19:34:28 +02:00
Benjamin Otte
f3db19d694 Resurrect the CSS parser from the tokenizer branch
So far that parser is unused.
2019-04-12 19:34:28 +02:00
Benjamin Otte
607502ef43 cssparser: Add gtk_css_parser_consume_url()
Another slight renaming and semantics change.
2019-04-12 19:34:28 +02:00
Benjamin Otte
acddc317da cssparser: Add gtk_css_parser_resolve_url()
Another slight change of semantics and naming for the new parser.
2019-04-12 19:34:28 +02:00
Benjamin Otte
7f99c1e588 cssparser: Split integer gettig into has/consume functions
We can't try to get an integer because ultimately integer getters
support the same shenanigans that numbers and percentages do with calc()
and whatnot.
2019-04-12 19:34:28 +02:00
Benjamin Otte
5f3e5a0406 cssparser: Add gtk_css_parser_try_delim()
For parsing single code point delimiters. Also port calc() to use this.
2019-04-12 19:34:28 +02:00
Benjamin Otte
23080d47b5 cssparser: Get rid of _gtk_css_parser_try_double()
Use gtk_css_parser_consume_number() everywhere instead.
2019-04-12 19:34:28 +02:00
Benjamin Otte
f0d2f99239 cssparser: Add gtk_css_parser_consume_string()
Well, just rename _gtk_css_parser_read_string() for the new semantics,
but this sounds cooler.
2019-04-12 19:34:28 +02:00
Benjamin Otte
e7b9ecc99a cssparser: Add gtk_css_parser_try_at_keyword() 2019-04-12 19:34:28 +02:00
Benjamin Otte
dce8c11b07 cssparser: Drop _gtk_css_parser_has_prefix()
Replace it with has_ident/has_function. The old function is a typical
string matching API, not a tokenizing one.
2019-04-12 19:34:28 +02:00
Benjamin Otte
7ccec19501 parser: Get rid of _gtk_css_parser_is_eof()
Use gtk_css_parser_has_token() instead.
2019-04-12 19:34:28 +02:00
Benjamin Otte
93b643c44d css: Make font-weight an integer
This conforms to what Pango does and to the CSS4 spec. And it makes the
parsing code easier. So let's go for it.
2019-04-12 19:34:28 +02:00
Benjamin Otte
21616f6e2e cssimagescaled: Use gtk_css_parser_consume_function()
As part of that, adapt the syntax from
  -gtk-scaled( [<image>, <int>?]# )
to
  -gtk-scaled( [<image> <int>?]# )

because the commas should be used to separate distinct elements.

Note that almost nobody specifies the scale anyway.
2019-04-12 19:34:28 +02:00
Benjamin Otte
8157004068 easevalue: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
8d69bda27a cssimagelinear: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
dbdb81f411 cssparser: Add gtk_css_parser_consume_ident()
And use it to fix the palette parser.
2019-04-12 19:34:28 +02:00
Benjamin Otte
28fbcf6abe shorthand: Use gtk_css_parser_try_ident() 2019-04-12 19:34:28 +02:00
Benjamin Otte
1fd339c46f cssimageradial: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
b830bdca37 cssimagefallback: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
45bc4ed321 cssimagerecolor: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
9c862d7736 cross-fade: Make progress optional
Now we accept progress being unset and then dynamically compute it
on-demand.
2019-04-12 19:34:28 +02:00
Benjamin Otte
d99ae4b6c2 cross-fade: Use gtk_css_parser_consume_any()
.. and gtk_css_parser_consume_function().

gtk_css_parser_consume_any() is a new function that implements the CSS
spec's any combinator ||.
2019-04-12 19:34:28 +02:00
Benjamin Otte
96f9cbcabf cssimage: Make cross-fade() an array
The new spec at https://drafts.csswg.org/css-images-4/#cross-fade-function
allows infinite images to cross-fade and we want to, too.
2019-04-12 19:34:28 +02:00
Benjamin Otte
3597f7e8b1 cssimageicontheme: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
38227dc972 cssfiltervalue: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
aa50e92c65 csstransformvalue: Use gtk_css_parser_consume_function() 2019-04-12 19:34:28 +02:00
Benjamin Otte
753ad64cbc cssparser: Introduce gtk_css_parser_consume_function()
This is a vfunc-based function parser.
2019-04-12 19:34:28 +02:00
Benjamin Otte
3fb44ae651 cssparser: Add gtk_css_parser_try_token() 2019-04-12 19:34:28 +02:00
Benjamin Otte
76fb80f46c cssparser: Introduce gtk_css_parser_try_ident()
... and gtk_css_parser_has_function().
2019-04-12 19:34:28 +02:00
Benjamin Otte
684b6459f1 cssparser: Get rid of _gtk_css_parser_begins_with()
Replace it with calls to gtk_css_parser_has_token().
2019-04-12 19:34:28 +02:00
Benjamin Otte
904a9d0c98 parser: Add gtk_css_parser_has_token()
This is ithe first step towards converting the parsing code to use
tokens. For now, the topken type is just a magic enum value that only
works as-needed.
2019-04-12 19:34:28 +02:00
Benjamin Otte
32e256e5ab css: Split GtkCssLocation into its own file
And make the struct public, so we can use it in signal handlers.
2019-04-12 19:34:28 +02:00
Benjamin Otte
d4d46e8125 csstokenizer: Add gtk_css_token_is_preserved() 2019-04-12 19:34:28 +02:00
Benjamin Otte
661720ef8b tokenizer: Pass error arg to read_token()
Instead of an error vfunc, have the tokenizer vfunc take a GError
argument. Note that even when an error is returned, there is still a
token to be read.
2019-04-12 19:34:28 +02:00
Benjamin Otte
013591d68d css: Add GtkCssTokenizer
This is copied from an old branch of mine.
2019-04-12 19:34:28 +02:00
Benjamin Otte
a938c14d11 build: Add gtk-css static library
This library is meant to be the new CSS library that gets used from GDK,
GSK and GTK for string printing and parsing.

As a first step, move GtkCssProviderError into it.

While doing so, split it into GtkCssParserError (for critical problems)
and GtkCssParserWarning (for non-critical problems).
2019-04-12 19:34:28 +02:00
Matthias Clasen
42ea95c54e inspector: Modernize action references
Now that we do inline editing, we need to
show this in a single line.
2019-04-12 13:01:19 -04:00
Matthias Clasen
46e7b44ffa inspector: Drop binding info
Thia was relying on non-public implementation details
and was broken since 2015.
2019-04-12 12:35:06 -04:00
Emmanuele Bassi
a27737b04e Add default GtkLayoutManagerClass.get_request_mode()
Just like GtkContainer provides a default implementation of
GtkWidgetClass.get_request_mode(), we can do the same inside
GtkLayoutManager.

A default implementation preserves the behavior of existing widgets that
moved, or will move, to a GtkLayoutManager.
2019-04-12 17:10:30 +01:00
Matthias Clasen
bd2d07e671 Merge branch 'inspector-props' into 'master'
inspector: Improve property list editing

See merge request GNOME/gtk!736
2019-04-12 15:20:26 +00:00
Matthias Clasen
fde21b57cd inspector: Improve property list editing
Replace the treeview with popups on the property
page with a listbox with inline editing.
2019-04-12 11:12:55 -04:00
Benjamin Otte
637bd13f3f boxlayout: Remove unused variable 2019-04-12 16:32:00 +02:00
Emmanuele Bassi
b91fbfd5a0 Fix get_request_mode for GtkBoxLayout
The default GtkWidgetClass.get_request_mode() is implemented by
GtkContainer; now that GtkBox uses a GtkBoxLayout, we need to implement
it inside the layout manager to preserve the same behavior as the old
GtkBox.

Fixes #1821
2019-04-12 13:14:44 +01:00
Matthias Clasen
0842d084dd inspector: Cometic fixes for controllers
Add a frame, and make the rows not activatable.
2019-04-11 22:28:15 -04:00
Matthias Clasen
838b25177f inspector: Make rows activatable
Rows containing just a switch should be activatable,
and toggle the switch.
2019-04-11 22:06:16 -04:00
Matthias Clasen
b39d0cec3c inspector: Fix css autosave
We were creating the directory with improper permissions.
2019-04-11 19:39:44 -04:00
Matthias Clasen
f0c72bdc3b Adwaita: Add spacing to message dialogs
The text was running into the action area.
2019-04-11 19:39:44 -04:00
Benjamin Otte
427d216081 inspector: Enable by default
We don't want to stop people from being able to debug GTK applications
by default.

The keybinding also runs last in event delivery, so it doesn't override
existing keybindings anywhere and is therefor safe to enable.

The setting of course should remain, so people who want to lock down
installations, like for kiosks, can turn this off.
2019-04-12 00:39:24 +02:00
Jakub Steiner
6eed78e3de Adwaita: OSD set semi-opaque again
- forgot the bling bling
2019-04-11 15:35:24 +02:00
Jakub Steiner
c4aa060118 Adwaita: less purple OSD style
- one of the bits that escaped the purple cast is the osd background color
2019-04-11 15:26:55 +02:00
nana-4
ca233ad9ae themes: Fix and improve linked button style
Instead of re-styling the border and radius of the linked buttons
depending on the position (middle, first, last, or only child), just
remove the border and radius in a specific direction when the button is
`:not(:first-child)` and/or `:not(:last-child)`.

This properly handles the style of linked buttons in all positions
-- middle, first, last, and only child.

Fixes #1294
2019-04-09 02:27:41 +09:00
Iain Lane
fbe0e32813
cellrendererpixbuf: Use fallback icons with icon-name
This gives us a better chance of finding an icon to show.

Closes: #1809
2019-04-08 15:05:51 +01:00
Matthias Clasen
2594593de2 Merge branch 'pick-insensitive2' into 'master'
Make picking insensitive widgets work again

Closes #1816 and #51

See merge request GNOME/gtk!727
2019-04-08 12:59:06 +00:00
Matthias Clasen
ef982b7d46 Rename things
Rename the can-pick property to can-target,
and redo the pick flags with more descriptive names.
2019-04-08 08:42:25 -04:00
Matthias Clasen
1b362d1f01 Keep a drawable check in gtk_widget_contains
If the widget is not drawable, it probably doesn't have
an allocation, so asking the question does not make much
sense.
2019-04-07 20:34:12 +00:00
Matthias Clasen
7ce968f297 Document GtkPickFlags 2019-04-07 17:27:58 +00:00
Matthias Clasen
0e15b4a367 inspector: Allow picking insensitive widgets again
Use the new argument to gtk_widget_pick to allow picking
insensitive widgets.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/51
2019-04-07 17:23:17 +00:00
Matthias Clasen
de0942b0b8 tooltip: Allow tooltips on insensitive widgets again
Use the new argument to gtk_widget_pick to allow picking
insensitive widgets.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1816
2019-04-07 17:23:06 +00:00
Matthias Clasen
b804235aea Add a flags argument to gtk_widget_pick
This will be used to let the inspector and other users
pick insensitive widgets again. For now, update all
callers to pass no flags, preserving the current
behavior.
2019-04-07 17:19:09 +00:00
Matthias Clasen
6bc32a3d5d widget: Drop the pick vfunc
The way to influence picking is to implement contains,
we no longer use the pick vfunc.
2019-04-07 17:00:51 +00:00
Matthias Clasen
5e24454764 window: Stop implementing pick
Treat popovers as a special-case for now.
2019-04-07 16:11:20 +00:00
Matthias Clasen
d9cf0ff684 paned: Drop the pick vfunc
Implement contains on the handle, instead of pick on the paned.
2019-04-07 16:03:27 +00:00
Matthias Clasen
5b78a3048f gizmo: Add a contains_func
Let GtkGizmo override the contains() implementation.
Update all callers to pass NULL for the contains_func.
2019-04-07 15:47:24 +00:00
Matthias Clasen
676ac380cd widget: Make contains just be about position
Leave out reactiveness considerations here,
pick will handle those.
2019-04-07 15:18:37 +00:00
Matthias Clasen
dce2c58799 widget: Make contains respect rounded borders
We have the api for this now.
2019-04-07 15:18:37 +00:00
Matthias Clasen
8af0782261 treeview: Make expanders work again
These were broken by the crossing event unification.
We are now generating some more crossing events, and
the treeview was not looking closely enough at the
ones it gets.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1814
2019-04-07 12:16:20 +00:00
Matthias Clasen
a0e6353667 inspector: Disable autoloaded custom css initially
This is a safeguard against possible crashing css
being autoloaded.
2019-04-06 23:08:10 +00:00
Matthias Clasen
bea7ccb41f widget: Propagate display changes to the style context
When a root is set on a widget, the style context may
already exist. We need to make sure that the style context
has the right display set.

This was showing up as "css spillover" in the inspector.

Closes: #https://gitlab.gnome.org/GNOME/gtk/issues/1817
2019-04-06 23:03:25 +00:00
Matthias Clasen
721a12826d inspector: Warn if using the default display 2019-04-06 18:19:40 +00:00
Matthias Clasen
4b40cc27a9 inspector: Autosave css
Save and restore the contents of the css editor in a file.
2019-04-06 18:00:09 +00:00
Matthias Clasen
c92e53622f inspector: Rearrange settings a bit
Keep only the software gl setting for GL, and put it together
with the simulate touchscreen setting in a 'misc' box. This
keeps all the 'show' options nicely grouped.
2019-04-06 17:39:00 +00:00
Matthias Clasen
c31185b419 inspector: Clean up on finalize
Just a matter of cleanliness.
2019-04-06 16:53:35 +00:00
Matthias Clasen
5ff59c12b0 inspector: Fix a copy-paste error
We were stuffing the layout overlay into the updates_overlay
field, leaving the layout_overlay field unused.
2019-04-06 16:53:35 +00:00
Matthias Clasen
ea527812a0 HighContrast: fix focus
We don't want to render focus rectangles on everything. With
the way focus is propagated nowadays, the theme has to selectively
render focus on certain widgets.

At the same time, we always want to render focus for this
theme, so use the focus pseudoclass, not focus(visible).

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1815
2019-04-06 13:19:29 +00:00
Matthias Clasen
01851e04fc combo box: Remove leftovers in the header
These functions no longer exist and should not be in
the headers anymore.
2019-04-06 12:09:37 +00:00
Matthias Clasen
bfb5e6e72f widget: Remove some leftover child-property code 2019-04-05 20:52:29 -04:00
Matthias Clasen
1fab3d9e20 builder-tool: Handle layout properties gracefully
If there are already layout properties in the ui
file, we shouldn't crash, even if --3to4 is given.
2019-04-05 20:52:29 -04:00
Matthias Clasen
9c9b4e6832 Merge branch 'menushell-bandaid' into 'master'
Make menu activation work again

Closes #1796

See merge request GNOME/gtk!721
2019-04-06 00:40:54 +00:00
Matthias Clasen
2deb0e7e1d Make menu activation work again
After we stopped untranslatable delivering events, menus stopped
working 'the second time'. After some painful debugging, it appears
that this is caused by the menushell code deliberately grabbing
on the menubar *after* grabbing on the menu, causing events to
be deleivered to the wrong toplevel. This did not use to matter,
but now we drop these events.

Absent a more thorough rewrite of menus, just don't grab on
the menubar. This makes menu activation work again and does not
appear to have ill effects, on either Wayland or X.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1796
2019-04-06 00:20:21 +00:00
segfault3
d465523f65 gtkplacessidebar: Add loop devices 2019-04-05 19:58:56 +00:00
Matthias Clasen
cb3d61bb0e inspector: Avoid a critical
If a layout manager does not have layout children,
quietly hide the layout page.
2019-04-05 19:44:16 +00:00
Matthias Clasen
ef9dc43474 Show layout children in the inspector 2019-04-05 19:15:55 +00:00
Matthias Clasen
74352e0bee buildable: Remove a mention of <packing>
This is no longer a supported element in ui files.
2019-04-05 14:41:46 -04:00
Matthias Clasen
5c8a870510 print dialog: Rewrite example
The ui file example was still using GTK3 syntax
for GtkNotebooks.
2019-04-05 14:41:46 -04:00
Matthias Clasen
7a29462ca6 Fix the inspector
One of the inspector ui files was still using
child properties.
2019-04-05 14:41:46 -04:00
Matthias Clasen
ea7a43beb4 container: Reduce boilerplate
We no longer need to hand-roll the type registration,
since we no longer install our own param spec pool.
2019-04-05 12:01:43 +00:00
Matthias Clasen
70bf6d4b97 Drop child property related apis
We no longer have any child properties in
our containers, so drop the infrastructure for it.
2019-04-05 12:01:43 +00:00
Matthias Clasen
7cd9ea497b builder-tool: Stop using child properties 2019-04-05 12:01:43 +00:00
Matthias Clasen
a26f400576 paned: Stop using child properties 2019-04-05 12:01:43 +00:00
Matthias Clasen
a97845c380 notebook: Stop using child properties 2019-04-05 12:01:43 +00:00
Matthias Clasen
08d8f2bb80 print dialog: Stop using gtk_container_child_get
The grid does not have child properties anymore.
2019-04-05 12:01:43 +00:00
Matthias Clasen
b14f0b8987 grid: Annotate out args as optional
They are optional, so annotate them as such.
2019-04-05 12:01:43 +00:00
Matthias Clasen
edbc99104f searchbar: Fix a compiler warning 2019-04-05 05:10:33 +00:00
Matthias Clasen
285293ac17 file chooser: Fix some compiler warnings 2019-04-05 05:10:26 +00:00
Matthias Clasen
6f7d9f9613 A round of + removal
change GTK+ to GTK throughout gtkmain.c.
2019-04-05 05:07:32 +00:00
Matthias Clasen
fe822a0a24 builder-tool: Don't empty out <mark> elements
We were inadvertedly losing the content of <mark>
elements. Fix this, by marking (!) them as pcdata
elements.
2019-04-05 03:05:08 +00:00
Matthias Clasen
69d4081ff8 Merge branch 'wip/ebassi/grid-layout' into 'master'
Implement GtkGridLayout

See merge request GNOME/gtk!714
2019-04-05 02:42:55 +00:00
Emmanuele Bassi
cfcca335b1 Update GtkGrid definitions in GtkBuilder files
Convert packing properties to layout ones.
2019-04-05 00:08:18 +01:00
Emmanuele Bassi
3ea39210cd builder-tool: Convert GtkGrid child properties 2019-04-05 00:04:14 +01:00
Emmanuele Bassi
faafd23225 Add convenience function for querying a child of GtkGrid
Getting the layout manager instance out of GtkGrid, and then querying
all layout properties can be tedious, especially for code that was
usually calling gtk_container_child_get().

To replace that, we can add a simple query function that returns the two
attach points and the spans.
2019-04-04 22:41:19 +01:00
Emmanuele Bassi
62acb80671 Port GtkGrid to use GtkGridLayout 2019-04-04 22:41:03 +01:00
Emmanuele Bassi
c4c897f921 Document GtkGridLayout
Add missing stanzas for properties and accessor functions.
2019-04-04 16:31:56 +01:00
Zander Brown
e493b9b702
inspector: Type info for misc pane
Replaces the class hierarchy page with a button/popover on the misc page
2019-04-03 23:50:24 +01:00
Emmanuele Bassi
6e0f1800c8 Add GtkGridLayout
Layout manager for grid-like widgets.
2019-04-03 19:03:58 +01:00
Matthias Clasen
2cc30f75a0 Merge branch 'wip/carlosg/drop-search-handle-event' into 'master'
Search improvements

See merge request GNOME/gtk!710
2019-04-03 13:28:58 +00:00
Carlos Garnacho
c9839b2069 paned: Set cursor on gizmo widget
We may avoid setting it on the paned widget depending on the pointer
position altogether, since the handle is now a widget. Also is more
likely to be correct as the implicitly grabbed widget will probably
be that one.

Fixes the paned losing the resize cursor after button press.
2019-04-03 13:26:40 +02:00
Carlos Garnacho
b842bf7bf5 gtk: Drop gtk_search_[entry|bar]_handle_event()
This is now unused, and unrecommended.
2019-04-03 13:23:34 +02:00
Carlos Garnacho
1825aa377b shortcutswindow: Drop usage of gtk_search_bar_handle_event()
Make it capture key events from the toplevel.
2019-04-03 13:23:34 +02:00
Carlos Garnacho
e59c6abd91 filechooserwidget: Drop usage of gtk_search_entry_handle_event()
Just use gtk_event_controller_key_forward() to let know the search
entry of the Esc key being pressed.
2019-04-03 13:23:34 +02:00
Carlos Garnacho
dc88a1ebc4 inspector: Fix prop-list search
Instead of handle_event(), use set_key_capture_widget().

Also, use the fact that we now propagate key events throughout the
stage, and connect to the GtkInspectorPropList instead of the toplevel.
We only want the search bar to be active while that widget is mapped
and able to receive events.

And also, handle the "search bar" visibility on ::search-started.
2019-04-03 13:23:34 +02:00
Carlos Garnacho
9cb9843367 searchentry: Add ::search-started signal
Users of search entries usually handled visibility (when initially hidden)
by checking the return value of gtk_search_entry_handle_event(). This does
not pan out with gtk_search_entry_set_key_capture_widget() since the return
value is not directly seen by the caller.

Add a ::search-started signal to cater for it, which gets emitted when the
search entry went from empty to non-empty.
2019-04-03 13:08:53 +02:00
Carlos Garnacho
95754aa71f treeview: Fix variable typo
We actually want search_entry there, not search_window which is the
O-R window in the non-custom case.
2019-04-03 13:07:06 +02:00
Matthias Clasen
cf3aa570c2 inspector: Rename a few pages
"Global" and "Visual" are not very good names for
the content of these pages. Rename them to
"Information and "Settings".
2019-04-02 23:36:45 +00:00
Matthias Clasen
7c2ce72b5f inspector: Manage visibility of stack pages
The hand-rolled stack combo we were using before
was looking at the visibility of the page itself
to show or hide items. Other stack switchers
expect us to use the GtkStackPage::visible
property for this.
2019-04-02 23:36:45 +00:00
Matthias Clasen
5371055495 inspector: Redo the object page switcher
The combobox for page switching was not very good.
Instead, do a sidebar that can be hidden.
2019-04-02 23:29:22 +00:00
Matthias Clasen
4d6acd5d76 inspector: Drop the child property page
Child properties are on the way out.
2019-04-02 23:08:17 +00:00
Matthias Clasen
285e67c044 inspector: Drop the class hierarchy page
This was just  not useful enough to keep around.
2019-04-02 21:50:09 +00:00
Matthias Clasen
d7987e73c9 inspector: Drop the css selector page
This was just not useful enough to keep around.
2019-04-02 21:47:02 +00:00
Matthias Clasen
e13a8102b4 inspector: Drop the signals page
This was just not useful enough to keep around.
2019-04-02 21:39:47 +00:00
Matthias Clasen
12c4766dd0 inspector: Properly clean up
I got a crash in inspector code when I hit
cancel in the confirmation dialog for it.
2019-04-02 21:21:46 +00:00
Matthias Clasen
5c31c721af Rename all settings schemas to avoid conflict
Rename all our settings schemas to the org.gtk.gtk4
prefix to avoid conflicting with the gtk3 schemas.
2019-04-02 19:27:34 +00:00
Matthias Clasen
7a08177a3d Merge branch 'async-api' into 'master'
Small async api fixes

See merge request GNOME/gtk!701
2019-04-02 15:45:30 +00:00
Matthias Clasen
ad4142df19 Merge branch 'adwaita-selected-row-switch-fix-master' into 'master'
Adwaita: Fix switch slider border on selected row

Closes #1802

See merge request GNOME/gtk!704
2019-04-02 15:33:24 +00:00
Alex Monday
fabef39f7f Adwaita: Fix switch slider border on selected row
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1802
2019-04-02 20:18:26 +05:00
Matthias Clasen
64fd5158bf gdk: Change some async dnd api
The pattern we generally follow is to put the
async result right after the source object, in
finish functions. Do this for gdk_drop_read_finish.
2019-04-02 15:11:06 +00:00
Emmanuele Bassi
6e7748b266 Add API to access child transformations to GtkFixed
This is mostly convenience API around GtkFixedLayoutChild, but it should
push people towards using transformations with GtkFixed instead of just
using fixed positioning.
2019-04-02 15:48:46 +01:00
Emmanuele Bassi
447dfc029f Remove GtkLayout
The need of a specialised fixed layout container that can be placed into
a GtkScrolledWindow ceased to exist once GtkScrolledWindow gained the
ability to automatically interpose a GtkViewport when adding a child
that does not implement GtkScrollable.

All the other justifications that led to the existence of GtkLayout as a
separate widget from GtkFixed have been largely made irrelevant in the
20 years since its inception.
2019-04-02 15:29:20 +01:00
Emmanuele Bassi
aed70a82c7 Add overflow:hidden to GtkFixed
This allows GtkFixed to clip children that are outside its allocation.
2019-04-02 15:14:53 +01:00
Matthias Clasen
e2fcca4e60 Rename debug settings to org.gtk.Settings.Debug4
This gives us the freedom to make changes without
interfering with GTK3.
2019-04-02 00:27:32 +00:00
Emmanuele Bassi
aacab81a3e Fix location on renamed files
Commit 4152e14e32 renamed a bunch of
files, but did not fix the meson.build file that referenced them.
2019-04-01 13:52:27 +01:00
Matthias Clasen
4152e14e32 Namespace some auxiliary files
We install a few helper files for the ui file
format. Namespace these, to avoid conflict with
the same files in GTK3.
2019-04-01 08:30:39 -04:00
Matthias Clasen
57b3cd56d7 Drop gtkbuilder.rnc
This is just a leftover file in git.
2019-04-01 08:29:24 -04:00
Matthias Clasen
5b5a68c5db Fix filechooser search
This makes the search entry show up again
when I type. There is still some misbehavior
where the entry loses focus again, and Escape
does not work to exit search.
2019-03-31 23:06:42 -04:00
Matthias Clasen
d2e0553384 Fix menuitem hover
We need to pay attention to details
of enter and leave events.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1795
2019-03-31 21:53:55 -04:00
Matthias Clasen
c2c4133eb0 Fix up the border/background-color removal
I overlooked one level of indirection here. Oops.
2019-03-31 20:43:19 -04:00
Matthias Clasen
058986714c tooltips: Don't use a cursor_size of 0
This leads to flickering tooltips.
2019-03-31 16:17:08 -04:00
Matthias Clasen
0230cc55bc Drop deprecated style context api 2019-03-31 15:35:20 -04:00
Matthias Clasen
6f5675ef3c Stop using deprecated style context api
Use the non-deprecated one it wraps, instead.
Yes, this is cheating...
2019-03-31 15:35:20 -04:00
Matthias Clasen
396513183b Merge branch 'fix-event-forwarding' into 'master'
Trigger bindings when forwarding key events

Closes #1793

See merge request GNOME/gtk!690
2019-03-31 18:27:24 +00:00
Benjamin Otte
720fd2cd40 textview: Fix comparison thinko
Apparently, we have no test that checks for actually drawing text, so
the thinko that caused all text to disappear in
4b07d28153 went unnoticed.
2019-03-31 20:22:05 +02:00
Matthias Clasen
da7cd6ae25 Trigger bindings when forwarding key events
This broke backspace handling in entries when an entry
completion is present.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1793
2019-03-31 14:04:35 -04:00
Matthias Clasen
8bae5348f9 text: Handle 'inverted' selections
We must handle selection_bound > cursor in
various places. This was lost in the big
entry refactoring.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1792
2019-03-31 12:36:09 -04:00
Mohammed Sadiq
56a88f107c mediastream: fix documentation 2019-03-31 08:37:45 +05:30
Daniel Boles
96bf90abe4 Widget: Don't refer to the old get_preferred_*()
measure() replaced get_preferred_height() and get_preferred_width().
2019-03-30 19:47:50 +00:00
Matthias Clasen
f273eca7e3 revealer: Add a missing break
This was showing up as the slide-down transition
being broken.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1790
2019-03-29 10:57:51 -04:00
Benjamin Otte
9d0a42dc14 stack: Add a cube spin transition
Add a transition to GtkStack that pretends pages
are the sides or a cube, and switch them by
rotating the cube.

Use this transition in widget-factory.
2019-03-29 10:03:18 -04:00
Benjamin Otte
7918eaf677 picture: Don't cause warnings on load failures
When a file set via gtk_picture_set_file() can't be loaded, just
silently don't load it.

Reftest picture-load-invalid-file added for that case.
2019-03-29 09:56:52 +01:00
Benjamin Otte
b21882bcea cssimagelinear: Make gradient offsets stay in [0, 1]
Fixes linear-gradient reftest
2019-03-29 09:56:52 +01:00
Benjamin Otte
d10a73f509 textview: Paint border windows in the right spot
Fixes textview-border-windows reftest
2019-03-29 09:56:52 +01:00
Benjamin Otte
38fbb6856c headerbar: Duct-tape over the measure mess
Fixes various reftests.

The headerbar needs soeone to redo sizing.
2019-03-29 09:56:52 +01:00
Benjamin Otte
4b07d28153 textlayout: Allow querying empty areas
This only happens when the textview has no content, but it does happen
now that such a textview gets allocated 0x0 and not 1x1.
2019-03-29 09:56:52 +01:00
Benjamin Otte
5dd5ff5236 widgetpaintable: Don't emit signals on dispose 2019-03-29 09:56:52 +01:00
Matthias Clasen
6f470affef Merge branch 'adwaita-radii-fixes-master' into 'master'
Adwaita radii fixes master

See merge request GNOME/gtk!628
2019-03-29 00:51:23 +00:00
Matthias Clasen
c30fc92b3e builder-tool: Don't strip the xml declaration
This is useful for interoperability with other tools.
2019-03-28 19:28:05 -04:00
Matthias Clasen
7222bda146 file chooser entry: Fix a crash
The ::focus-out signal signature has changed. Adapt.
2019-03-28 18:55:36 -04:00
Matthias Clasen
eaae9650d9 popover menu: Fix a parameter name mismatch 2019-03-28 18:36:15 -04:00
Matthias Clasen
f20f02c416 overlay: Remove no-longer-existing api from header 2019-03-28 18:36:15 -04:00
Matthias Clasen
700183e5b6 Convert ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-28 16:37:21 -04:00
Matthias Clasen
8d993160c2 builder-tool: Small refactoring
Introduce a PropKind enum, since the collection of
booleans is getting out of hands.
2019-03-28 16:36:59 -04:00
Matthias Clasen
fc3cae34ec builder-tool: Convert overlay child properties 2019-03-28 16:36:59 -04:00
Matthias Clasen
866640c0c2 overlay: Use a layout manager
This lets us get rid of the child properties,
by converting them to layout properties.
2019-03-28 16:36:59 -04:00
Emmanuele Bassi
208cae2f05 Do not leak unapplied layout properties
If the layout manager does not have a GtkLayoutChild, or if we cannot
apply layout properties, we should free them instead of leaking them.
2019-03-28 17:22:02 +00:00
Emmanuele Bassi
ecba428d52 Add missing handler for <layout> elements in UI files
The layout properties sub-parser needs to handle the parent tag.
2019-03-28 17:21:56 +00:00
Emmanuele Bassi
3f0f7c73e0 Connect LayoutManager to LayoutChild
If we want to inspect the type of layout properties exposed by a
GtkLayoutManager, we need a way to connect the layout manager type to
the GtkLayoutChild type it creates. In order to do so, we can set the
GtkLayoutChild type on a field of the GtkLayoutManagerClass structure.

Storing the GtkLayoutChild type on the class structure of the layout
manager also allows us to implement a default create_layout_child()
virtual function.
2019-03-28 16:58:00 +00:00
Emmanuele Bassi
65c394dbaa Document how to define layout manager properties 2019-03-28 11:47:46 +00:00
Matthias Clasen
4d9f4ed14b Merge branch 'gbsneto/install-header' into 'master'
build: Install gtkboxlayout.h

See merge request GNOME/gtk!676
2019-03-28 02:48:03 +00:00
Georges Basile Stavracas Neto
56d420c06e
boxlayout: Notify orientation changes
This was missing from the initial implementation, and
breaks the tests.
2019-03-27 23:34:03 -03:00
Matthias Clasen
dec2cf49dd Merge branch 'child-properties' into 'master'
Remove some more child properties

See merge request GNOME/gtk!675
2019-03-28 02:04:42 +00:00
Georges Basile Stavracas Neto
3d524cc67d
build: Install gtkboxlayout.h
This is included by gtk.h, and thus required to build.
2019-03-27 22:55:07 -03:00
Matthias Clasen
396deb44fa Convert ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 21:48:12 -04:00
Matthias Clasen
3631878cee builder-tool: Rewrite paned child properties 2019-03-27 21:48:12 -04:00
Matthias Clasen
26de69eaae paned: Replace the child properties
Replace the resize and shrink child properties
by resize-child1/2 and shrink-child1/2 properties.
2019-03-27 21:48:12 -04:00
Matthias Clasen
f89c93ea8e Merge branch 'window-api-cleanup' into 'master'
GtkWindow api cleanup

See merge request GNOME/gtk!674
2019-03-28 00:14:51 +00:00
Matthias Clasen
7e88fcf24e builder-tool: Rewrite toolbar child properties 2019-03-27 20:03:34 -04:00
Matthias Clasen
a443145a4d toolbar: Remove the homogeneous and expand child properties
Replace these with GtkToolItem properties homogeneous
and expand-item.
2019-03-27 20:02:48 -04:00
Matthias Clasen
8c807303da builder-tool: Rewrite GtkPopoverMenu::submenu 2019-03-27 18:38:29 -04:00
Matthias Clasen
5c2697633c popover menu: Drop the submenu child property
We are using the GtkWidget::name property instead.
2019-03-27 18:37:57 -04:00
Matthias Clasen
4a1019bed0 popover menu: Add an api for adding submenus
This is a step towards removing the submenu
child property.
2019-03-27 17:53:48 -04:00
Matthias Clasen
2f358469af Remove GtkWindow::role
...and the setter/getter for it.

This is a very old X session management thing, and you
will be hard-pressed to find a session manager that can
make use of it, and even harder-pressed to find apps
using it to their advantage.
2019-03-27 17:29:17 -04:00
Matthias Clasen
be944e0a31 file chooser: Stop setting a role
It does nothing.
2019-03-27 17:29:17 -04:00
Matthias Clasen
e5722367b3 Merge branch 'fixed-layout' into 'master'
Add GtkFixedLayout

See merge request GNOME/gtk!668
2019-03-27 18:51:04 +00:00
Matthias Clasen
7ac250dea7 Convert all ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 13:36:24 -04:00
Matthias Clasen
c507160bf2 builder-tool: Rewrite pack-type
Replace GtkActionBar::pack-type and GtHeaderBar::pack-type
with child types when going from 3 to 4.
2019-03-27 13:36:24 -04:00
Matthias Clasen
84480b3da8 action bar: Drop pack-type
Drop the pack-type child property. Allow ui
files to direct children by adding a child
type for it.
2019-03-27 13:36:24 -04:00
Matthias Clasen
6c30b474f5 header bar: Drop pack-type
Drop the pack-type child property. Allow ui files
to direct children by adding a child type.
2019-03-27 13:36:24 -04:00
Matthias Clasen
2fd2c61d37 dialog: Stop using GtkHeaderBar::pack-type
We want to get rid of child properties.
2019-03-27 13:36:24 -04:00
Matthias Clasen
7843382784 text: Allow growing entries
Add a propagate-text-width property, which, when set,
makes the entry request a natural width that is just
enough to fit the content, within the limits given
by width-chars and max-width-chars.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1721
2019-03-27 01:42:00 -04:00
Matthias Clasen
544fe83864 search entry: Fix sizing
Use the same sizing approach we use for GtkEntry:
ignore icons when measuring. This ensures that
search entries don't change size as icons come
and go.
2019-03-27 01:42:00 -04:00
Matthias Clasen
8a9290d0ba password entry: Fix sizing
Use the same sizing approach we use for GtkEntry:
ignore icons when measuring. This ensures that
password entries don't change size as icons come
and go.
2019-03-27 01:42:00 -04:00
Matthias Clasen
8d4343a550 Merge branch 'get_caret_offset_negative_one' into 'master'
Return -1 for AtkText::get_caret_offset on failure

See merge request GNOME/gtk!666
2019-03-26 23:14:48 +00:00
Matthias Clasen
c0aaa43122 Rename gdk_device_get_surface_at_position_double
We can drop the double suffix now.
2019-03-26 18:12:55 -04:00
Matthias Clasen
562cc8b9ab gtk: Stop using gtk_device_get_surface_at_position
We should always use the double variant of the api.
2019-03-26 18:12:55 -04:00
Matthias Clasen
03eb455c93 Rename gdk_device_get_position_double
We can drop the double suffix now.
2019-03-26 18:12:55 -04:00
Matthias Clasen
7e4707642a gtk: Stop using gdk_device_get_position
We should always use the double variant of this api.
2019-03-26 18:12:55 -04:00
Matthias Clasen
21580309d3 Rename gdk_surface_get_device_position_double
Drop the _double suffix, now that the int version is gone.
2019-03-26 18:12:54 -04:00
Matthias Clasen
2d10a7b9c4 gtk: Stop using gdk_surface_get_device_position
Use the double version directly.
2019-03-26 18:08:32 -04:00
Matthias Clasen
eb4e7b9172 Remove GtkWindow::gravity
This was used to interpret the position passed
to gtk_window_move. Since that is gone, gravity
is no longer useful.
2019-03-26 17:55:29 -04:00
Matthias Clasen
0481f123ea Drop gtk_window_move and gtk_window_get_position
These functions operate with global coordinates,
which are not available on Wayland.
2019-03-26 17:55:29 -04:00
Matthias Clasen
6f072c80db treeview: Stop using gtk_window_move
It is going away. The search popup needs to be
redone using popovers.
2019-03-26 17:55:29 -04:00
Matthias Clasen
2ed533c3e1 file chooser: Stop using gtk_window_get_position
It is going away.
2019-03-26 17:55:29 -04:00
Matthias Clasen
f7d3815fa8 a11y: Don't support changing widget size and position
This does not make sense.
2019-03-26 17:55:29 -04:00
Matthias Clasen
d45996c728 Avoid root coordinates in begin_drag/move apis
Change the all the begin_drag and begin_move apis in
GdkSurface and GtkWindow to expect surface coordinates.

Update the x11 implementation to translate to root
coordinates where it matters. Wayland is ignoring the
coordinates anyway.
2019-03-26 15:57:11 -04:00
Emmanuele Bassi
060e30de3f Turn GtkFixedLayoutChild:position into a transformation
This way we can transform children instead of just allocating them at an
offset.
2019-03-26 19:17:26 +00:00
Emmanuele Bassi
dd5c981b63 Use GtkFixedLayout in GtkFixed
Drop the child properties and the sizing code.
2019-03-26 18:15:13 +00:00
Emmanuele Bassi
9a4c19349e Add GtkFixedLayout
A layout manager for fixed positioning.
2019-03-26 17:43:53 +00:00
Emmanuele Bassi
3389ddf6fc Do not connect to a non-existing signal
The GtkWidget::parent-set signal was removed in ff6cd8f7.

Instead of removing GtkLayoutChild instances associated to a widget
using notifications when the widget's parent changes, we can have
gtk_widget_unparent() call a method on GtkLayoutManager to remove any
eventual GtkLayoutChild instances associated to the widget.
2019-03-26 17:37:49 +00:00
Emmanuele Bassi
341660e056 Drop warning from GtkLayoutManager::get_request_mode()
We can return a sensible default value, so we don't really need to warn
about a missing implementation.
2019-03-26 17:37:49 +00:00
Martin Robinson
c8d250deb1 Return -1 for AtkText::get_caret_offset on failure
ATK now expects this virtual method to return -1 on failure. This allows
ATs to distinguish between a caret at position 0 and a failure.
2019-03-26 15:38:20 +01:00
Emmanuele Bassi
65965bed16 Changes after review
- Rename GtkLegacyLayout to GtkCustomLayout
 - Use for() to iterate over children in GtkBinLayout
 - Whitespace fixes for code imported from GtkBox
 - Store the GtkLayoutChild instances inside LayoutManager
 - Simplify the GtkLayoutManager API by dropping unnecessary arguments
 - Fix the ownership model of GtkLayoutManager
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
630442f31c Parse layout properties
If a widget has a LayoutManager instance, then we want to parse layout
properties in UI description files; the grammar is similar to packing
properties in GtkContainer:

    <child>
      <object ...>
        <property name="...">...</property>
        <layout>
          <property name="pname">value</property>
        </layout>
      </object>
    </child>

The properties are applied after a child has been added to its parent,
to the parent's layout manager property should be set.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
d6dfa41f10 Add GtkBinLayout
Like GtkBin, but lets you lay out multiple children instead of just one.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
8cf06befc0 Port GtkSwitch to GtkLegacyLayout 2019-03-26 00:11:27 +00:00
Emmanuele Bassi
128a34fe37 Add GtkLegacyLayout
GtkLegacyLayout is a layout manager for the transitional period between
the introduction of layout managers and the removal of GtkWidget virtual
functions for the size negotiation.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
1fed357752 Port GtkBox to GtkBoxLayout
We can delegate all the layout management to a GtkBoxLayout, now that we
have one.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
ef9863ab63 Add GtkBoxLayout
The same layout policy of GtkBox, without all the GtkContainer calories.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
5cbf6f5fbd Add GtkLayoutChild
Layout managers needs a way to store properties that control the layout
policy of a widget; typically, we used to store these in GtkContainer's
child properties, but since GtkLayoutManager is decoupled from the
actual container widget, we need a separate storage. Additionally, child
properties have their own downsides, like requiring a separate, global
GParamSpecPool storage, and additional lookup API.

GtkLayoutChild is a simple GObject class, which means you can introspect
and document it as you would any other type.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
15fda18791 Rename the internal GtkLayoutChild type
The type is completely private to GtkLayout, so there's really no need
to namespace it.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
f7856e887e Add GtkWidget:layout-manager
We can use a constructor property for existing container widgets with
a layout policy, and move the layout policy implementation out of the
widget itself and into a LayoutManager subclass.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
1b8595b5f2 Hook GtkLayoutManager into GtkWidget
We delegate the size request mode, the measuring, and the allocation of
a widget through a GtkLayoutManager instance, if one has been attached
to the widget; otherwise, we fall back to the widget's own implementation.
2019-03-26 00:11:27 +00:00
Emmanuele Bassi
24754c3259 Add GtkLayoutManager
A base abstract class for layout manager delegate objects.

Layout managers are associated to a single widget, like event
controllers, and are responsible for measuring and allocating the
children of the widget they are bound to.
2019-03-26 00:11:27 +00:00
Timm Bäder
ab7507150b Doc comment fixup 2019-03-25 15:57:31 +01:00
Timm Bäder
e657d9d553 popover: Always measure contents gizmo
Otherwise we're getting warnings about allocating a widget we haven't
measured first, which is fair. The contents gizmo itself will later take
care about whether or not the real popover child is NULL.
2019-03-25 15:57:31 +01:00
Timm Bäder
36e00ae95e popover: Don't try to compute_bounds of a NULL child 2019-03-25 15:57:30 +01:00
Matthias Clasen
160f1e581a Remove a dead file
We are not using this anymore.
2019-03-24 20:48:35 -04:00
Matthias Clasen
661e195ffc color editor: Don't warn if editing is cancelled
Thats a valid way to end color picking.
2019-03-24 20:47:26 -04:00
Benjamin Otte
551ced9ae4 Fix compile warning 2019-03-23 03:08:20 +01:00
Benjamin Otte
799cb39e08 Remove win32 themeing support
It was unused through all of GTK 3, so it is not worth supporting.

The best Windows themes do not make use of it at all.
2019-03-22 22:30:01 +01:00
Matthias Clasen
1ada7bbc02 Fix hover state handling
We were not paying enough attention to detail when updating
hover and focus state while generating crossing events. The
invariant that we need to preserve here is that when a widget
has focus or hover, its parent does too.
2019-03-22 16:35:20 -04:00
Matthias Clasen
81658105f7 Stop walking parent surfaces for crossing event generation
We basically don't have child surfaces anymore (the last
use in popovers is on the way out). This really needs
to be done in terms of widgets, not surfaces. For now,
just stop walking parent surfaces.
2019-03-22 16:35:20 -04:00
Benjamin Otte
d9ef734458 cssparser: Simplify
Remove the uint parser (and use the int parser in the one user of it).

And avoid unnecessarily going through a macro.
2019-03-22 19:55:34 +01:00
Benjamin Otte
73760e5835 cssparser: Remove unused functions 2019-03-22 19:55:34 +01:00
Matthias Clasen
5638882dca Remove debug spew 2019-03-22 14:44:51 -04:00
Matthias Clasen
56df49971a entry: Disconnect text signals in dispose
This was showing up as crashes when closing
the file chooser.
2019-03-21 19:15:55 -04:00
Matthias Clasen
0bf136a902 Merge branch 'adwaita-remove-selectionmode-assets-master' into 'master'
Adwaita: Drop checkbox-selectionmode assets

See merge request GNOME/gtk!634
2019-03-20 14:10:18 +00:00
Matthias Clasen
2479d60012 Merge branch 'adwaita-selectionmode-checkboxes-master' into 'master'
Adwaita: Fix selection-mode checkboxes

Closes #28

See merge request GNOME/gtk!629
2019-03-20 14:10:05 +00:00
Matthias Clasen
6990f73940 Merge branch 'adwaita-headerbar-switch-margins-master' into 'master'
Adwaita: Adjust switch margins on headerbars

Closes #1759

See merge request GNOME/gtk!651
2019-03-20 14:06:19 +00:00
Matthias Clasen
254c27acbe Merge branch 'wip/jimmac/focus-ring-radii' into 'master'
Adwaita: draw bigger radius for focus rings

Closes #1756

See merge request GNOME/gtk!649
2019-03-20 12:32:15 +00:00
Matthias Clasen
558405e1bc window: Update state flags
When the window gets active / inactive, we
don't propagate events, but just send focus-in / -out
to the current focus_widget. Improve this by updating
its state flags as well.
2019-03-19 21:33:38 -04:00
Matthias Clasen
f47c376fb1 main: Fix crossing event generation for parented roots
We were walking the parent chain here, which now
always needs to consider whether it should stop
at roots. Like this one should.

The symptom was that a label with a popup attached to
it would end up with an unintentional focus ring that
would not go away.
2019-03-19 21:33:38 -04:00
Alex Monday
5679b9a687 Adwaita: Adjust switch margins on headerbars
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1759
2019-03-19 19:59:05 +05:00
Jakub Steiner
24235f61ab Adwaita: draw bigger radius for focus rings
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1756
2019-03-19 14:07:10 +01:00
Benjamin Otte
a44ac75e65 gtk: Don't include gtkstylecontext.h from gtkcsstypesprivate.h
And make sure it's included everywhere it's needed.
2019-03-19 08:53:25 +01:00
Benjamin Otte
85c8e29d78 stylecontext: Move atk.h include where it belongs 2019-03-19 08:49:15 +01:00
Benjamin Otte
8fb797866d paned: hide the handle widget when <2 children are visible 2019-03-19 08:48:50 +01:00
Benjamin Otte
96a677e5ca paned: Refactor
Don't call a useless function, call gtk_widget_set_child_visible()
directly.
2019-03-19 08:48:41 +01:00
Benjamin Otte
07054ca20d singleselection: Add forgotten notify emission
Also, add docs for the model property while I'm looking at the file.
2019-03-19 08:48:22 +01:00
Benjamin Otte
8f6a48832d revealer: Always use identity transform for revealed child
Refactor the child allocation machinery, so that the complex allocation
paths are only run when the animation is running.

And in particular, ensure that when no animation is running, the
identity transform is allocated.
2019-03-19 08:48:06 +01:00
Matthias Clasen
0d91481587 One forgotten leave signal handler 2019-03-18 15:35:07 -04:00
Matthias Clasen
8650980797 Adapt to motion controller api change
The signature of the enter/leave signals changed.
Adapt all users.
2019-03-18 09:24:42 -04:00
Matthias Clasen
2b0d1bca43 motion controller: Install the properties
Oops
2019-03-18 08:44:35 -04:00
Matthias Clasen
f7e328e5f7 Merge branch 'paned-no-grab' into 'master'
paned: Don't use a grab

See merge request GNOME/gtk!644
2019-03-18 11:50:42 +00:00
Matthias Clasen
b40743121b Merge branch 'crossing-details' into 'master'
motion controller: add details to signals

See merge request GNOME/gtk!621
2019-03-18 01:49:45 +00:00
Matthias Clasen
93c1353c69 Merge branch 'wip/carlosg/include-constructors-header' into 'master'
gdk: Include copy of glib/gconstructor.h

See merge request GNOME/gtk!642
2019-03-18 01:10:06 +00:00
Matthias Clasen
1196380f28 paned: Don't use a grab
It does not seem necessary for proper functioning
of the drag handle.
2019-03-17 18:55:00 -04:00
Matthias Clasen
26f99bf20c editable: Fix a thinko
When dealing with subclasses of GtkEntry, we were not
getting the property offset that is stored on the GtkEntry
type.

This was showing up as criticals when trying to set
::width-chars on a GtkFileChooserEntry.
2019-03-17 18:46:18 -04:00
Carlos Garnacho
65d9b7ee86 gdk: Include copy of glib/gconstructor.h
This is named gdkconstructor.h to avoid any possible conflicts. This fixes
the current usages of G_HAS_CONSTRUCTORS, as that header is not installed
by glib.
2019-03-17 21:29:59 +01:00
Matthias Clasen
430ea05aea widget: Fix a mission annotation 2019-03-17 01:11:22 -04:00
Matthias Clasen
17f4211e4f motion controller: Add getters for crossing event targets
This information can be needed in signal handlers,
so make it available.
2019-03-16 23:52:58 -04:00
Matthias Clasen
ecd6446d08 motion controller: Add focus properties
Add boolean properties, is-pointer-focus and
contains-pointer-focus, that track whether the pointer
is in the widget itself or in one of its descendants.
2019-03-16 23:32:31 -04:00
Matthias Clasen
1540797237 motion controller: add details to signals
The ::enter and ::leave signals get emitted up and down the
connecting path between the old an the new pointer location.

The signals are less useful if you can't find out where along
the path you are. That is what crossing mode and detail are
about, so add those to the signals.
2019-03-16 23:03:41 -04:00
Matthias Clasen
1ce5327058 xim: Stop using GtkWidget::event
It does not exist anymore. I'm removing this code now
because our CI tests are using xim and fail due to this.

Eventually, this code should be ported to use a popover.
2019-03-16 22:16:10 -04:00
Matthias Clasen
6ddb61119a Use root in gdk_synthesize_crossing_events 2019-03-16 21:30:48 -04:00
Matthias Clasen
492a38c229 Make gtk_widget_get_focus_child public
It doesn't really make sense to have only
the setter, but not the getter public.
2019-03-16 21:24:45 -04:00
Matthias Clasen
93905a8513 key controller: Enforce limitations of key forwarding
We now set current_event for focus-change as well,
so make sure to check the event type.
2019-03-16 21:24:45 -04:00
Matthias Clasen
4f06b669c5 key controller: Improve the docs
Mention the limitations of the key forwarding api.
2019-03-16 21:24:45 -04:00
Matthias Clasen
f3ed3e99c3 key controller: Add getters for focus event targets
This information can be needed in signal handlers,
so make it available.
2019-03-16 21:24:45 -04:00
Matthias Clasen
4f5a8207bc key controller: Add focus properties
Add boolean properties, is-focus and contains-focus, that
track whether the focus is in the widget itself or in
one of its descendants.
2019-03-16 21:24:45 -04:00
Matthias Clasen
2f1194c0c1 key controller: Fix a copy/paste error
Prefix the finalize function properly.
2019-03-16 21:24:45 -04:00
Matthias Clasen
921eccb459 Pass mode and detail to focus-in/out signals
This information is useful when maintaining a
'last focus' field.

Update all users.
2019-03-16 21:24:45 -04:00
Matthias Clasen
888b92674f Move maintaining the focus chain
Put this code in the same place where we generate
the crossing events.
2019-03-16 21:24:45 -04:00
Matthias Clasen
7d354b5084 Some fixes to crossing event generation
In the inferior and ancestor cases, we were missing
the initial/final event.
2019-03-16 21:24:45 -04:00
Matthias Clasen
4238a04c7b window: Use gtk_synthesize_crossing_events
Emit focus change events in the same way as crossing events.
Also change the code to only emit focus change events for
the master keyboard - we only maintain a single focus location,
so sending multiple focus change events for different devices
seems confusing.
2019-03-16 21:24:45 -04:00
Matthias Clasen
adb547a147 Export gtk_synthesize_crossing_events internally
We want to use this for focus changes, now that
it can emit focus change events.
2019-03-16 21:24:45 -04:00
Matthias Clasen
cdcd2bb073 Share crossing and focus change event code
Make a single function that can emit both
enter/leave and focus change events.
2019-03-16 21:24:45 -04:00
Matthias Clasen
c73972f7df gdk: Rename gdk_event_set_user_data
Lets call it what it is, the target.
All of this is private api anyway.

Update all callers.
2019-03-16 21:24:45 -04:00
Matthias Clasen
a3abf0693d Clarify grab_focus docs 2019-03-16 21:24:45 -04:00
Matthias Clasen
7ca24f12d7 window: Remove initial-focus builder support
With focus-widget now a property, this is no longer needed.
2019-03-16 21:24:45 -04:00
Matthias Clasen
f68855341e window: Remove ::set-focus
The focus-widget is now a property, so we don't need
this signal anymore.
2019-03-16 21:24:45 -04:00
Matthias Clasen
31d9ecb5c3 popover: Stop using ::set-focus
This will change completely when GtkPopover becomes a
root. For now, stop using ::set-focus and just use the
focus-widget property.
2019-03-16 21:24:44 -04:00
Matthias Clasen
f13e6179e8 filechooser: Stop using ::set-focus
We can achieve the same with the focus-widget property.
2019-03-16 21:24:44 -04:00
Matthias Clasen
d279c666a9 inspector: Stop using ::set-focus
The focus-widget is just a regular property now that shows
up on the property page. No need to special-case it on
the misc page anymore.
2019-03-16 21:24:44 -04:00
Matthias Clasen
7819a5aab9 Drop gtk_widget_send_focus_change
Replace this with gtk_widget_set_has_focus + gtk_widget_event.
2019-03-16 21:24:44 -04:00
Matthias Clasen
15300f839e widget: Add a private setter for has-focus 2019-03-16 21:24:44 -04:00
Matthias Clasen
94b0e99be5 Exclude non-drawable widgets from focus
This was showing up as confusion between palette
and editor in the color chooser.
2019-03-16 21:24:44 -04:00
Matthias Clasen
8c1d852a84 widget: Drop the ::focus signal
The focus vfunc is an implementation detail
of GTK focus handling, and having external
signal handlers interfere with it is not
a good idea.
2019-03-16 21:24:44 -04:00
Matthias Clasen
2738926dcb Simplify the move_focus api
No need to pass the array in from the outside.
2019-03-16 21:24:44 -04:00
Matthias Clasen
029ec38e63 Move a check to gtk_window_set_focus
gtk_widget_grab_focus is just a wrapper for
gtk_window_set_focus. We should do all the enforcement
there.
2019-03-16 21:24:44 -04:00
Matthias Clasen
2bf1561b48 Port widgets to the root focus API 2019-03-16 21:24:44 -04:00
Matthias Clasen
bd44831987 window: Implement the root focus api
This just uses the existing get/set_focus functions.
We keep them public for now.
2019-03-16 21:24:44 -04:00
Matthias Clasen
ab5d3e756b root: Add focus
Add a getter and a setter for the focus widget.
The default implementations do nothing.
2019-03-16 21:24:44 -04:00
Matthias Clasen
92f1bdcf45 Redo focus handling
GtkWindow has a focus_widget that points to the current input focus.
GtkWidget has a focus_child that points to the child that contains
the input focus. Following the focus_child chain from the toplevel
always leads to the focus_widget. We never unset focus_child, we only
set it. We bubble focus change events.
2019-03-16 21:24:44 -04:00
Matthias Clasen
64b9114d98 password entry: Fix property notification
Both placeholder-text and activates-default were not
up to our usual standards for property notification,
and the tests complained.
2019-03-16 21:23:28 -04:00
Matthias Clasen
a1cc809c60 search entry: Fix property notification
Both placeholder-text and activates-default were not
up to our usual standards for property notification,
and the tests complained.
2019-03-16 21:23:28 -04:00
Matthias Clasen
7ca528b896 widget: Check rootness for invisibility
Make the function that determines initial visibility
look at whether the class implements GtkRoot. That is
the eventual goal for this check. For now, allow
popovers in here as well.
2019-03-16 21:23:28 -04:00
Matthias Clasen
f14d998c95 password entry: Don't show both icons
It can be a bit confusing to have an indicator
and an action next to each other, and with the
peek icon, the need for the Caps Lock warning is
reduced, since you can just reveal the text to
see that it is capitalized.

Therefore, only show the Caps Lock warning if
the peek icon is disabled.
2019-03-15 14:35:25 -04:00
Matthias Clasen
a3b73a416e password entry: Add a way to see the content
Add a ::show-peek-icon property and show a clickable
icon when it is set. Clicking it toggles the visibility
of the content. The same functionality is also accessible
via a context menu item.

This is a common feature of password entries.
2019-03-14 20:31:45 -04:00
Matthias Clasen
d3cecd65a5 password entry: Make the Caps Lock icon less prominent
Set a style class, and theme the Caps Lock icon to
be  less promient, so it does not appear clickable.
2019-03-14 20:03:34 -04:00
Matthias Clasen
470720e11a password entry: Use text cursor for Caps Lock indicator
We don't want it to appear clickable, but we still
need to keep it pickable for the tooltip to work,
so explicitly give it the same cursor that we use
for the text.
2019-03-14 19:17:39 -04:00
Matthias Clasen
c3f43cf1f2 entry: Make progress bar not pickable
There is no need for that, we don't want to
handle input here at all.
2019-03-14 19:15:31 -04:00
Matthias Clasen
5251253fc0 password entry: a better Caps Lock icon
This is more in line with how Caps Lock
is typically indicated.
2019-03-14 19:00:37 -04:00
Matthias Clasen
56ee1f3566 password entry: Add placeholder-text and activates-default
Add ::placeholder-text and ::activates-default properties.
Password entries are going to be used in dialogs, where
these two properties are useful.
2019-03-14 18:42:07 -04:00
Matthias Clasen
4afad781fe password entry: Initialize capslock state
The icon was erroneously showing up before the first
focus-in event.
2019-03-14 17:58:10 -04:00
Matthias Clasen
8e4c441f78 a11y: More entry fixes
Remove the GtkEntry assumption from more places.
2019-03-14 17:58:02 -04:00
Alex Monday
d07cd892e7 Adwaita: Drop checkbox-selectionmode assets 2019-03-13 14:12:45 +05:00
Alex Monday
4bba279085 Adwaita: Fix selection-mode checkboxes
Use object-select-symbolic as a check icon, adjust styles.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/28
2019-03-12 22:05:08 +05:00
Alex Monday
36539a22d7 Adwaita: Adjust entry border-radius
Replace entry border-radius value with $button_radius variable.
2019-03-12 20:42:48 +05:00
Alex Monday
ad96220448 Adwaita: Replace spinbutton border-radii with variables
Replace hardcoded border-radius values with $button_radius
variable on spinbuttons.
2019-03-12 20:34:38 +05:00
Alex Monday
73139d524b Adwaita: Replace all %linked radii with variables
Some of hardcoded border-radius values on linked elements were left
unchanged during Adwaita refresh.
2019-03-12 20:32:14 +05:00
Benjamin Otte
3863e44360 text: Simplify
The previous arguments were equivalent to using NULL.
2019-03-08 14:12:17 +01:00
Benjamin Otte
8566218485 text: Remove two unused member variables 2019-03-08 14:12:04 +01:00
Benjamin Otte
1475575799 text: Use gtk_widget_set_overflow() 2019-03-08 13:39:52 +01:00
Benjamin Otte
bc901ffa5a text: Remove 2 unused variables
One is always 0, the other is always equal to gtk_widget_get_width()
2019-03-08 13:33:54 +01:00
Benjamin Otte
b114d45c5f colorswatch: Use gtk_widget_set_overflow() 2019-03-08 13:20:17 +01:00
Benjamin Otte
9a1c698070 widget: Make overflow respect rounded corners
Fixes !574
2019-03-08 13:20:17 +01:00