Commit Graph

39760 Commits

Author SHA1 Message Date
Matthias Clasen
726c9e83d2 css: Allow fractional letterspacing
Something like letter-spacing: -0.5px make a lot of
sense. But we were handling the number as integer
somewhere, loosing the fractional part.

Fixes: #5034
2022-07-10 15:22:18 -04:00
Christopher Davis
9f2a621328 passwordentry: Use password input purpose
Per discussion in #gtk on Matrix
2022-07-06 13:48:25 -04:00
Matthias Clasen
ab1cf67432 fontchooser: Make size level effective
We were not hiding the size controls on the tweaks
page, which is arguably what should happen when
the size level is disabled.
2022-07-03 12:50:40 -04:00
Matthias Clasen
d0894b2786 fontchooser: Some OpenType improvements
Work harder to find examples for char variation
features, and pull the feature labels out of
the font if possible. This lets us show
meaningful names like "Localised @ and & symbols"
instead of "Stylistic Set 7" or even "ss07".
2022-07-03 07:38:24 -04:00
Alexander Mikhaylenko
d42c51e27d actionbar: Document GtkBuildable child types 2022-07-03 02:26:18 +04:00
Matthias Clasen
f0d329cf5e Merge branch 'wip/chergert/fix-menutracker' into 'main'
menutrackeritem: protect against use-after-free

Closes #5009

See merge request GNOME/gtk!4832
2022-07-01 11:17:32 +00:00
Matthias Clasen
faa9ef2dc0 Add gtk_builder_cscope_add_callback
This is a convenience method for the common case
that symbols are used under their own name.
2022-06-30 19:02:02 -04:00
Jakub Steiner
6776c21350 theme: selectable labels legibility
- don't set fg color for selections

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5017
2022-06-29 21:40:30 +02:00
Benjamin Otte
672618e560 Merge branch 'wip/otte/for-main' into 'main'
Rework listitemfactory

See merge request GNOME/gtk!4835
2022-06-28 19:30:17 +00:00
Emmanuele Bassi
e28516d189 Merge branch 'template-signals' into 'main'
Force quark creation for templates

See merge request GNOME/gtk!4836
2022-06-28 17:59:31 +00:00
Maximiliano Sandoval R
dfe9460240
Force quark creation for templates 2022-06-28 18:48:38 +02:00
Benjamin Otte
be1729b316 signallistitemfactory: Update signal prototype
I'm not sure this is API safe, but it is necessary if we want to support
section items and canvas items.

If it's deemed API-unstable, we have to copy this object and deprecate
this one.
2022-06-28 16:37:38 +02:00
Benjamin Otte
57f2b5d2e6 listitemfactory: Make this callback-based
This way, we no longer prescribe the use of either GtkListItem or
GtkListItemWidget.

This means we can use it in other places, such as for custom section
header objects or with my Canvas ideas.
2022-06-28 16:37:38 +02:00
Benjamin Otte
c00b234440 picture: Clear the paintable properly
Add a clear() function and call it from dispose() instead of using
set_paintable().
2022-06-28 16:37:11 +02:00
Christian Hergert
4d883861b1 menutrackeritem: protect against use-after-free
With recent updates to GLib, I now see cases where we can hit a state that
has finalized before notify (which will bump the ref count back up). This
is evident in GNOME Text Editor when showing a language submenu from a
popover, and then dismissing the popover and subsequently the tab.

With the previous commit, we at least get a warning like this, which helped
track down the issue.

 Gtk-CRITICAL **: gtk_action_observable_unregister_observer: assertion 'GTK_IS_ACTION_OBSERVABLE (observable)' failed
 GLib-GObject-CRITICAL **: g_object_ref: assertion '!object_already_finalized' failed

This patch fixes both of those criticals.

Fixes #5009
2022-06-24 14:30:45 -07:00
Christian Hergert
f9c0fc4fdd menutrackeritem: be defensive during finalize
The menu/action system tends to be incredibly re-entrant, and while fixing
the misuse during finalization cycles should be a priority, this can help
protect just a bit more.

Related #5009
2022-06-24 14:30:31 -07:00
Jordan Petridis
c378eacb5d shortcutcontroller: fix typo in property docs
followup of d7dae84af2
2022-06-23 22:35:48 +03:00
Matthias Clasen
287ed99130 Merge branch 'wip/otte/inspector-inspector' into 'main'
inspector: Inspect

