Commit Graph

1556 Commits

Author SHA1 Message Date
Matthias Clasen
5a3cf5a194 constraints editor: Stop naming constraints
We don't have a field for the name in ui files,
so stop naming constraints.
2019-07-02 10:03:48 -04:00
Matthias Clasen
c5e1b00994 constraint editor: Implement saving
Save to a ui file.
2019-07-02 10:03:48 -04:00
Matthias Clasen
377f0c1a0a constraint editor: Use name properties 2019-07-02 10:03:48 -04:00
Matthias Clasen
a442e6e8de constraint editor: Use the list models
Instead of handrolling our own list models,
use the ones provided by GtkConstraintLayout.
2019-07-02 10:03:48 -04:00
Matthias Clasen
b2f15a622d Merge branch 'wip/ebassi/constraint-layout' into 'master'
Add constraint-based layout manager

Closes #1090

See merge request GNOME/gtk!973
2019-07-02 14:01:01 +00:00
Daniel Boles
33bd7051f2 widget-factory: Use correct StyleProvider priority
We are an application, not a user.

cherry-pick of !974
2019-07-02 09:09:47 +01:00
Matthias Clasen
48e6cd4255 constraint editor: Allow dragging children
We add a weak constraint for the position
and update it as the widget is dragged.
2019-07-01 04:24:26 +00:00
Matthias Clasen
670fc5bb94 constraint editor: Enable max size for guide
Also, use the apis we have now, and make the
spin buttons display 'unset' values as such.
2019-07-01 02:23:39 +00:00
Matthias Clasen
514de0b91a Add a constraint editor demo
This is an initial cut at providing a tool
for interactive exploration of constraints.
2019-07-01 00:10:11 +01:00
Matthias Clasen
a9dfca04e4 constraint guide: Make strength tweakable
The strength for the natural width can be used
as a tie-breaker to make instable systems behave
in a more predictable way. This can be seen
in the simple constraints demo in gtk-demo.
2019-07-01 00:10:11 +01:00
Matthias Clasen
71b52f485e constraints demo: Update comments 2019-07-01 00:10:11 +01:00
Matthias Clasen
5a019bfccd constraints demo: Give space a name
Lets call it 'space'.
2019-07-01 00:10:11 +01:00
Matthias Clasen
47237d32eb demo: Use constraint guide api
Use proper api to create and set up
the guide, and also try max-width.
2019-07-01 00:10:11 +01:00
Emmanuele Bassi
06c825df90 Add a C convenience function for VFL constraints
The dictionary-based function is convenient for language bindings, but C
developers will feel more at home with a variadic arguments list.
2019-06-30 23:42:45 +01:00
Emmanuele Bassi
46430ea85b Add Constraints/VFL demo
Shows how to describe constraints using VFL instead of constructing
objects manually.
2019-06-30 23:42:45 +01:00
Matthias Clasen
ba2125d8e1 Add an interactive constraints demo 2019-06-30 23:42:44 +01:00
Matthias Clasen
7c96326c18 Make the constraints demo more interesting
Add a max size to the buttons, to force the
space to open up.
2019-06-30 23:42:44 +01:00
Matthias Clasen
38d353dc1a Add GtkConstraintGuide
This is meant to be a flexible space.
2019-06-30 23:42:44 +01:00
Emmanuele Bassi
636fbc0f1a Add GtkConstraintLayout demo 2019-06-30 23:42:44 +01:00
Matthias Clasen
fcf92eb6e7 widget-factory: Redo the context menu example
Redo the context menu on the page1 text view in
terms of actions.
2019-06-13 11:59:51 +00:00
Matthias Clasen
441a9dfa80 gtk-demo: Rewrite the search entry demo
Port this from ::populate-popup to the new context
menu api. At the same time, fix some parts of the demo
that were broken since it was changed to use GtkStearchEntry.
2019-06-13 11:59:50 +00:00
Matthias Clasen
17ec958f30 Rename GtkPopoverBar to GtkPopoverMenuBar
Clarity over beauty.
2019-06-09 17:42:07 +00:00
Matthias Clasen
f1eb0724bd widget-factory: Move the popover bar to the ui file 2019-06-09 17:38:54 +00:00
Matthias Clasen
3d56a89506 widget-factory: Don't use Return as accel
This is a bad idea, as it interacts badly with
general use of Return for activation.
2019-06-09 17:38:54 +00:00
Matthias Clasen
d48a8fddab widget factory: Add mnemonics in popovers
These don't work!
2019-06-09 17:38:54 +00:00
Matthias Clasen
4d191aa0b5 widget factory: Redo the menubar with a model
No UI change intended, except for the fact that
actions don't do inconsistent states for checks
and radios.
2019-06-09 17:38:54 +00:00
Matthias Clasen
609f1659bd Rationalize popover menu apis
Make gtk_popover_new_from_model() return a GtkPopoverMenu,
rename it to gtk_popover_menu_new_from_model() and add
a relative_to argument to gtk_popover_menu_new().

