Commit Graph

1609 Commits

Author SHA1 Message Date
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
Emmanuele Bassi
dd5c981b63 Use GtkFixedLayout in GtkFixed
Drop the child properties and the sizing code.
2019-03-26 18:15:13 +00:00
Matthias Clasen
34e859a5bc Add a tagged entry demo
This can serve as an example for how composite entries
can now be done outside of GTK, easily.
2019-03-15 13:21:26 -04:00
Matthias Clasen
5822a35087 gtk-demo: Show password peek icon 2019-03-14 20:43:15 -04:00
Matthias Clasen
f5e112fd2d gtk-demo: Add a password entry demo 2019-03-14 18:55:51 -04:00
Benjamin Otte
ad5c5d477e revealer: Add swing transitions
And make the revealer on page 2 of the widget-factory use one.
2019-03-07 15:06:12 +01:00
Matthias Clasen
8ceff21497 gtk-demo: Minimally fix the sarch entry demo
This was broken by the entry refactoring.
2019-03-03 12:43:00 -05:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Matthias Clasen
09fea73a40 gtk-demo: Stop using gdk_surface_get_user_data
Use gtk_root_get_for_surface instead.
2019-02-23 22:24:50 -05:00
Matthias Clasen
8d93321461 gtk-demo: Stop using ::hierarchy-changed
We can use root and unroot instead.
2019-02-23 09:43:57 -05:00
Matthias Clasen
f202707210 gtk-demo: Use gtk_widget_set_can_pick
Use gtk_widget_set_can_pick instead of
overlay-specific functions with the same purpose.
2019-02-21 21:55:56 -05:00
Matthias Clasen
d291dff0ac gtk-demo: Fix the decorative overlay example
The decorations are appearing as 16x16, which is not
the intention. Use a GtkPicture instead.
2019-02-21 19:38:58 -05:00
Matthias Clasen
b70cd64d6d gtk-demo: Move the blur demo code here
We want to remove this from the GtkOverlay code.
2019-02-21 19:31:41 -05:00
Benjamin Otte
407307c7e4 puzzlepiece: Use new snapshot transforms 2019-02-21 19:47:28 +01:00
Matthias Clasen
b1fe5d8f1f gtk-demo: Fix fallout from the notebook page merge
I have overlooked a few places where the child properties
were used. Sorry.
2019-02-21 11:13:53 -05:00
Matthias Clasen
ddea11b7b8 widget-factory: Use notebook pages in the ui file
This is the new way of doing things.
2019-02-21 00:31:17 -05:00
Matthias Clasen
0e11944166 widget-factory: Don't set can-focus on entries
The focus needs to be on the text inside, now.
2019-02-19 00:25:59 -05:00
Matthias Clasen
a0454e4025 gtk-demo: Make the delayed search demo work
Make this demo work with the new search entry.
2019-02-19 00:25:59 -05:00
Matthias Clasen
82fdd483d2 Add a missing icon
The view-refresh-symbolic icon is used in the data list
of the inspector. So ship it in gtk. No need to have
it in the demos, then.
2019-02-13 12:49:31 -05:00
Matthias Clasen
ffc7a81f84 gtk-demo: Include our own icons
Add enough icons as resources that gtk4-demo
works without an installed icon theme.
2019-02-12 21:37:02 -05:00
Matthias Clasen
5f73d527ec stack demo: Use the proper icon name
The gtk-demo logo was renamed. Follow suit.
2019-02-12 21:37:02 -05:00
Matthias Clasen
93514b474f sidebar demo: Use an existing icon
The help-about icon is legacy and not available in large sizes.
Just use the gtk-demo logo.
2019-02-12 21:37:02 -05:00
Matthias Clasen
ce5f198c93 widget-factory: Include our own icons
Add enough icons as resources that gtk4-widget-factory
works without an installed icon theme.
2019-02-12 21:37:02 -05:00
Matthias Clasen
220ccaf363 gtk-demo: Fix fishbowl setup
The fishbowl demo was failing to reset a static variable
when setting up, causing it to crash the second time around.