See merge request GNOME/gtk!4822
2022-06-22 18:25:13 +00:00
Luca Bacci
a1d03e69a4 Add stub gtk_window_export_handle implementation for some backends 2022-06-21 22:56:33 +02:00
Benjamin Otte
18c2ba9b71 inspector: Add an "inspect inspector" button
And launch a new inspector.

The location of that button is rather random - I had no idea where to
put it.
2022-06-21 02:35:02 +02:00
Benjamin Otte
3da3cb35a6 object-tree: Allow inspecting inspectors
We filter by display, so the inspector window should show up only when
inspecting the inspector.
2022-06-21 02:35:02 +02:00
Benjamin Otte
e54567611b inspector: Don't use global variable here
When inspecting the inspector, we want to create mutiple displays here.

If we need this to be global, we should store it per-inspected-display.
2022-06-21 02:35:02 +02:00
Jordan Petridis
4b5d218067 inscription: Add missing Since annotations 2022-06-17 00:15:46 +03:00
Jakub Steiner
dd9f26c492 HC: make selected items better visible
- follow libadwaita's example and outline selected items for better visibility
  in high contrast variant

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4984
2022-06-15 14:47:47 +02:00
Benjamin Otte
7953092059 Merge branch 'wip/antoniof/dont-rubberband-on-drag-end' into 'main'
listbase: Don't start rubberband on ::drag-end

See merge request GNOME/gtk!4793
2022-06-14 03:45:55 +00:00
Benjamin Otte
0a4c08a7be inscription: Multiparagraph text is always multiline
Wrap this text and clip towards the bottom, no matter how high the
inscription is.
2022-06-13 06:49:12 +02:00
Benjamin Otte
883011f252 inscription: Do not try to align layouts that have a proper width set
Pango knows where to put the text.
2022-06-13 06:49:12 +02:00
Georges Basile Stavracas Neto
c93a01d627 Inscription: Derive row alignment from xalign
Texts usually want the alignment of each row to match the xalign of
the text itself.

Derive the alignment of the PangoLayout from the xalign property of
the inscription. Because Pango doesn't provide float row alignment,
map left, center and right from the xalign in 1 / 3 steps.
2022-06-13 05:35:47 +02:00
Matthias Clasen
62984d091a Merge branch 'wip/otte/inscription' into 'main'
More inscription work

See merge request GNOME/gtk!4808
2022-06-12 01:38:40 +00:00
Benjamin Otte
6d15549f51 inscription: Add ::wrap-mode
We use a different wrap-mode than GtkLabel, because we cannot just
resize the widget to make long words fit, we have to fit the size we are
given.
2022-06-12 03:10:50 +02:00
Matthias Clasen
d88e935398 Merge branch 'wip/otte/listmodels' into 'main'
19 listmodels: Add ::item-type and ::n-items

