Commit Graph

39760 Commits

Author SHA1 Message Date
Corey Berla
c6f357e447 gridview: Limit rectangle to gridview columns
The function gtk_grid_view_get_items_in_rect() erroneously calculates
columns less than 0 and greater than n_columns when the user attempts
to rubberband all the way to the left or right respectively.  This
causes the rubberband to persistent and creates unexpected behavior.
Limit the rows to a minimum of 0 and maximum of n_columns - 1.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3445
2022-07-25 17:27:24 -07:00
Corey Berla
2bcae546b3 gridview: Move gtk_grid_view_computer_total_height() up for reuse 2022-07-25 17:27:24 -07:00
Philip Withnall
87ba99f66b gtkwidget: Fix a small typo in a docs comment
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-07-25 23:15:58 +02:00
Maximiliano Sandoval R
ef07d1556b
picture: Fix Since and Deprecated annotations
gi-docgen will parse four or more whitespaces of indentation as code blocks,
two whitespaces were used.

This was missing in https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4873.
2022-07-25 12:59:47 +02:00
Carlos Garnacho
2b131f09a8 Merge branch 'fix-controller-key-event-propagation-file-chooser-widget' into 'main'
GtkFileChooserWidget: Propagate captured key events when the location entry is focused

Closes #4880

See merge request GNOME/gtk!4674
2022-07-19 22:15:04 +00:00
Matthias Clasen
b165028e86 Merge branch 'drag-action' into 'main'
tree/iconview: Use a unique drag action in drag_enter/motion callbacks

Closes #3187

See merge request GNOME/gtk!4882
2022-07-18 14:35:11 +00:00
Matthias Clasen
6e379181d9 Merge branch 'treeview-drag-ancestor' into 'main'
treeview: Check for column header area in row click/drag gestures

Closes #4453

See merge request GNOME/gtk!4885
2022-07-18 14:33:26 +00:00
Matthias Clasen
edf8c9e501 Merge branch 'matthiasc/for-main' into 'main'
css: Fix handling of transform values

See merge request GNOME/gtk!4890
2022-07-18 14:24:49 +00:00
Matthias Clasen
0cebf6d9c5 Merge branch 'drop-target-unique' into 'main'
droptarget: Provide a unique action for gdk_drop_finish

Closes #5051

See merge request GNOME/gtk!4888
2022-07-18 12:38:52 +00:00
Matthias Clasen
6ef3968227 css: Fix handling of transform values
When computing a transform value, there is nothing
to do, but we still need to copy the matrix from
src to dest, since it depends on the other transforms
in the array whether we are using the src or the
dest in the end.

This fixes cases like
-gtk-icon-transform: perspective(100px) matrix(1,2,...);
which would otherwise end up with a zero matrix.
2022-07-18 07:08:01 -05:00
Mat
89db59a40d treepopover: Add support for scrolling
Add support for scrolling large tree popovers in a similar fashion to GtkPopoverMenu.

Fixes #3674
Fixes #4877
2022-07-18 00:44:28 +03:00
Mat
9209fd65a5 droptarget: Provide a unique action for gdk_drop_finish
gdk_drop_finish() requires a unique drop action. Reuse the existing
make_action_unique() function to get one.

Fixes #5051
2022-07-17 22:59:59 +03:00
Mat
c9a48736d6 treeview: Check for column header area in row click/drag gestures
Bail out if a row click/drag gesture is performed in the column header area,
since separate gestures handle column headers.

Fixes #4453
2022-07-17 17:36:38 +03:00
Marco Melorio
8376f5c9fa picture: Remove keep-aspect-ratio mention in the doc
We were still suggesting to use it in the main doc page. Suggest using
content-fit instead.
2022-07-17 16:21:53 +02:00
Mat
d89297b152 tree/iconview: Use a unique drag action in drag_enter/motion callbacks
Functions already exist for providing a unique drag action for gdk_drop_finish().
Reuse these functions in the drag_enter/motion callbacks, since they require
a unique action as the return value.

Fixes #3187
2022-07-17 06:09:53 +03:00
Yubao Liu
50a8cbc0da popover: Correctly substract arrow height when measuring popover widget
For default popover arrow position and default height-for-width layout mode,
natural_width is calculated first with for_size=-1 and orientation=HORIZONTAL,
at the end of gtk_popover_measure() natural_width  won't be added with tail_height.

Then to measure with for_size=natural_width and orientation=VERTICAL, obviously
for_size shouldn't be substract with tail_height.