Closes: #1665
2019-02-11 08:51:13 -05:00
Matthias Clasen
317b9e638c gtk-demo: Fix the sidebar demo
It was still using child properties.
2019-02-10 18:43:59 -05:00
Timm Bäder
bee51835c4 demo: Fix fishbowl default togglebutton state 2019-02-10 16:42:17 +01:00
Matthias Clasen
131c225598 Merge branch 'wip/jimmac/app-icons' into 'master'
Wip/jimmac/app icons

Closes #1658

See merge request GNOME/gtk!572
2019-02-09 15:09:59 +00:00
Matthias Clasen
a72b91ec94 Fix icon installation
This makes the apps pick up their awesome new icons.
2019-02-08 21:38:14 -05:00
Matthias Clasen
e0dac3ab73 widget-factory: Reinstate some lost properties
The code in gtk-builder-tool to preserve properties
has a bug, It lost these.
2019-02-08 10:34:32 -05:00
Matthias Clasen
4ace873046 Update ui files to new stack syntax
This conversion was done with the help of gtk4-builder-tool.
2019-02-08 00:09:44 -05:00
Matthias Clasen
ad9c2a624f stack: Convert child properties to a child meta object
Create a GtkStackPage public object which holds the former
child properties of GtkStack.

Adjust all callers.
2019-02-08 00:09:44 -05:00
Jakub Steiner
786322426a app icons: use new style
- update symbolic and fullcolor icons to use the new style
 See https://gitlab.gnome.org/GNOME/Initiatives/issues/2 for more info.

Fixes issue #1658
2019-02-06 16:01:14 +01:00
Matthias Clasen
3489ed087d Merge branch 'kill-buttonbox' into 'master'
Drop GtkButtonBox

See merge request GNOME/gtk!554
2019-02-05 13:06:09 +00:00
Emmanuele Bassi
589cb19715 demos: Drop the '+' from GTK
The demos have user-visible text that should refer to "GTK", not "GTK+"
any more.
2019-02-05 10:19:57 +01:00
Matthias Clasen
5120748981 Drop GtkButtonBox
This widget does not seem worth keeping,
and we want to get rid of child properties.
2019-02-04 12:44:55 -05:00
Matthias Clasen
57542e0cf6 icon browser: Add on and off icons
These are going to be used internally.
2019-01-24 20:43:12 -05:00
Matthias Clasen
70db084d43 Fix gtk4-icon-browser
It was broken by a recent GtkDialog change that renamed
the internal vbox child to content_area.
2019-01-24 20:43:12 -05:00
Matthias Clasen
883d5d8584 box: Remove the position child property
The position child property is problematic, since it
requires us to emit notification for all children when
inserting a child early in the list of children.

Remove the property from all ui files.
2019-01-23 19:30:47 -05:00
Timm Bäder
e9e40ddb42 box: Remove gtk_box_pack_start 2019-01-23 19:30:46 -05:00
Timm Bäder
494e9d750a dialog: Expose the content area as a separate GtkBox child
This way, the "vbox" internal child does not contain anything by
default. It previously did contain "internal" widgetry like the action
area.
2019-01-23 19:30:46 -05:00
Timm Bäder
3a13515777 Stop using GtkBox's pack-type child prop in UI files 2019-01-23 19:30:46 -05:00
Timm Bäder
bd71e744d2 Stop using gtk_box_pack_end
It might soon go away!
2019-01-23 19:30:46 -05:00
Timm Bäder
c6da0c9a7a demo: Fix tranparency overlay demo
We'd like the rose picture to be bigger than 16×16. Also remove the
scrolledwindow since the GtkPicture now automatically scales down the
rose image. This also fixes the picture always being allocated at y=0.
2019-01-13 08:23:25 +01:00
Timm Bäder
9d3120cc1e popover demo: Fix size-allocate callback signature 2019-01-03 08:56:40 +01:00
Jeremy Bicha
462193ae26 demos/gtk-demo/combobox: fix typo
Fix typo that prevented the P-S submenu from displaying correctly
2018-12-09 23:30:38 -05:00
Timm Bäder
a2a4603329 Merge branch 'bye-app-menu-gtk4' into 'master'
widget-factory: move app menu contents to primary menu (gtk4)

Closes #916

