Commit Graph

39724 Commits

Author SHA1 Message Date
Matthias Clasen
dfe8eb37ce search-entry: Add getter/setter annotation
This was suggested in !4823.
2022-07-11 15:08:39 -04:00
Matthias Clasen
f218a4e2d2 Merge branch 'free-print-backends' into 'main'
print: Free print backends after use

Closes #5019

See merge request GNOME/gtk!4860
2022-07-11 18:04:46 +00:00
Emmanuele Bassi
f4f683a469 Rename clear_template to dispose_template
Make it more clear that the function is supposed to be called during the
dispose sequence of a widget.
2022-07-11 18:24:37 +01:00
Emmanuele Bassi
63fe3345a7 fontchooserdialog: Use gtk_widget_clear_template() 2022-07-11 18:24:37 +01:00
Emmanuele Bassi
01e99fad1e statusbar: Use gtk_widget_clear_template() 2022-07-11 18:24:37 +01:00
Emmanuele Bassi
0074ee3149 filechooserwidget: Use gtk_widget_clear_template() 2022-07-11 18:24:37 +01:00
Emmanuele Bassi
ad361abc4c filechooserdialog: Use gtk_widget_clear_template() 2022-07-11 18:24:37 +01:00
Emmanuele Bassi
103f52bb8a Port the inspector to gtk_widget_clear_template()
Use clear_template() instead of unparenting widgets manually.
2022-07-11 18:24:37 +01:00
Emmanuele Bassi
c2ec244b84 docs: Include clear_template() in the templates overview
Make sure that it's clear how to use it in idiomatic code, by tying it
to gtk_widget_init_template().
2022-07-11 18:24:37 +01:00
Emmanuele Bassi
620d48ca0c docs: Clarify scope of gtk_widget_clear_template()
The clear_template() method only clears the template children.
2022-07-11 18:24:37 +01:00
Emmanuele Bassi
e8c5c2f648 emojichooser: Use gtk_widget_clear_template() 2022-07-11 18:24:37 +01:00
Emmanuele Bassi
71eb19bf51 mediacontrols: Use gtk_widget_clear_template() 2022-07-11 18:24:37 +01:00
Emmanuele Bassi
7857c1a66b Add gtk_widget_clear_template()
The dual of gtk_widget_init_template(), which should be used to clear
the template data associated with a specific GtkWidget type.
2022-07-11 18:24:37 +01:00
Marek Kasik
e68a3a6123 print: Free print backends after use
Print backends loaded in GtkPrintUnixDialog's load_print_backends()
are not freed later as done in e.g. GtkPageSetupUnixDialog.
This commit destroys and unref those print backends.

Closes #5019
2022-07-11 16:54:36 +02:00
Matthias Clasen
743406998c inspector: Hide measure graphs by default
It is much more valuable to have a responsive inspector,
than to have these graphs.
2022-07-10 16:25:55 -04:00
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