See merge request GNOME/gtk!4807
2022-06-11 15:15:53 +00:00
Benjamin Otte
393ef4d0a2 inscription: Fixate layout at top when it doesn't fit
Ellipsized and clipped layouts shouldn't reposition themselves according
to yalign when they don't fully fit.
2022-06-11 16:28:27 +02:00
Benjamin Otte
efd9aac3fa assistant: Add ::item-type and ::n-items to the pages list 2022-06-11 16:08:37 +02:00
Benjamin Otte
11aef91fa5 bookmarklist: Add ::item-type and ::n-items 2022-06-11 08:25:23 +02:00
Benjamin Otte
f48c9b8388 directorylist: Add ::item-type and ::n-items 2022-06-11 08:25:22 +02:00
Benjamin Otte
62096ebd16 filterlistmodel: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:22 +02:00
Benjamin Otte
f7b8184b00 fattenlistmodel: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:21 +02:00
Benjamin Otte
b91f60b4f9 listlistmodel: Add ::item-type and ::n-items 2022-06-11 08:25:21 +02:00
Benjamin Otte
b6ba8ecbd0 maplistmodel: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:20 +02:00
Benjamin Otte
02ee10639d multifilter: Add ::item-type and ::n-items 2022-06-11 08:25:20 +02:00
Benjamin Otte
0e42fa95b1 multiselection: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:19 +02:00
Benjamin Otte
7a36632afc multisorter: Add ::item-type and ::n-items 2022-06-11 08:25:19 +02:00
Benjamin Otte
301f1a577d noselection: Add ::item-type and ::n-items 2022-06-11 08:25:18 +02:00
Benjamin Otte
67e336992f propertylookuplistmodel: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:18 +02:00
Benjamin Otte
e1845f5e90 selectionfiltermodel: Add ::item-type and ::n-items 2022-06-11 08:25:17 +02:00
Benjamin Otte
d7dae84af2 shortcutcontroller: Add ::item-type and ::n-items 2022-06-11 08:25:17 +02:00
Benjamin Otte
0f829c4599 singleselection: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:16 +02:00
Benjamin Otte
3fca865625 slicelistmodel: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:16 +02:00
Benjamin Otte
bf8b26aa27 sortlistmodel: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:15 +02:00
Benjamin Otte
cbc3d3f3ec stack: Add ::item-type and ::n-items to the pages list 2022-06-11 08:25:15 +02:00
Benjamin Otte
fd4562aac9 treelistmodel: Add ::item-type and ::n-items
With tests!
2022-06-11 08:25:14 +02:00
Benjamin Otte
c26962c4b1 multifilter: Actually emit ::items-changed when items change 2022-06-11 08:25:14 +02:00
Benjamin Otte
46ce19d22a multisorter: Actually emit ::items-changed when items change 2022-06-11 08:25:14 +02:00
Benjamin Otte
303bc3bb1b inspector: Use inscriptions for the rendernodes list 2022-06-11 02:15:08 +02:00
Benjamin Otte
bf5edc6b7c reftests: Add test for the overflow methods
Reference is using labels again
2022-06-11 02:15:08 +02:00
Benjamin Otte
7c034cc283 inscription: Set css name
We use "label" just like GtkLabel as the two widgets differ in the way
they are measured, but they should be styled the same.

If it turns out we change our opinion on this for specific cases, we
can add style classes later.
2022-06-11 02:15:08 +02:00
Benjamin Otte
e437a9c348 inscription: Add a11y support for text interface
This is entirely untested.
2022-06-11 02:15:08 +02:00
Benjamin Otte
1517c1813c inscription: Add ::text-overflow
Can't name it ::overflow, because that's taken by GtkWidget already
2022-06-11 02:15:08 +02:00
Benjamin Otte
01fcfc5c2a inscription: Add ::markup
Utility property that sets both the ::text and ::attributes properties,
mainly intended for use in ui files to ease translation support and bindings.
2022-06-11 02:15:08 +02:00
Benjamin Otte
3f4c88aad1 inscription: Add ::attributes property 2022-06-11 02:15:08 +02:00
Benjamin Otte
b8199bcc1f gtkpango: Add G_GNUC_WARN_UNUSED_RESULT
Guess who just spent 10 minutes in gdb and doesn't want to do that
again.
2022-06-10 04:34:23 +02:00
Benjamin Otte
abdbef1b5e inspector: Add inscription support
Allow searching for inscription text and show it in the label column.
2022-06-10 04:34:23 +02:00
Benjamin Otte
6ac7f0562b inspector: Use inscriptions in the object tree 2022-06-10 04:34:23 +02:00
Benjamin Otte
b6a8080b2f Add GtkInscription
A label alternative that renders itself into a given rectangle.

The main use case is cells in column view.

Related: #3334
2022-06-09 05:58:27 +02:00
Benjamin Otte
e4869938b7 listview: Fix clipping for horizontal listviews
Fixes a bug introduced with
commit 39645d3258
2022-06-07 19:21:46 +02:00
Benjamin Otte
fa1dca29b6 inspector: Allow searching for editable text
... and display it in the label column.
2022-06-07 17:33:04 +02:00
Benjamin Otte
9de027df65 video: Fix typo in docs 2022-06-07 05:56:15 +02:00
Benjamin Otte
39645d3258 listview: cull listitems that are out of view
Use set_child_visible(FALSE) on those widgets and don't allocate them.

This should usually be the majority of items, so it's quite a worthwhile
addition.

Idea by Ivan Molodetskikh.