The wrong logic will force content in popover gets less width and then text labels
in popover may get wrapped unnecessarily.
2022-07-17 00:29:42 +08:00
Marco Melorio
3eac4ef5c9 picture: Move variable definition at the top 2022-07-16 01:40:08 +02:00
Marco Melorio
f1faa71d6d picture: Set overflow to be hidden
The new content-fit property was wrongly suggesting to manually set
widgets' overflow property, but that property is not really intended to
be set by external code. This commit removes those suggestions and
directly set picture's overflow to be hidden.
2022-07-16 01:40:01 +02:00
Marco Melorio
a08bc46936 picture: Fix replacement for deprecated methods 2022-07-16 01:18:07 +02:00
Matthias Clasen
c6a56b52dc Merge branch 'text-placeholder-visibility' into 'main'
text: Update placeholder visibility more

See merge request GNOME/gtk!4875
2022-07-15 23:00:16 +00:00
Matthias Clasen
09f99ffb27 Merge branch 'gtk-content-fit' into 'main'
picture: Add content-fit property

Closes #5027

See merge request GNOME/gtk!4873
2022-07-15 22:28:42 +00:00
Marco Melorio
d8a73cbd03 picture: Add content-fit property
It allows to specify the resize mode of the paintable inside the
GtkPicture allocation. This also deprecates the keep-aspect-ratio
property.

Fixes #5027.
2022-07-15 23:01:23 +02:00
nick richards
624f5ba0ec Improve style in GtkInscription documentation 2022-07-15 20:55:37 +00:00
Matthias Clasen
ac81ed3adb text: Update placeholder visibility more
When the text in the buffer changes, we should
update the placeholder visibility, since we might
have gone from empty to non-empty.
2022-07-15 16:47:02 -04:00
Matthias Clasen
7743f35972 maplistmodel: Fix an oversight
This was meant to go into 678eb8ab76.
2022-07-14 19:52:54 -04:00
Matthias Clasen
678eb8ab76 maplistmodel: Fix items-changed emission
We were modifying the removed value before passing
it to the items-changed signal, so we always ended
up with removed == 0 in our signal emission, instead
of passing the original value on, as we should.

Pointed out in !4870
2022-07-14 16:53:09 -04:00
Matthias Clasen
f8945b6325 pango_font_description_to_css: Handle numeric weight
The PangoWeight enum agrees with the numeric values
we use here, so we can do this without a switch and
support numeric weight values at the same time.
2022-07-14 15:50:06 -04:00
Maximiliano Sandoval R
9868143696
pango_font_description_to_css: Add extra-expanded 2022-07-14 12:55:55 +02:00
Matthias Clasen
5b76d0c226 GtkStack: Create stack pages with child
We're requiring stack pages to have a child
at construction time now. Make it so!
2022-07-13 15:03:05 +01:00
Emmanuele Bassi
9eb6de403f stack: Assert that StackPage:child is set
Childless GtkStackPage instances are not allowed, otherwise everything
falls apart in random places.
2022-07-13 15:03:05 +01:00
Matthias Clasen
775435c025 Merge branch 'check-button-s-ancestry' into 'main'
print: Check button is not descendant of toggle button

See merge request GNOME/gtk!4864
2022-07-13 11:20:57 +00:00
Matthias Clasen
24f31b6797 Merge branch 'empty_list_adjustment' into 'main'
listviews: Reset scrollbar adjustment when list is empty

Closes #4370

See merge request GNOME/gtk!4865
2022-07-13 11:17:07 +00:00
JCWasmx86
af5f75aa77 textview: Include gutter while computing child allocations
The width of the left gutter and the height of the top gutter
are now used while computing the child allocations for e.g.
anchors, otherwise - if such a gutter is present - the
widget would be at the wrong position.

Closes #5016
2022-07-13 07:02:55 +02:00
Corey Berla
94673707e6 listviews: Reset scrollbar adjustment when list is empty
In a list with a visible scrollbar, the scrollbar usually becomes
invisible when the numbers of items is less than the required amount
to scroll.  If, however, the list is emptied all at once,
the scrollbar remains.  This happens because when there's an empty
list gtk_list_view_size_allocate() returns early before the scrollbar
adjustment is updated.

Given that the list is empty, simply reset the adjustment values
to zero.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4370
2022-07-12 12:54:35 -07:00
Marek Kasik
e204910730 print: Check button is not descendant of toggle button
GtkCheckButton is not derived from GtkToggleButton anymore.
This caused some issues in GtkPrinterOptionWidget which
did not port handling of the button.
2022-07-12 16:22:59 +02:00
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