Commit Graph

31022 Commits

Author SHA1 Message Date
Benjamin Otte
5bf009a203 cssrbtree: Fix a crasher
After removing elements, there were a few cases where the tree wasn't
properly balanced which could further down violate assumptions about the
layout.

Attached is the original testcase that triggered it. I didn't bother
simplifying it.
2018-09-19 04:31:29 +02:00
Benjamin Otte
60cb315be6 Merge branch 'revealer-support-min-size-master' into 'master'
gtkrevealer: support minimum size of child

Closes #635

See merge request GNOME/gtk!317
2018-09-18 15:19:12 +00:00
Carlos Soriano
57ef793e6d revealer: Support minimum size of child
Up until now when allocating the child it only used the natural size
while the measuring also used the minimum size, resulting in a clipped
child when animating if the child had different minimum size and
natural size. This was an obvious case when using labels that had
ellipsization.

This commit gives full allocation to the child by inverting the size
the revealer reduces from its animation progress.

Code done by Benjamin Otte.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/635
2018-09-18 11:36:29 +02:00
Benjamin Otte
2c84049769 treelistmodel: Improve naming a bit
The complexity with model items vs row items is really confusing. Add to
that treelistmodel position vs child model position vs parent position,
and you're so confused, even the best naming can't help.

And once you're there, consider passthrough vs non-passthrough...
2018-09-18 08:03:03 +02:00
Benjamin Otte
29c700d1c7 listmodels: Clarify documentation for function prototypes
Fixes #1341
2018-09-18 08:02:21 +02:00
Mohammed Sadiq
0d7c987b1a Revert "listlistmodel: Fix documentation comment"
This reverts commit 03679d4342.

listlistmodel is private
2018-09-18 10:01:12 +05:30
Mohammed Sadiq
03679d4342 listlistmodel: Fix documentation comment 2018-09-18 09:56:19 +05:30
Georges Basile Stavracas Neto
1a4b60fb36 tree-list-model: Return the correct item type
When passthrough is enabled, it should return the GType
of the child GListModels; when disabled, it should be
GTK_TYPE_TREE_LIST_ROW.

The conditions are inverted however, causing a few
warnings to trigger.

Fix that by returning the correct GType.
2018-09-18 00:51:57 -03:00
Mohammed Sadiq
f211d71f74 treelistmodel: Fix memory leak
gtk_tree_list_model_init_node() increases the reference count
of the model passed. Let's not do that, and let it take the
model passed.
2018-09-18 07:50:44 +05:30
Mohammed Sadiq
9e3e9e83ef treelistmodel: Fix signal emission on row destroy 2018-09-18 07:11:27 +05:30
Rico Tzschichholz
f3e6d00db1 gtk: Fix some g-i annotations warnings 2018-09-17 13:00:36 +02:00
Robert Ancell
c8a13a2d8a toolbar: Use hexpand/vexpand Gtk+ properties 2018-09-17 10:25:59 +02:00
Matthias Clasen
231b76bdd1 tree list model: Add docs 2018-09-16 23:07:00 -04:00
Matthias Clasen
57ba4048de Minor doc fix
Clarify some wording.
2018-09-16 23:07:00 -04:00
Benjamin Otte
b92c328425 sortlistmodel: Actually insert unsorted items at the wrong place
We were adding items in reverse order, oops.
2018-09-17 03:57:37 +02:00
Benjamin Otte
9ffd88012d docs: Add missing TreeListModel docs 2018-09-16 19:39:39 +02:00
Benjamin Otte
b7bf04fabd inspector: Update the controllers list to show parent controllers
Now we show all the controllers that are relevant when widget gets sent
events.
2018-09-16 18:50:17 +02:00
Benjamin Otte
f3834138f7 GtkSortListModel: Add 2018-09-16 18:50:17 +02:00
Benjamin Otte
64d97b233b GtkSliceListModel: add 2018-09-16 18:50:17 +02:00
Benjamin Otte
db8474e5b1 inspector: Make controllers page use gtk_list_box_bind_model() 2018-09-16 18:50:17 +02:00
Benjamin Otte
5e8983883e inspector: Rename "Gestures" page to "Controllers"
And rename GtkInspectorGestures => GtkInspectorControllers, too.
2018-09-16 18:50:17 +02:00
Benjamin Otte
59006e2e03 inspector: Make gestures page handle all controllers
This requires removing support for gesture groups.
2018-09-16 18:50:17 +02:00
Benjamin Otte
b6acc31d44 GtkMapListModel: add 2018-09-16 18:50:17 +02:00
Benjamin Otte
6d0fe46cba propertylookuplistmodel: Add
This model just takes an object and a property name and recursively
looks it up. In particular, I want it for:

widget, widget.parent, widget.parent.parent, ...
2018-09-16 18:50:17 +02:00
Benjamin Otte
05e752e096 inspector: Turn object tree into a GtkListBox
The code gets rid of the GtkTreeView and replaces it with a GtkListBox.

Most of the logic is now done via GListModel subclasses.

A big change is that this new list is now tracking updates itself and
doesn't need to be manually updated. All code that used to cause rescans
or add forgotten objects to the tree has been removed.