Related: #3334
2022-06-07 03:20:11 +02:00
Matthias Clasen
19fb336c39 Fix ui files to work for translations
We need to keep using translatable="yes", since
that is what the installed its file is looking
for.

Fixes: #4957
2022-06-06 18:29:14 -04:00
António Fernandes
dc4540fae9 listbase: Don't start rubberband on ::drag-end
GtkGestrureDrag::drag-end can be emitted when the pointer has just
crossed the drag threshold and we have not started the rubberband yet.
This happens if another gesture has claimed the event sequence earlier
in the current event propagation chain.

In such situation, our ::drag-end calls gtk_list_base_drag_update(), 
which proceeds to start the rubberband. That's obviously wrong.
Additionally, it also tries to get modifiers from an event it we are 
already denied,  which obviously fails with criticals:

`gdk_event_get_modifier_state: assertion 'GDK_IS_EVENT (event)' failed`

Thus, if there is no rubberband when we receive ::drag-end, do nothing.
2022-06-04 17:30:10 +00:00
Matthias Clasen
31da5f7e2a Merge branch 'expand-builtin-icontheme' into 'main'
Add more directories to the builtin hicolor index

Closes #4960

See merge request GNOME/gtk!4786
2022-06-04 10:44:48 +00:00
Matthias Clasen
0e6a3ab397 Merge branch 'ebassi/a11y-text-extents' into 'main'
a11y: Implement atspi.Text.GetCharacterExtents for GtkTextView

See merge request GNOME/gtk!4754
2022-06-02 17:13:53 +00:00
Carlos Garnacho
e895f7dd70 a11y: Transform GetCharacterExtents coords to native surface ones
These coordinates are "window"-relative, so transform textview coordinates
to the coordinate system of the GtkNative containing it.
2022-06-02 14:35:53 +02:00
Matthias Clasen
dae892d8f6 Add more directories to the builtin hicolor index
We haven't had any scalable directories in this list.
Add some. Since we seem to have settled on including
just actions and status as subdirectories for each
size, add scalable/actions and scalable/status.

Fixes: #4960
2022-06-02 06:38:12 -04:00
Christian Hergert
8f1db27b6b gtkmain: add support for GTK_DEBUG=invert-text-dir
This allows inverting the default text-direction in an application for
debugging, testing, and QA purposes. IDEs such as Builder may automate this
to encourage more application developers to test with a text-direction
different than their own.
2022-06-01 11:26:44 -07:00
Christian Hergert
63e9e7e899 builderparser: fix <lookup/> with interface types
If we have a <lookup name="foo" type="SomeInterface"> a runtime warning
would be emitted and the expression would fail to be created. This is
because the interfaces will likely be a GObject as well, meaning we check
the object type branch instead of the interface.

Instead, we need to use the fundamental type like other parts of the
expression system use.
2022-05-31 15:58:21 -07:00
Matthias Clasen
2623c396cb shortcutcontroller: Fix a typo 2022-05-30 16:27:03 -04:00
Sebastian Dröge
e61aecd67e Mark sequence parameter in GtkGestureClick::unpaired-release signal as nullable 2022-05-30 11:33:59 +03:00
Matthias Clasen
f9a3f13702 Merge branch 'main' into 'main'
GtkIMContextSimple: array bounds was not correctly checked

Closes #4771

See merge request GNOME/gtk!4748
2022-05-27 14:24:54 +00:00
Sebastian Keller
6e3dbc42a8 a11y: Realize GtkStackPage parent context before trying to get a ref
If a context is not realized, calling gtk_at_spi_context_to_ref() will
return a null ref, because its path has not been initialized yet. This
was already done for all other cases in get_parent_context_ref(), but
was missing for the GtkStackPage case.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4944
2022-05-25 14:56:05 +02:00
Emmanuele Bassi
7750a2c423 a11y: Implement atspi.Text.GetCharacterExtents for GtkTextView
Retrieve the location of a given offset in window-relative coordinate
space.
2022-05-23 15:54:13 +01:00
Matthias Clasen
393893b8db Merge branch 'blink-assertion' into 'main'
Remove an assertion that we hit

See merge request GNOME/gtk!4753
2022-05-23 14:08:43 +00:00
Matthias Clasen
b3e65bfdc1 Remove an assertion that we hit
It appears that we mess up accounting for blinking
cursors sometimes, and can hit blink_cb when there
is a nonempty selection.

