summaryrefslogtreecommitdiff
path: root/gtk/gtkconstraintlayout.c
Commit message (Collapse)AuthorAgeFilesLines
* Drop gtkintl.hMatthias Clasen2022-09-241-1/+0
| | | | | Include gtkprivate.h for I_() and glib-i18n.h for gettext macros.
* gtk: Use the new debug macrosMatthias Clasen2022-09-231-9/+6
|
* docs: Fix wrong fragments in type linksEmmanuele Bassi2021-11-071-5/+5
| | | | | | | Due to a bug in gi-docgen we're not getting a warning if a fragment to a type does not match the actual type, and we're generating a broken link. See: https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/120
* gtk: Clean up docs syntaxMatthias Clasen2021-05-221-3/+3
| | | | Replace leftover gtk-doc syntax (#Type) with backquotes.
* constraintlayout: Convert docsMatthias Clasen2021-03-111-20/+24
|
* docs: Start porting GtkConstraintLayout to the new doc formatEmmanuele Bassi2021-03-111-75/+77
| | | | Drop the old gtk-doc'isms, and use the gi-docgen links instead.
* constraintlayout: Fix parsing of constant constraintsMatthias Clasen2020-11-171-6/+6
| | | | | | We were inadvertently turning constant constraints into constraints against super, due to confusion between target and source attribute.
* constraintlayout: Make sure guides get their constraintsMatthias Clasen2020-10-301-0/+3
| | | | | | | | | | | When using GtkBuilder to create constraints and guides, the layout manager is already rooted when the guides get created, and we were forgetting to create the guides constraints in this case. Fix it by adding a call to gtk_constraint_guide_update(). This was showing up in the new builder-based constraints demo as the guide not having the expected effect.
* constraintlayout: Emit less change notificationMatthias Clasen2020-10-301-1/+6
| | | | | | | This isn't strictly required for correctness, but it makes the GtkBuilder codepath do the same that the vfl codepath does: call gtk_layout_manager_layout_changed only once, after all the constraints have been added.
* constraintlayout: Fix parsing from ui fileMatthias Clasen2020-10-301-5/+39
| | | | | Guides were not properly looked up when creating constraints in a ui file.
* docs: Fix several missing references in the documentationCorentin Noël2020-05-111-1/+1
| | | | This fixes several typos and missing references
* Annotate more functions returning GListModelEmmanuele Bassi2020-04-281-4/+4
| | | | | Now that we can have an element-type annotation, we should use it where needed.
* Fix message for VFL parser errorsEmmanuele Bassi2020-03-111-8/+1
| | | | | The loop is iterating over the wrong variable, and it's reimplementing g_strfill() in a less efficient way.
* Use the new GtkBuildableParser type in GtkBuildable interfacesAlexander Larsson2019-09-101-17/+17
|
* constraint layout: Provide list modelsMatthias Clasen2019-07-021-0/+128
| | | | | | Provide list models for the constraints and guides, so we can show them in the inspector, and use them in e.g. the constraints editor.
* Add custom parser for guides defined in GtkBuilder UI filesEmmanuele Bassi2019-07-011-0/+160
| | | | Like we describe constraints, we can also define guides.
* Implement GtkBuildable for GtkConstraintLayoutEmmanuele Bassi2019-07-011-2/+438
| | | | | Using GtkBuildable we can provide a custom parser for reading constraints defined in a GtkBuilder UI file.
* Use explicit values for constraint strengthEmmanuele Bassi2019-07-011-19/+19
| | | | | | | | | | | | | | | | | | Instead of playing games with mapping negative symbolic values to positive ones, let's use the appropriate constants everywhere. This allows us to use: GTK_CONSTRAINT_STRENGTH_WEAK * 2 Or GTK_CONSTRAINT_STRENGTH_STRONG + 1 In code using the public API. We also store the strength values as integers, so we can compare them properly, and only turn them into doubles when they are inserted into the solver, just like every other variable.
* Documentation fixesMatthias Clasen2019-07-011-3/+4
| | | | | Make sure all types show up in the docs, and misc other improvements.
* constraint layout: go back to keeping constraintsMatthias Clasen2019-07-011-45/+69
| | | | | | We want to minimize changes to the solver, so keep the size constraints around and only update them when the size changes.
* constraint layout: Use stronger force for min sizeMatthias Clasen2019-07-011-2/+2
| | | | | We want our edit constraint to be strong enough to overpower nat. size constraint, therefore use STRONG * 2.
* Fix warnings from the introspection scannerEmmanuele Bassi2019-07-011-21/+21
| | | | | The name of the arguments of the functions must match the name of the arguments in the documentation stanza.
* Move the VFL error domain to a public headerEmmanuele Bassi2019-07-011-0/+6
| | | | | Since the public API will use it to fill out GErrors, it needs to be publicly available.
* Mark the layout as changedMatthias Clasen2019-07-011-0/+2
| | | | | We should mark the layout as changed when constraints are added or removed.
* constraint layout: Dont reset constraints in allocateMatthias Clasen2019-07-011-67/+0
| | | | | If trust our allocation algorithm, this can never trigger (and in fact, it never does).
* constraint layout: freeze/thaw on mass opsMatthias Clasen2019-07-011-0/+6
| | | | | | In measure and allocate we are potentially changing quite a few constraints. Don't optimize at every step.
* constraint layout: Measure min/nat size separatelyMatthias Clasen2019-07-011-18/+20
| | | | | | | | Only constraint the opposite direction if we actually have a for_size, and measure natural size after removing the edit constraints. With these changes, the test that compares constraint layout to grid layout passes.
* constraint layout: Use stays for natural sizeMatthias Clasen2019-07-011-20/+16
| | | | | | | It makes more sense to treat the natural size of both children and guides as stays, since we want to meet these values as closely as we can, under the circumstances.
* constraint layout: Add debug output for guidesMatthias Clasen2019-07-011-0/+24
| | | | | | | Print out the allocation we end up giving to guides. This helps in making sense of the allocations of the child widgets that these guides relate to.
* constraint layout: Measure more correctlyMatthias Clasen2019-07-011-9/+7
| | | | | | | | | Set up all constraints for minimum + natural width + height when measuring, regardless of the orientation we're measuring. Anything else will lead to incorrect answers when there are constraints that cut across dimensions.
* Flesh out GtkConstraintGuideMatthias Clasen2019-07-011-348/+76
| | | | | | | This commit moves GtkConstraintGuide into its own source files to avoid gtkconstraintlayout.c turning too messy, adds max size properties and implements getters and setters.
* Drop an indirectionMatthias Clasen2019-07-011-46/+30
| | | | | | This struct is not really useful for just a single hash table, and it gets in the way of moving the guide code to its own file.
* Detach guides on unrootMatthias Clasen2019-07-011-4/+31
| | | | We don't want to leave constraints behind.
* Simplify the guide implementationMatthias Clasen2019-07-011-194/+73
| | | | | | Store the values and constraints in arrays, to facilitate treating them uniformly.
* Return the list of constraints added via VFL descriptionEmmanuele Bassi2019-07-011-15/+20
| | | | Otherwise it's impossible to remove them.
* Add method to remove all constraints from a layoutEmmanuele Bassi2019-07-011-0/+26
|
* Add a C convenience function for VFL constraintsEmmanuele Bassi2019-06-301-10/+87
| | | | | The dictionary-based function is convenient for language bindings, but C developers will feel more at home with a variadic arguments list.
* Allow adding constraints described through VFLEmmanuele Bassi2019-06-301-1/+218
|
* Add GtkConstraintGuideMatthias Clasen2019-06-301-58/+527
| | | | This is meant to be a flexible space.
* Redefine constraints with GtkConstraintTargetMatthias Clasen2019-06-301-1/+1
| | | | | This is in preparation for allowing non-widgets to act as constraint targets.
* Notify a layout change when adding and removing constraintsEmmanuele Bassi2019-06-301-0/+4
| | | | Changing the set of constraints should cause a relayout.
* Fix the opposite size measurement in GtkConstraintLayoutEmmanuele Bassi2019-06-301-62/+52
| | | | | | | | | We cannot use the given "for size" when querying our children, because the constraint layout has no idea about the opposite size of its children until the layout is complete. Additionally, we should only suggest an opposite size for the layout if we have one, instead of suggesting a weak zero size.
* Remove size constraints from ConstraintLayoutChildEmmanuele Bassi2019-06-301-52/+48
| | | | | | The size constraints are transient to measurement and allocation, so they don't really need to be stored inside the GtkLayoutChild subclass created by a GtkConstraintLayout.
* constraints: Make internal consistency requiredMatthias Clasen2019-06-301-2/+2
| | | | | | | | | | The relations between left, right, width and top, bottom, height are required for internal consistency. It doesn't make sense to ever drop these. Changing the strength of these relations makes my systems behave much more stable.
* Add gtk_constraint_layout_remove_constraintMatthias Clasen2019-06-301-0/+20
| | | | Otherwise, you can't do many interesting things.
* Add GtkConstraintLayoutEmmanuele Bassi2019-06-301-0/+1108
A layout manager using GtkConstraintSolver to measure and allocate children.