See merge request GNOME/gtk!365
2018-12-04 14:32:22 +00:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Daniel Boles
9cbd3ac017 gtk-demo/main: Suppress implicit fallthru warning
Comments matched to reassure the compiler that fallthrough is
intentional are supposed to precede the case or default keywords, at
least in GCC, so the one here did not suppress the warning with GCC. We
can just the if condition and put the comment at the end to solve that.

https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
2018-10-12 22:19:25 +01:00
Jeremy Bicha
52bcf7fd46 widget-factory: Add Keyboard Shortcuts menu item
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/916
2018-09-30 20:43:53 -04:00
Jeremy Bicha
43997fb550 widget-factory: Rename About menu item to About Widget Factory
This follows the recommendation in
https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement
2018-09-30 20:43:51 -04:00
Jeremy Bicha
c59669d376 widget-factory: Move app menu contents to primary menu
GNOME Shell 3.32 will remove support for the app menu
so we need to move its contents to the primary (hamburger)
menu.

widget-factory already had a primary menu.

The only item in the app menu was About.

https://gitlab.gnome.org/GNOME/Initiatives/issues/4
2018-09-30 20:43:41 -04:00
Matthias Clasen
ca9aa23619 Add devel style to demos
Lets show this off. Its cool.
2018-09-05 20:10:41 -04:00
Timm Bäder
d246abd085 fishbowl: Use a GtkPicture for videos 2018-08-25 08:06:37 +02:00
Guido Günther
8fb8303ba0 demos: Make desktop file names match the application id 2018-08-02 12:15:43 +02:00
Carlos Garnacho
8f6f980e49 demos: Update changedisplay demo to using GtkGesture 2018-07-30 13:14:12 +02:00
Carlos Garnacho
85f6995511 demos: Update hypertext demo to use controllers 2018-07-30 13:14:12 +02:00
Carlos Garnacho
4d59a00074 demos: Update search_entry2 demo to use key capturing API
No more GdkEvent juggling.
2018-07-30 13:14:12 +02:00
Carlos Garnacho
2dbb1509d8 demos: drop "Event axes" demo
It's too lowlevel to be practical anymore with gtk4, and there's
the Paint and Gestures demos to demonstrate input capabilities
better than this.
2018-07-30 13:14:12 +02:00
Carlos Garnacho
101c927c40 gtk-demo: Add pad controller handling to "Paint" demo
So it's more lifelike.
2018-07-30 13:14:12 +02:00
Matthias Clasen
7dabc2a42c Merge branch 'master' into 'master'
widgetfactory: add separator tool item to presentation

See merge request GNOME/gtk!249
2018-07-19 18:06:25 +00:00
Günther Wutz
1d4ce5a544 widgetfactory: add separator tool item to presentation 2018-07-17 21:50:19 +02:00
Benjamin Otte
cbb1e74bb5 textview: Only create cairo context in gtktextdisplay.c
Everything else is done using GtkSnapshot now, including renaming the
draw_layer vfunc to snapshot_layer.
2018-07-14 05:27:54 +02:00
Benjamin Otte
2f72353e0e gtk-demo: Update aspect-ratio when selecting new puzzle 2018-07-13 14:56:04 +02:00
Timm Bäder
2cc6a3ee5c widget factory: Use GtkPicture for background selection
Showing those background images as 16×16 icons doesn't look very nice.
2018-07-08 21:50:59 +02:00
Timm Bäder
96812450fa listbox demo: Hide extra_buttons_box by default
It should only show up when hovering the row.
2018-07-08 09:41:15 +02:00
Matthias Clasen
7733f646d6 gdk: Rename GdkDragContext to GdkDrag
This is to go along with the newly introduced GdkDrop.

This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 14:59:26 +02:00
Carlos Garnacho
e08e15ba51 gtkentry: Use gestures for entry icons
Instead of doing all handling manually in the ::event vfunc,
set up drag/multipress gestures on icon images, and implement
emission of ::icon-press/release and DnD there.