Instead of asserting, warn and stop blinking.

Related: #4767
2022-05-23 08:28:00 -04:00
Benjamin Otte
72fe406c4d gesturedrag: Fix docs
Leftover from GTK3. Coordinates are widget relative everywhere now.
2022-05-22 12:45:28 +00:00
Víctor Marzo
3955633aa8 GtkIMContextSimple: array bounds was not correctly checked
Fixes #4771
2022-05-19 11:35:14 +02:00
Matthias Clasen
1fbca7a76a Merge branch 'let_selectable_label_mnemonic_self_focus' into 'main'
Allow selectable labels contents to be selected by mnemonic

See merge request GNOME/gtk!4741
2022-05-18 13:55:33 +00:00
Caolán McNamara
3f49d335d1 Allow selectable labels contents to be selected by mnemonic
expecially by the mnemonic of another label that targets it.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4927

see also https://bugs.documentfoundation.org/show_bug.cgi?id=137748
2022-05-18 12:40:40 +01:00
Christian Hergert
b9574e119b checkbutton: fix critical when setting use-underline
This needs to make sure that we've created the label before applying the
setting on a child widget.

Fixes #4934
2022-05-17 12:28:25 -07:00
Matthias Clasen
c0747f2c2e Add an explicit harfbuzz dependency
We are using Harfbuzz api in the file chooser,
so lets make this official.
2022-05-15 10:37:24 -04:00
Benjamin Otte
61bb9bb935 listitemmanager: Clarify warning
Lars doesn't have an opinion on this problem anymore.

And when people see this warning, they should know what to do.
2022-05-14 16:53:44 +02:00
Matthias Clasen
8bd77441a9 Cosmetic fixes to objcopy hack
Preserve the elf section name that we would get
without the objcopy hack. Minimizing the differences
2022-05-14 07:53:47 -04:00
Luca Bacci
e1159dab93 GtkFileChooserWidget: Propagate keys from external entry to fcwidget at the BUBBLE phase
Now that we use event controllers we can forward keybindings from the
external entry to the filechooserwidget at the bubble phase.

Fixes #4905

References:
 * commit 1fb075dbca
 * commit 686116ba61
2022-05-13 14:19:14 +02:00
Matthias Clasen
122fa679a8 Merge branch 'wip/sophie-h/remove-param-nicks-blurbs' into 'main'
gtk: Remove all nicks and blurbs from param specs

Closes #4904

See merge request GNOME/gtk!4717
2022-05-12 02:18:02 +00:00
Matthias Clasen
7302407880 Merge branch 'wip/exalm/color-scales' into 'main'
Redesign GtkColorScale

See merge request GNOME/gtk!4720
2022-05-12 02:01:03 +00:00
Alexander Mikhaylenko
0f7d93492d theme: Redesign color scales
See https://gitlab.gnome.org/GNOME/libadwaita/-/issues/469

Since this style needs changes in color scales themselves, it makes sense
to have it in GTK as well.
2022-05-12 02:22:52 +04:00
Alexander Mikhaylenko
aee4475c0f range: Support border-radius for GtkColorScale troughs
With how this hack is organized, it's simpler to add more code here than
to pass it to GtkColorScale itself.
2022-05-12 02:21:51 +04:00
Alexander Mikhaylenko
1f61cb2251 coloreditor: Stop adding marks style to color scales 2022-05-12 02:21:34 +04:00
Christian Hergert
0382e3b46c actionmuxer: check for observer before unregistering
This can happen if the group can be resolved even when doing the initial
registration of an action as observer will not yet be in the GSList of
watchers (and therefore has no weak references).

Fixes a warning like the following:

 g_object_weak_unref: couldn't find weak ref
2022-05-11 14:43:31 -07:00
Christian Hergert
547b2891cb actionmuxer: set handler ids initially to zero
These were getting created with possible non-zero values and then inserted
into a hashtable where the readers may not know the state of the group.

Ensure those values are set to zero until we assign them below.
2022-05-11 14:43:24 -07:00
Sophie Herold
89614f5f72 inspector: Stop using blurb as tooltip
Does not make sense any longer if we don't set blurbs.
2022-05-11 18:16:44 +02:00