Update all callers.
2019-06-09 17:38:54 +00:00
Matthias Clasen
0755491b77 widget factory: Add a context menu example
This is also taken from
https://gitlab.gnome.org/Teams/Design/os-mockups/blob/master/menus/menu-design-patterns.png
2019-06-09 17:38:53 +00:00
Matthias Clasen
06470c2378 widget factory: Improve manual popover menu example
Set up the size group, so things line up.
2019-06-09 17:38:53 +00:00
Matthias Clasen
84243d0f55 widget-factory: Redo the new-style menu
Do this from a menu model first, since that
is easier to get right.
2019-06-09 17:38:53 +00:00
Matthias Clasen
b4aac42605 widget-factory: Add another popover menu example
This one is taken from
https://gitlab.gnome.org/GNOME/gtk/issues/1824
2019-06-09 17:38:53 +00:00
Matthias Clasen
1a93ab053c Add a theme loading benchmark 2019-06-05 04:20:31 +00:00
Benjamin Otte
098f182d8f widget-factory: Show proper separators 2019-06-04 06:11:44 +02:00
Benjamin Otte
6b1cfd0bca gtk-demo: Fix sliding puzzle demo
1. Menubuttons aren't buttons

2. For paintables without aspect ratios, use 1.0
2019-05-31 05:36:44 +02:00
Matthias Clasen
d691393f5f Merge branch 'wip/baedert/nodeeditor-fuckery' into 'master'
node editor: Add a quick way to save a testcase

See merge request GNOME/gtk!880
2019-05-30 03:28:41 +00:00
Matthias Clasen
90f330e27a Merge branch 'gesture-click' into 'master'
Rename GtkGestureMultiPress to GtkGestureClick

See merge request GNOME/gtk!878
2019-05-29 18:39:09 +00:00
Timm Bäder
3874f37395 node editor: Add a quick way to save a testcase 2019-05-29 20:30:21 +02:00
Matthias Clasen
4f9c1bf14e gtk-demo: Stop using gtk_window_set_position
This api is going away.
2019-05-29 18:04:08 +00:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
37f8df2722 fishbowl: Don't pop up popovers too early
Wayland does not like this.
2019-05-28 20:25:17 +00:00
Matthias Clasen
7447abb52b Stop using gtk_widget_get_toplevel
All uses of it can be replaced by gtk_widget_get_root.
2019-05-28 20:25:16 +00:00
Matthias Clasen
948347afa9 Stop using gtk_widget_is_toplevel 2019-05-28 20:25:16 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
25aef96d5d popover: Rename modal to autohide
This is the term we use for the surface,
and it matches the behavior a bit better
than modal.

Update all callers.
2019-05-28 20:25:15 +00:00
Matthias Clasen
18788c2a86 Remove gtk_widget_get/set_has_surface
These serve no purpose anymore - widgets don't
have surfaces, unless they're a GtkNative.
2019-05-28 20:25:15 +00:00
Matthias Clasen
c1d5e82d95 Use GtkNative APIs instead of GtkRoot 2019-05-28 20:24:39 +00:00
Matthias Clasen
e95e39cbd3 widget-factory: Add some animation in a popover 2019-05-24 07:44:21 -04:00
Matthias Clasen
63f6aca1cf fishbowl: Add a menubutton demo
This reveals some issues with the position tracking.
2019-05-24 00:31:07 +00:00
Matthias Clasen
018795127e fishbowl: Fix the lock button 2019-05-24 00:13:03 +00:00
Matthias Clasen
e2fc00222e fishbowl: Don't show ridiculous precision
Two decimals are more than enough for the frame rate.
2019-05-23 12:38:57 +00:00
Matthias Clasen
d0137ef627 gtk-demo: Reinstate flat menu buttons 2019-05-21 19:05:41 -04:00
Matthias Clasen
4594d82b14 widget-factory: Reinstate flat menu buttons 2019-05-21 19:05:41 -04:00
Matthias Clasen
fc2dc82b70 gtk-demo: Fix menubutton usage in listbox demo
Menu buttons are no longer buttons, so they
can't have children, and don't have a relief
property.
2019-05-21 00:04:24 +00:00
Matthias Clasen
3030e887a4 widget-factory: menu buttons can't have children
GtkMenuButton is no longer a container, so we
can't pack children in it.
2019-05-19 04:15:49 +00:00
Matthias Clasen
5368f98dd5 demos: Stop using gtk_button_clicked 2019-05-18 14:33:41 -04:00
Matthias Clasen
9d16715eb3 Merge branch 'menubutton-no-button' into 'master'
Menubutton: don't derive from GtkButton