As a side effect, the GdkEvent field in ::icon-press/release
signals has been dropped. Callers that might be interested on it
may still use gtk_get_current_event*().
2018-06-21 12:50:57 +02:00
Benjamin Otte
9a91d3739d widget: Remove time argument from drag_data_get() vfunc 2018-06-18 23:49:53 +02:00
Benjamin Otte
6d7cb2b781 dnd: Make drag-data-received use a GdkDrop 2018-06-18 23:49:52 +02:00
Руслан Ижбулатов
10b2f6540a Fix wrong format strings in various places 2018-06-10 21:20:59 +00:00
Benjamin Otte
896f72d33b gtk-demo: Use GtkImages to select the puzzle 2018-06-10 02:25:55 +02:00
Benjamin Otte
7690c2d042 gtk-demo: Make sliding puzzle demo use GtkPicture 2018-06-10 02:25:28 +02:00
Benjamin Otte
cbd47fa770 gtk-demo: Port images demo to use a GtkPicture in places 2018-06-10 02:23:02 +02:00
Matthias Clasen
9d48a95d9a puzzle: fix some compiler warnings
These slipped under the radar, sorry.
2018-06-09 19:39:43 -04:00
Matthias Clasen
1ee23d0d49 puzzle: Add mouse support
Make it so that clicking on a puzzle piece moves enough
pieces to move the empty space there, if it is possible.
2018-06-07 21:47:30 -04:00
Matthias Clasen
ebf042d305 puzzle: Use plain labels
The previous code looked cool in the UI, but was too much
of a hack in the code.
2018-06-07 21:47:30 -04:00
Matthias Clasen
a849ffbd79 Add tweaks
Allow setting the puzzle size, and allow chosing between
the rose and the radioactive animation. Change the default
size to 3. 6 is just too hard.
2018-06-07 21:47:30 -04:00
Matthias Clasen
547d63d56a puzzle: Add a reshuffle button 2018-06-07 21:47:30 -04:00
Matthias Clasen
ddad5c3ce9 Keep aspect ratio of the image
Since we don't have a good way to control the window size tightly,
make the content keep aspect ratio.
2018-06-07 21:47:30 -04:00
Benjamin Otte
b6c8943bbf demo: Add the sliding puzzle demo 2018-06-07 21:47:30 -04:00
Benjamin Otte
7e574fa98c gdk: Get rid of gdk_event_free()
Events are objects, so use g_object_unref().
2018-05-29 21:53:44 +02:00
Matthias Clasen
46da8a031b gtk-demo: Avoid key-press-event 2018-05-19 23:28:44 -04:00
Timm Bäder
f71b2ee79f gestures demo: widget property is not writable
Use gtk_widget_add_controller instead.
2018-05-19 10:18:50 +02:00
Mohammed Sadiq
67becb4510 icon-browser: Fix typo in description
This is shown as tooltip-text
2018-05-07 20:50:27 +05:30
Matthias Clasen
1dcb76bc26 Merge branch 'wip/carlosg/controller' into 'master'
carlosg/controller

See merge request GNOME/gtk!131
2018-05-01 12:35:53 +00:00
Matthias Clasen
422262436b Fix the modelbutton demo _again_
It lost the action-target properties again.
2018-04-30 20:49:34 -04:00
Benjamin Otte
aca20dbb78 gtk-demo: Always have at least 1 icon in the fishbowl
When changing the widget type, don't start out with 0 icons.
2018-04-27 14:32:28 +02:00
Carlos Garnacho
3675f9ccb2 gesturestylus: Port to new API model 2018-04-26 17:59:42 +02:00
Carlos Garnacho
15e00759c7 eventcontrollerkey: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
c5f12a7326 padcontroller: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
1e6eb1f8b9 draggesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
bf82149271 longpressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
4ddc94b293 multipressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
66223aaa08 swipegesture: Port to new API model 2018-04-26 17:59:41 +02:00
Benjamin Otte
91efa37fcb zoomgesture: Port to new API model 2018-04-26 17:59:41 +02:00
Benjamin Otte
703d5340f1 rotategesture: Port to new API model 2018-04-26 17:59:41 +02:00
Benjamin Otte
c2ec738a2e widget-factory: Put gesture into ui file 2018-04-26 17:59:41 +02:00
Benjamin Otte
2210b9a302 gtk-demo: Merge widgetbowl into fishbowl 2018-04-24 21:55:37 +02:00
Benjamin Otte
aa2f415283 demo: Clean up GtkFishbowl widget
1. Remove set_icons property
2. Make it a GtkWidget subclass
3. Add gtk_fishbowl_set_creation_func()
4. Make the widgetbowl use the new benchmarking infrastructure of the
   fishbowl