If objects are missing from the object tree, the logic for tracking them
needs to be added.
2018-09-16 18:50:17 +02:00
Benjamin Otte
417ac4ab43 inspector: Use a GtkPicture to display render nodes
Instead of the outdated render node view, use modern GTK APIs.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4495eaae84 inspector: Add an icon to the render node list 2018-09-16 18:50:17 +02:00
Benjamin Otte
aba76fe8e9 inspector: Make the render node tree use a ListBox
It used to be a treeview.
2018-09-16 18:50:17 +02:00
Benjamin Otte
867042f88f widget: Add gtk_widget_observe_controllers()
This mirrors gtk_widget_observe_children() - just that it observes the
controllers, not the children.
2018-09-16 18:50:17 +02:00
Benjamin Otte
32ec7dec61 gtk: Add GtkFlattenListModel
We can flatten lists of lists into lists now!
2018-09-16 18:50:17 +02:00
Benjamin Otte
d6161e09cd treelistmodel: Add more API to navigate the tree
This adds functionality from GtkTreeIter into GtkTreeListRow that allows
finding items in the model and getting their position for use in
GtkListBox.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4b5fb5ec79 treelistmodel: Refactor to add GtkTreeListRow
This patch does multiple things:

1. Add a custom persistent per-row object.
2. Move all per-row API to that object. This means notifications are now
   possible.
3. Add a "passthrough" construct-only property to the TreeListModel that
   influences if the model returns these new object or passes through
   the ones from the model.

This greatly simplifies the code needed to be written for widgetry,
because one can just connect the per-row object to the expanders that
expand and collapse rows.

As an added power feature, these objects can also be passed through
further models (like filter models).

It also adds kind of a hack to Adwaita to make the test look neat.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4f70f72349 gtk: Add GtkFilterListModel
This is a GListModel implementation that filters the given source model.
2018-09-16 18:50:17 +02:00
Benjamin Otte
dd94129e27 widget: Add gtk_widget_observe_children()
This creates a listmodel that tracks a widget's children. Doing so turns
adding/removing children from O(1) to O(N) though, so use with caution.
2018-09-16 18:50:17 +02:00
Benjamin Otte
63e5b827ed window: Add gtk_window_get_toplevels()
This one returns a list of all toplevel windows.
2018-09-16 18:50:17 +02:00
Benjamin Otte
573c63973a gtk: Add GtkTreeListModel
This is a GListModel implementation with a neat API that can be used to
implement trees inside GtkListBox.
2018-09-16 18:50:17 +02:00
Matthias Clasen
d7a5dcba0b gtk_application_inihit: allow no reason
We document this argument as nullable, so treat it as such.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1327
2018-09-13 23:31:48 -04:00
Jakub Steiner
0edec9bcae Merge branch 'adwaita-fixes' into 'master'
Adwaita fixes

See merge request GNOME/gtk!333
2018-09-10 14:29:54 +00:00
Adrien Plazas
7d12a843f2 Adwaita: Set selection mode to headerbars if it's on ancestors
This allows to set the container of the headerbars in selection mode
rather than having to set the mode to each element of the title bar.
2018-09-10 15:51:12 +02:00
Adrien Plazas
867efe2e33 Adwaita: Style separator.sidebar
Let separators be declared as sidebars to have the same style as those
drawn by GtkStackSidebar. This also let them handle the selection-mode
class, whether they are assigned it or they descend from something in
selection mode.

Also drop setting the selection mode color for non-sidebar separators.

This is convenient when building a custom sidebar using a GtkSeparator
and to extend a sidebar to the title bar.
2018-09-10 15:50:43 +02:00
Adrien Plazas
a121bfa7ec Adwaita: Drop the background of nested headerbars
This is needed to work around headerbar sliding animation issues without
refactoring Adwaita's support of titlebars and headerbars as it may
break applications.

https://gitlab.gnome.org/GNOME/gtk/issues/1264
2018-09-10 15:49:37 +02:00
Jakub Steiner
02758cd48d Merge branch 'wip/adwaita/linked-entry-error-state-fix-master' into 'master'
Adwaita: Fix linked elements in error state

See merge request GNOME/gtk!315
2018-09-10 10:47:05 +00:00
Peter Simonyi
4e8c06eb7a win32 theme: Fix css syntax error 2018-09-07 08:31:22 -04:00
Matthias Clasen
ae2c765ffd Fix portal path handling
This was broken when I recently introduced this helper
function.
2018-09-05 19:54:32 -04:00
Benjamin Otte
ab9455ea1b rendernodepaintable: Fix clipping
We need to translate before clipping, otherwise we clip in totally the
wrong place.
2018-09-05 16:25:07 +02:00
Benjamin Otte
89522e6923 iconhelper: Fix drawing of empty and paintable helpers
Empty helpers did try to draw a NULL paintable (not good) and in the
non-null case code used the wrong width/height.
2018-09-05 06:34:32 +02:00
Lennart Buhl
272e4a0a9d Minor fixes in documentation of gtkbbox 2018-09-03 19:53:16 +02:00
Alex Monday
3e5746356e themes: Fix linked elements in error state
Add instructions for color of linked elements border which ajoints
entry, when parent linked entry is in error state.
2018-09-02 14:48:53 +05:00
Daniel Boles
c9f1c56776 Adwaita: Regenerate CSS to get window.devel styles
This step was missed before, again.

SASS 3.6 emits rgba(0, 0, 0, 0) instead of transparent, so it wants to
change those too, but that patch was only committed in March and isn't
being backported to the previous stable, so I don't know if others'
versions will do the same - so until it's shown that anyone else (A) is
regenerating CSS and (B) also has 3.6, I'm skipping those changes. See:
c287f312ac
2018-09-02 09:27:38 +01:00
Matthias Clasen
2bb97bc136 GtkApplication: Improve the docs
Expand the docs for ::register-session a bit.
2018-08-31 13:38:01 -04:00