See merge request GNOME/gtk!853
2019-05-18 13:13:48 +00:00
Matthias Clasen
0eb7784785 Update all users for menubutton changes 2019-05-18 13:06:32 +00:00
Timm Bäder
8e9ac826a1 widget-factory: Add icon-dropshadow class to large icon
Looks stupid without the shadow.
2019-05-18 13:47:59 +02:00
Benjamin Otte
4bccd17941 node-editor: Report all errors in tooltip
Don't just report the first one.
2019-05-12 17:27:01 +02:00
Benjamin Otte
0049b39375 node-editor: Don't remove all text tags when saving 2019-05-12 17:27:01 +02:00
Benjamin Otte
9117ee83eb node-editor: Never scale nodes up
Scaling down is fine so one can see the nodes, but scaling up just
makes the nodes wrong for no reason at all.
2019-05-08 19:47:40 +02:00
Timm Bäder
b3c4320bc2 node editor: Do some simple syntax highlighting 2019-05-07 17:21:16 +02:00
Timm Bäder
759a97403c Some node editor improvements 2019-05-06 17:34:48 +02:00
Benjamin Otte
00b947124f node-editor: Add renderings with alternative renderers
That's pretty rough around the edges, but it mostly works.
Apart from sizing, screw listbox sizing.
2019-05-05 07:18:39 +02:00
Benjamin Otte
008b7bc94f Add gtk4-node-editor
It's meant to be a little editor for render nodes so we can do testing
with it.
2019-05-05 07:18:39 +02:00
Matthias Clasen
0d2a7f876b gtk-demo: Make the expander demo behave again
Changes to the dialog hierarchy have affected
this demo, that admittedly pokes at message
dialog internals. Do that some more, to fix
things up.
2019-05-01 21:12:36 +00:00
Matthias Clasen
92e21c3f1c Drop the can-default property
It was added at a time when default buttons
had a very large external border that would disrupt
aligment. Not a problem nowadays.
2019-04-28 23:28:39 +00:00
Matthias Clasen
fe3796ed5b widget-factory: Stop setting has-default in ui files
We can just set the default-widget property. The
special handling for has-default in ui files is
going away.
2019-04-28 23:21:51 +00:00
Matthias Clasen
89f7b974f2 Stop using gtk_widget_grab_default
Replace gtk_widget_grab_default by gtk_window_set_default_widget.
2019-04-28 23:21:51 +00:00
Matthias Clasen
65052a5d6c Rename gtk_window_set_default
Call it gtk_window_set_default_widget, to match
the getter, and the property name. Update all
callers.
2019-04-28 23:20:13 +00:00
Matthias Clasen
aab803b7ae widget-factory: Make a resizing popover
Add an expander to a popover to test how
changing sizes works with popovers.
2019-04-27 18:00:22 +00:00
Matthias Clasen
e1200230c4 widget-factory: Add some nested popovers
These are mainly for stress-testing our
popover implementations.
2019-04-27 17:50:22 +00:00
Matthias Clasen
d3ad816d63 widget-factory: Add non-modal popovers
This makes is easy to test moving the toplevel
or repositioning the parent while the popover
is shown.
2019-04-27 17:50:14 +00:00
Matthias Clasen
bc8ecef605 Merge branch 'icon-browser-tweaks' into 'master'
Icon browser tweaks