2018-04-24 21:55:37 +02:00
Benjamin Otte
db5b8ca997 demo: Move benchmarking implementation to fishbowl widget 2018-04-24 21:55:37 +02:00
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Matthias Clasen
f0f2dd743f widget-factory: add emoji completion to an entry 2018-04-23 18:54:43 -04:00
Ting-Wei Lan
2a87caf529 gtk-demo, testgtk: Don't pass an integer to fabs
It looks like a mistake which compilers are likely to warn.
2018-04-23 18:54:43 -04:00
Benjamin Otte
c5bcc47ce7 demo: Don't add more icons all the time
If adding new icons takes longer than a second, the frame clock should
run before we add even more icons...
2018-04-22 02:57:47 +02:00
Benjamin Otte
9cecf123f3 widget-factory: Use a pixbuf instead of a surface
This gets rid of the last user of
gdk_cairo_surface_create_from_pixbuf().
2018-04-12 14:03:58 +02:00
Timm Bäder
b7f98314a5 widgetbowl: Add switch demo 2018-04-06 08:24:19 +02:00
Benjamin Otte
fb33110fd1 gtk-demo: Redo viewing of resources
1. Don't rely on GtkImage as a detector of file type anymore.
   Instead, hardcode all extensions that are in use.
2. Add a display method for videos.
2018-04-06 00:44:18 +02:00
Matthias Clasen
21d1ab42d1 icon-browser: Stop using ::key-press-event 2018-04-05 19:26:53 +02:00
Matthias Clasen
918d552472 gtk-demo: Stop using ::key-press-event in font explorer
Use a key controller instead. Note that this currently
breaks the handling of Enter, since we activate key bindings
twice, causing us to switch to the label and back.
2018-04-05 19:26:53 +02:00
Carlos Garnacho
b1eaeebe7d demos: Add "Paint" demo 2018-04-05 19:26:53 +02:00
Benjamin Otte
139882bc76 demos: Add an image demo for widget paintables 2018-04-05 14:56:39 +02:00
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Benjamin Otte
73650c6da2 gtk: Remove gtk_widget_queue_draw_region()
... and gtk_widget_queue_draw_area().

They don't doi anything anymore.
2018-04-05 14:56:38 +02:00
Chun-wei Fan
464943e5a6 gtk, demos: Fix builds without HarfBuzz and PangoFT
Really exclude the portions in the gtkfontchooserwidget.c that are built
when HarfBuzz and PangoFT2 are built, and update the Meson files to
exclude such sources as well from the main GTK SO/DLL and from the
gtk4-demo program.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:15:18 +08:00
Chun-wei Fan
a4c0395343 [gtk|demos/gtk-demo]/language-names.c: Fix build on non-GCC/CLang
Remove g_auto*() usage from these sources and use the traditional
g_free(), as g_auto*() are GCCisms (or CLangisms).

Also, don't include unistd.h unconditionally and stop including
langinfo.h and dirent.h, since they seem to be unused.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:13:27 +08:00
Chun-wei Fan
19ce520c2d build: Fix linking demos on Visual Studio
The demos are now built as GUI programs, which will require the presence
of WinMain() on Visual Studio builds, unless we specify the entry point.

Pass the /entry:mainCRTStartup linker flag on Visual Studio builds for
the demo programs so that they can link properly.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-04-02 19:11:50 +08:00
Matthias Clasen
63a7d99d25 widget-factory: Enable all details in the font chooser
We want to see this here.
2018-04-01 19:36:54 -04:00
Matthias Clasen
6b3091856b Enable variations and features for font explorer 2018-03-31 21:31:11 -04:00
Benjamin Otte
2f3cf6227a fishbowl: Make stats tracking work somewhat with broken X servers
Broken X servers being the ones that don't support NET_WM_TIMINGS (ie
every WM but mutter and XWayland).
2018-03-30 18:58:33 +02:00
Benjamin Otte
89f6a4ede4 demos: Improve frame rate tracking for fishbowl demo
We now properly use GdkFrameTimings and can therefor check for dropping
even a single frame in the history (of 16 frames or 1/4 of a second).
Once that happens, we immediately stop adding new items to the bowl.

A side effect is that the number of icons is now a *lot* smaller.
2018-03-30 16:51:09 +02:00
Matthias Clasen
47d79a4257 Add appdata for gtk4-widget-factory
This will let us build a better flatpak for gtk4-widget-factory.
2018-03-20 20:05:15 -04:00
Matthias Clasen
cb41d1586f Add appdata for gtk4-demo
This will let us build a better flatpak for gtk4-demo.
2018-03-20 19:40:30 -04:00
Alexander Larsson
695d141f32 Merge branch 'rename-window-to-surface' into 'master'
Rename window to surface

See merge request GNOME/gtk!72
2018-03-20 16:16:57 +00:00
Matthias Clasen
b83ba41f2d Merge branch 'accessible-role' into 'master'
gtkbuilder: add accessibility role declaration

Closes #109

See merge request GNOME/gtk!69
2018-03-20 15:46:20 +00:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Alexander Larsson
9a7e721181 GdkSurface: Rename various functions and variables
This is an automatic rename of various things related
to the window->surface rename.

Public symbols changed by this is:
 GDK_MODE_WINDOW
 gdk_device_get_window_at_position
 gdk_device_get_window_at_position_double
 gdk_device_get_last_event_window
 gdk_display_get_monitor_at_window
 gdk_drag_context_get_source_window
 gdk_drag_context_get_dest_window
 gdk_drag_context_get_drag_window
 gdk_draw_context_get_window
 gdk_drawing_context_get_window
 gdk_gl_context_get_window
 gdk_synthesize_window_state
 gdk_surface_get_window_type
 gdk_x11_display_set_window_scale
 gsk_renderer_new_for_window
 gsk_renderer_get_window
 gtk_text_view_buffer_to_window_coords
 gtk_tree_view_convert_widget_to_bin_window_coords
 gtk_tree_view_convert_tree_to_bin_window_coords

The commands that generated this are:

git sed -f g "GDK window" "GDK surface"
git sed -f g window_impl surface_impl
(cd gdk; git sed -f g impl_window impl_surface)
git sed -f g WINDOW_IMPL SURFACE_IMPL
git sed -f g GDK_MODE_WINDOW GDK_MODE_SURFACE
git sed -f g gdk_draw_context_get_window gdk_draw_context_get_surface
git sed -f g gdk_drawing_context_get_window gdk_drawing_context_get_surface
git sed -f g gdk_gl_context_get_window gdk_gl_context_get_surface
git sed -f g gsk_renderer_get_window gsk_renderer_get_surface
git sed -f g gsk_renderer_new_for_window gsk_renderer_new_for_surface

(cd gdk; git sed -f g window_type surface_type)
git sed -f g gdk_surface_get_window_type gdk_surface_get_surface_type

git sed -f g window_at_position surface_at_position
git sed -f g event_window event_surface
git sed -f g window_coord surface_coord
git sed -f g window_state surface_state
git sed -f g window_cursor surface_cursor
git sed -f g window_scale surface_scale
git sed -f g window_events surface_events
git sed -f g monitor_at_window monitor_at_surface
git sed -f g window_under_pointer surface_under_pointer
(cd gdk; git sed -f g for_window for_surface)
git sed -f g window_anchor surface_anchor
git sed -f g WINDOW_IS_TOPLEVEL SURFACE_IS_TOPLEVEL
git sed -f g native_window native_surface
git sed -f g source_window source_surface
git sed -f g dest_window dest_surface
git sed -f g drag_window drag_surface
git sed -f g input_window input_surface

git checkout NEWS* po-properties po docs/reference/gtk/migrating-3to4.xml
2018-03-20 12:05:26 +01:00
Alexander Larsson
890080ebf7 GdkWindow -> GdkSurface: File renames
Rename all *window.[ch] source files.