See merge request GNOME/gtk!754
2019-04-17 01:19:13 +00:00
Matthias Clasen
e2d821fa59 icon-browser: Left-align the sidebar
The centered labels just look disorderly.
2019-04-16 21:00:47 -04:00
Matthias Clasen
8d001e3573 icon-browser: Recover from GtkDialog api change
When we moved content_area to a sibling of action area,
it changed orientation from vertical to horizontal.
Adapt to this change.
2019-04-16 20:59:57 -04:00
Matthias Clasen
f6afa3d03f gtk-demo: Add a gear menu
Modernize the about dialog, and make it available
from a gear menu, together with a way to bring up
the inspector.
2019-04-16 20:34:59 -04:00
Matthias Clasen
f4e32f29e1 widget-factory: Update copyright line
Update the years to 2019, and use some better typography.
2019-04-16 18:09:46 -04:00
Matthias Clasen
226e0eadf0 widget-factory: Add an Inspector menu item
Just because we can.
2019-04-16 18:06:12 -04:00
Benjamin Otte
44ce36bef5 menubar: Remove pack direction 2019-04-15 14:38:23 +02:00
Emmanuele Bassi
f39ae35e4b demo: Ignore deprecated HarfBuzz API
We should avoid warnings just because we're building against bleeding
edge HarfBuzz.
2019-04-13 14:30:09 +01:00
Benjamin Otte
a8f712b09a cssection: Return locations, not numbers
Now that we have GtkCssLocation, actually use it.
2019-04-12 19:34:28 +02:00
Benjamin Otte
a938c14d11 build: Add gtk-css static library
This library is meant to be the new CSS library that gets used from GDK,
GSK and GTK for string printing and parsing.

As a first step, move GtkCssProviderError into it.

While doing so, split it into GtkCssParserError (for critical problems)
and GtkCssParserWarning (for non-critical problems).
2019-04-12 19:34:28 +02:00
Matthias Clasen
ef982b7d46 Rename things
Rename the can-pick property to can-target,
and redo the pick flags with more descriptive names.
2019-04-08 08:42:25 -04:00
Matthias Clasen
b804235aea Add a flags argument to gtk_widget_pick
This will be used to let the inspector and other users
pick insensitive widgets again. For now, update all
callers to pass no flags, preserving the current
behavior.
2019-04-07 17:19:09 +00:00
Matthias Clasen
7f6213291d gtk-demo: Stop using child properties 2019-04-05 12:01:43 +00:00
Matthias Clasen
69d4081ff8 Merge branch 'wip/ebassi/grid-layout' into 'master'
Implement GtkGridLayout

See merge request GNOME/gtk!714
2019-04-05 02:42:55 +00:00
Emmanuele Bassi
31b65e6721 demos: Update GtkGrid definitions in UI files 2019-04-05 00:12:26 +01:00
Carlos Garnacho
edccf89020 icon-browser: Drop usage of gtk_search_bar_handle_event()
Make it capture key events from the toplevel.
2019-04-03 13:23:34 +02:00
Matthias Clasen
e720006110 gtk-demo: Don't expand tabs
It is a little irritating to see super-wide
tabs in demos which have just one extra file,
such as "Fixed layout".
2019-04-02 21:32:14 +00:00
Emmanuele Bassi
c70c677b5a Add GtkFixed demo
This demo has everything:

 - a GtkFixed inside another GtkFixed
 - a cube made out of GtkFrame widgets
 - an example of 3D transformations

And what's there, in the window once I launch it? The GTK logo made of
widgets.
2019-04-02 20:52:49 +01:00
Matthias Clasen
998c1f83a6 icon-browser: Rename to org.gtk.IconBrowser4 2019-04-02 00:27:33 +00:00
Matthias Clasen
41bb875221 widget-factory: Rename to org.gtk.WidgetFactory4 2019-04-02 00:27:33 +00:00
Matthias Clasen
365400c13e gtk-demo: Rename to org.gtk.Demo4 2019-04-02 00:27:32 +00:00
Matthias Clasen
19d9d69343 icon-browser: Fix name alignment
The icon names were left-aligned, not centered
under the icon.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/18
2019-04-01 00:27:58 -04:00
Benjamin Otte
9d0a42dc14 stack: Add a cube spin transition
Add a transition to GtkStack that pretends pages
are the sides or a cube, and switch them by
rotating the cube.

Use this transition in widget-factory.
2019-03-29 10:03:18 -04:00
Emmanuele Bassi
3d6a456c85 Add release info to our demo apps
The appstream-util check performed by Flatpak on recent GNOME SDKs has
become more stringent, and now it requires a <release> tag in the
AppData XML file. If we don't have it, the Flatpak bundles of gtk-demo
and gtk-widget-factory will fail on our CI infrastructure.
2019-03-28 12:16:53 +00:00
Matthias Clasen
6b050a277e Convert ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 20:03:59 -04:00
Matthias Clasen
e5722367b3 Merge branch 'fixed-layout' into 'master'
Add GtkFixedLayout

See merge request GNOME/gtk!668
2019-03-27 18:51:04 +00:00
Matthias Clasen
7ac250dea7 Convert all ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 13:36:24 -04:00