This is an automatic operation, done by the following commands:

for i in $(git ls-files gdk | grep window); do
    git mv $i $(echo $i | sed s/window/surface/);
    git sed -f g $(basename $i) $(basename $i | sed s/window/surface/) ;
done

git checkout NEWS* po-properties po
2018-03-20 11:46:11 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Samuel Thibault
9561b97dc4 Fix some accessibility issues in demos
Fixes #110
2018-03-19 18:07:25 +01:00
Samuel Thibault
bd986f9534 gtkbuilder: add accessibility role declaration
This allows to override the role declared to the atk stack.  For
instance,

<accessibility>
  <role type="static"/>
</accessibility>

allows to tell the accessibility stack that a label is just a message in
a message box.

Fixes #109
2018-03-19 18:07:06 +01:00
Benjamin Otte
0f4ab5862a gtk-demo: Add a simple video player example
For now, it's impossible to unfullscreen. Somebody should figure out a
way to do this.
2018-03-18 21:01:23 +01:00
Benjamin Otte
182f39aba7 demos: Round up the paintable demos with a media stream 2018-03-18 21:01:23 +01:00
Benjamin Otte
3d9cb477aa demos: Add an animated paintable demo
This builds on the paintable demo.
2018-03-18 21:01:23 +01:00
Benjamin Otte
357175f0b1 gtk-demo: Add paintable demo 2018-03-18 21:01:23 +01:00
Benjamin Otte
b410b48eed demos: Add a video benchmark to widgetbowl demo 2018-03-18 21:01:23 +01:00
Benjamin Otte
5bd85058d9 gtk-demo: Add a video example (with controls) to the images demo 2018-03-18 21:01:23 +01:00
Timm Bäder
3e6fea0550 widgetbowl: Add a proper description
Instead of the copy/pasted one from the fishbowl demo.
2018-03-17 12:09:30 +01:00
Benjamin Otte
cbe40f5f46 image: Remove gtk_image_set_texture()
gtk_image_get_paintable() is a perfect replacement, so use that one.
2018-03-16 06:04:45 +01:00
Benjamin Otte
7844320f10 image: Load resources and files into textures
Instead of loading them into surfaces (which we want to get rid of), we
load into textures.
In fact, we introduce a new paintable subclass called a GtkScaler that
takes care of tracking scaling.

This also ideally gets rid of an extra conversion once renderers learn
to render textures directly.
2018-03-16 06:04:44 +01:00
Benjamin Otte
89ee42db54 dnd: Make dnd icon API take a paintable
... instead of a texture.
2018-03-16 06:04:44 +01:00
Benjamin Otte
a891a3ae26 demos: Unbreak icon for fishbowl demo
351559fcfa was to eager in simplifying
things.
2018-03-16 06:04:43 +01:00
Timm Bäder
614c3e6721 demo: Remove an expose_event mention 2018-02-06 09:19:40 +01:00
Timm Bäder
f52100c46e iconbrowser: setup image dnd for image6
Otherwise the we fail to set the drag source icon name later on.
2018-02-03 12:22:46 +01:00
Emmanuele Bassi
c655759cef Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Benjamin Otte
dfc131c7ec toolpalette: Remove
The widget was basically unmaintained since GTK 3.0 and the only known
user was Glade.
2018-02-03 11:52:37 +01:00
Timm Bäder
e8986d18c2 icon browser: Remove usage of stock-size property
Does not exist anymore.
2018-01-30 21:51:59 +01:00
Emmanuele Bassi
f83b3c8af2 Enforce UTF-8 encoding when opening C files
We have a couple of Python 3.x scripts that parse C files, and since C
does not have any encoding, we need to force one ourselves, to avoid the
case when we're running the build in a non-UTF-8 locale.

https://bugzilla.gnome.org/show_bug.cgi?id=792497
2018-01-23 14:04:49 +01:00
Timm Bäder
f595c0dc1b widget-factory: Fix some layout issues
We have to explicitly set some of these to their default values so
expand-set is TRUE and the boxes stop propagating their expansion state
up the hierarchy.
2018-01-19 09:53:39 +01:00