Commit Graph

1369 Commits

Author SHA1 Message Date
Matthias Clasen
fbed55dff9 gtk-demo: Fix the rotated text demo
Off-by-one on the heart!
2020-03-28 00:08:12 -04:00
Matthias Clasen
059917b83c gtk-demo: Fix the overlay demo
We must use two separate boxes for the label and
the entry, otherwise we can't keep their can-target
properties apart.
2020-03-28 00:08:12 -04:00
Matthias Clasen
163aa82d45 gtk-demo: Use mnemonics in menu buttons
Use GtkMenuButton:use-underline in the modelbutton demo.
2020-03-28 00:08:12 -04:00
Matthias Clasen
bc2c341d60 gtk-demo: Visual fixes to the model button demo 2020-03-28 00:08:12 -04:00
Matthias Clasen
93d54ba10b gtk-demo: Fix the search entry demo
Avoid critical warnings when setting up the context
menu actions.
2020-03-27 16:24:20 -04:00
Matthias Clasen
80b988ef6c gtk-demo: Stop emitting ::popup-menu
The signal was not used anyway, in the font explorer demo.
2020-03-25 23:14:45 -04:00
Benjamin Otte
bb4fbe3d8f accels: Remove GtkAccelGroup 2020-03-25 23:14:44 -04:00
Benjamin Otte
1ec950d14a gtk-demo: Port the sliding puzzle demo to shortcuts 2020-03-25 23:14:27 -04:00
Benjamin Otte
92e20deca1 shortcut: Change the API for creating shortcuts
When creating shortcuts, there almost always are a trigger and an action
available for use. So make gtk_shortcut_new() take those as arguments.

Also add gtk_shortcut_new_with_arguments() so people can easily pass
those in, too.
2020-03-25 23:14:27 -04:00
Benjamin Otte
cd0332aad5 shortcut: Add GtkShortcutAction
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.

So far, these different ways are supported:

 - do nothing
 - Call a user-provided callback
 - Call gtk_widget_activate()
 - Call gtk_widget_mnemonic_activate()
 - Emit an action signal
 - Activate an action from the widget's action muxer
2020-03-25 23:14:27 -04:00
Benjamin Otte
c3af47f5d9 gtk-demo: Add a dumb demo for shortcut triggers 2020-03-25 23:14:27 -04:00
Matthias Clasen
923a245a80 gtk-demo: Add hyphenation control to the markup demo 2020-03-20 23:58:33 -04:00
Matthias Clasen
38f1dbaba3 gtk-demo: Allow word breaking in the markup demo
We want to show hyphenation control here.
2020-03-20 23:58:33 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Matthias Clasen
98011e6273 gtk-demo: Stop emitting ::popup-menu
The signal was not used anyway, in the font explorer demo.
2020-03-18 23:00:51 -04:00
Benjamin Otte
ff6df33b6a accels: Remove GtkAccelGroup 2020-03-18 23:00:51 -04:00
Benjamin Otte
067bd7019c gtk-demo: Port the sliding puzzle demo to shortcuts 2020-03-18 23:00:51 -04:00
Benjamin Otte
4a4bfa0766 shortcut: Change the API for creating shortcuts
When creating shortcuts, there almost always are a trigger and an action
available for use. So make gtk_shortcut_new() take those as arguments.

Also add gtk_shortcut_new_with_arguments() so people can easily pass
those in, too.
2020-03-18 23:00:51 -04:00
Benjamin Otte
e6d0560a82 shortcut: Add GtkShortcutAction
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.

So far, these different ways are supported:

 - do nothing
 - Call a user-provided callback
 - Call gtk_widget_activate()
 - Call gtk_widget_mnemonic_activate()
 - Emit an action signal
 - Activate an action from the widget's action muxer
 - Activate a GAction
2020-03-18 23:00:51 -04:00
Benjamin Otte
662a8a2885 gtk-demo: Add a dumb demo for shortcut triggers 2020-03-18 23:00:50 -04:00
Matthias Clasen
66a0a8d53e Merge branch 'wip/baedert/test-cflags' into 'master'
Pass (almost) all our cflags to tests, testsuite, examples, demos, ...

See merge request GNOME/gtk!1516
2020-03-13 18:40:46 +00:00
Matthias Clasen
703d69692f demo: stop using gdk_surface_get_state 2020-03-12 14:56:20 -04:00
Timm Bäder
7789d0e23f builder: Make object names a const array
We don't take ownership.
2020-03-07 15:30:38 +01:00
Timm Bäder
dc36c21835 demos/gtk-demo: Add common_cflags to build
With a few exceptions.
2020-03-07 15:30:35 +01:00
Benjamin Otte
3f7b401de0 gtk-demo: Add a simple peg solitaire DND demo 2020-03-02 03:18:55 +01:00
Benjamin Otte
a411959c91 droptarget: Redo
This is a huge reorganization of GtkDropTarget. I did not know how to
split this up, so it's unfortunately all one commit.

Highlights:

- Split GtkDropTarget into GtkDropTarget and GtkDropTargetAsync
  GtkDropTarget is the simple one that only works with GTypes and offers
  a synchronous interface.
  GtkDropTargetAsync retains the full old functionality and allows
  handling mime types.

- Drop events are handled differently
  Instead of picking a single drop target and sending all DND events to
  it, every event is sent to every drop target. The first one to handle
  the event gets to call gdk_drop_status(), further handlers do not
  interact with the GdkDrop.
  Of course, for the ultimate GDK_DROP_STARTING event, only the first
  one to accept the drop gets to handle it.
  This allows stacking DND event controllers that aren't necessarily
  interested in handling the event or that might decide later to drop
  it.

- Port all widgets to either of those
  Both have a somewhat changed API due to the new event handling.
  For the ones who should use the sync version, lots of cleanup was
  involved to operate on a sync API.
2020-03-02 03:18:55 +01:00
Matthias Clasen
b5bacb3be6 Drop the margin property
Replace it with margin-start, -end, -top, -bottom throughout.
2020-02-25 20:59:04 -05:00
Matthias Clasen
a9c05193a7 Drop the expand property
The hexpand and vexpand properties are sufficient.
2020-02-25 18:29:15 -05:00
Matthias Clasen
9d80db29de Merge branch 'spinning-spinner' into 'master'
Rename GtkSpinner::active to ::spinning

See merge request GNOME/gtk!1475
2020-02-25 04:04:46 +00:00
Matthias Clasen
e73a40733f Rename GtkSpinner::active to ::spinning
And add a setter and getter. The old name was
confusing with the widget state of the same
name. 'Active' is just too overloaded.
2020-02-24 22:37:02 -05:00
Matthias Clasen
a43d13aa74 popover: Drop ::relative-to
It is enough to just set the parent (and make the parent
call gtk_native_check_resize in size_allocate).

This commit removes the relative_to argument to the
constructors of GtkPopover and GtkPopoverMenu, and
updates all callers.
2020-02-24 20:46:41 -05:00
Emmanuele Bassi
b09e7df81b Remove GtkFileChooser:local-only
Now that the whole API goes through GFile we don't have the weird split
between local-only and non-local-only modes.
2020-02-22 15:22:06 +00:00
Matthias Clasen
1c7191f45c gtk-demo: Stop using gtk_get_event_widget
This is convenience api that will be going away.
2020-02-21 00:51:03 -05:00
Matthias Clasen
b1eaa502df events: reorganize getters
Restructure the getters for event fields to
be more targeted at particular event types.

Update all callers, and replace all direct
event struct access with getters.

As a side-effect, this drops some unused getters.
2020-02-21 00:51:03 -05:00
Matthias Clasen
31bf9da63a Strip const from GdkEvent
Events are refcounted structs, and we generally don't
pass these as const.
2020-02-21 00:51:02 -05:00
Matthias Clasen
c343031a0e Stop using g_object_ref/unref on events
Use gdk_event_ref/unref instead of g_object_ref/unref.
Events will stop being object soon.
2020-02-21 00:47:53 -05:00
Matthias Clasen
66307f00f1 icontheme: Update the api
Add properties, and use string arrays instead of lists.

Among other things, this renames gtk_icon_theme_list_icons
to gtk_icon_theme_get_icon_names.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2410
2020-02-18 20:32:17 -05:00
Benjamin Otte
80ba7fd682 dragdest: Make gtk_drop_target_new() args be transfer full
Saves tons of code.
2020-02-17 04:04:21 +01:00
Benjamin Otte
da83457a60 dnd: Remove gdk_content_provider_new_with_callback()
Content providers are meant to be immutable, apart from very special
cases, but in those cases they need to emit
gdk_content_provider_content_changed().

Having a constructor that just uses a get_func invites abuse of this
by not making developers aware of those requirments.
In fact, all users in GTK failed to do this.

Instead, code should use the GtkDragSource::prepare signal to create
content providers when needed.

The same problem exists with gdk_content_provider_new_with_formats(),
but this commit doesn't touch that.
2020-02-16 20:10:31 +01:00
Timm Bäder
78a5bf8e21 Remove gtk_info_bar_get_content_area() uses
We can just add() to the info bar directly.
2020-02-15 17:18:26 +01:00
Benjamin Otte
a278edab22 window: Remove type argument from gtk_window_new() 2020-02-14 21:18:49 +01:00
Emmanuele Bassi
cdd7e4c5ec Add a notify function to GdkContentProvider
The callback-based content providers need a GDestroyNotify function to
free the data passed to them on construction, otherwise they are going
to leak.
2020-02-13 14:53:25 +00:00
Alexander Larsson
1698369d52 Merge branch 'icon-theme-api-rework' into 'master'
Icon theme api rework

See merge request GNOME/gtk!1390
2020-02-10 12:45:56 +00:00
Matthias Clasen
55b60f6da9 gtk-demo: Don't call gtk_main_quit
It doesn't work with GtkApplications that do not
call gtk_main().
2020-02-07 16:25:02 -05:00
Benjamin Otte
44e153d8a8 GtkToolbar: remove 2020-02-07 14:08:26 +01:00
Benjamin Otte
e00030dff2 css: Remove .primary-toolbar
It's not used anywhere anymore.
2020-02-07 14:08:08 +01:00
Benjamin Otte
9cccb944ef css: Remove .inline-toolbar
It's not used anywhere anymore.
2020-02-07 14:08:08 +01:00
Benjamin Otte
68dbb3f31a gtk-demo: Get rid of toolbars 2020-02-07 14:08:08 +01:00
Alexander Larsson
8282698201 textview: Use paintables instead of textures, and fix the support
This changes gtk_text_buffer_insert_texture() to
gtk_text_buffer_insert_paintable() which is strictly more useful
(as textures are paintables). It also fixes the code to actually
support drawing the paintables (as well as tracking changes
to the paintables.
2020-02-06 17:47:56 +01:00
Alexander Larsson
d69f7fd63e IconTheme: Never fail a lookup or icon load
If icon lookup fails or if loading it fails later, just always
fall back to the built in image-missing icon. Nobody is handling
missing icons in a sane way anyway.

If you *truly* need to handle missing icons, you need to manually
use gtk_icon_theme_has_icon().

While changing the loading code I also fixed an issue where it
was always passing "png" to pixbuf, now it also handles "xpm" if
that is the filename suffix.
2020-02-06 09:38:25 +01:00
Alexander Larsson
410541f82b Rename GtkIcon to GtkIconPaintable 2020-02-04 17:19:22 +01:00
Benjamin Otte
138de60ab2 icontheme: Remove GENERIC_FALLBACKS
Instead, rely on people passing fallbacks explicitly.

Alternatively, GThemedIcon provides the functionality to create
fallbacks, which is what GtkImage and the testsuite now use.
That method is slightly better, too, so the expected test results
have been updated accordingly.
2020-02-04 16:51:54 +01:00
Benjamin Otte
571021cbc1 icontheme: Pass fallbacks as optional argument to lookup_icon()
This way, we can remove gtk_icon_theme_choose_icon() completely.
2020-02-04 16:51:54 +01:00
Benjamin Otte
f7a5dd7b8b icontheme: Remove contexts
There is no way to query contexts or do anything useful with them.

So don't keep track of them and don't make them an argument in public
APIs with the docs saying "I don't know what to use here, maybe read
some spec somewhere".
2020-02-04 16:51:54 +01:00
Benjamin Otte
bbbe39fb44 icontheme: Make text direction a lookup argument
Most users were just forgetting to set the proper flags.
And flags aren't the right way to set this anyway, it was just
acceptable as a workaround during GTK3 to not break API.
2020-02-04 16:41:36 +01:00
Benjamin Otte
bfebc2b01a icontheme: Remove gtk_icon_theme_get_default()
The API encouraged wrong usage - most of the users were indeed wrong.

Use the correct version instead:
  gtk_icon_theme_get_for_display (gtk_widget_get_display ())
2020-02-04 16:41:36 +01:00
Alexander Larsson
27799ba4f5 Remove final references to "icon info" with just "icon" 2020-01-30 10:53:43 +01:00
Alexander Larsson
b087f9ca51 icon-theme: Drop the _for_scale() versions and always take scale 2020-01-30 10:53:43 +01:00
Alexander Larsson
e2f778602b icon-theme: Rename GtkIconInfo to GtkIcon 2020-01-30 10:53:43 +01:00
Alexander Larsson
dbe021239f icons: Convert use of load() to download_texture() 2020-01-29 19:06:16 +01:00
Alexander Larsson
c42977af04 Convert trivial users of icon theme loading to use info as paintable 2020-01-29 19:06:16 +01:00
Benjamin Otte
49b47c9133 Remove GtkWidgetPath
... and all associated demos and tests.
2020-01-28 02:17:02 +01:00
Benjamin Otte
c85d9a3259 stylecontext: Change semantics of gtk_style_context_get_path()
Widget contexts now return NULL here. A non-NULL result requires a
previous call to gtk_style_context_set_path()
2020-01-21 12:47:16 +01:00
Yariv Barkan
1a9b1f38a4 demo: Use pinch translation in the gestures demo
Add the pinch translation offset to the pinch gesture demo. That allows
moving the square around in addition to the already-supported rotate and
zoom.
2020-01-17 22:34:48 +02:00
Matthias Clasen
794ee0b8c0 gtk-demo: Use a default action in the infobars demo
This makes the question infobar activatable by clicking
anywhere in it.
2020-01-14 00:05:23 -05:00
Matthias Clasen
5206a92522 Update all callers 2020-01-08 18:48:22 -05:00
Matthias Clasen
6b7c5174ed gtk-demo: Update the ::prepare handler 2020-01-08 18:48:22 -05:00
Matthias Clasen
9cc29efa25 gtk-demo: Use GDK content formats api 2020-01-08 18:48:22 -05:00
Matthias Clasen
1a5dece09c gtk-demo: Use gtk_widget_add_controller for drag source 2020-01-08 18:48:21 -05:00
Matthias Clasen
e8b830a3dd dragsource: Reshuffle api a bit
Remove arguments from the constructor.

For actions, we now default to COPY, which is the most common one
that we should enable by default (MOVE requires handling deletion
on the the source side, and ASK only makes sense if we have
multiple actions).

For the content provider, we add a new ::prepare signal where
it should be provided just-in-time.
2020-01-08 18:48:21 -05:00
Matthias Clasen
38974d7d2b dragsource: Tweak api, update all callers
Add GdkDrag back to signals, drop ::drag-data-delete,
and replace it with a boolean in ::drag-end.
2020-01-08 18:48:21 -05:00
Matthias Clasen
e9067ae2db Replace gtk_drop_target_attach/detach
Since drop targets are now just event controller,
gtk_widget_add/remove_controller works just fine
for them.
2020-01-08 18:48:21 -05:00
Matthias Clasen
46f42fc53d droptarget: Drop defaults flags
These no longer have any effect.

Update all callers.
2020-01-08 18:48:20 -05:00
Matthias Clasen
ac09500d74 gtk-demo: Convert clipboard demo to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
5ad4b75ae2 gtk-demo: Convert the clipboard demo to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
ca87048045 gtk-demo: Remove the change display demo
The window picking code has been broken for a while.
Since this is not really functionality that we should
highlight to application developers, remove the demo
instead of patching it up.
2019-12-29 18:45:40 -05:00
Matthias Clasen
5ec9b15d84 gtk-demo: Convert the builder demo to a menu model 2019-12-29 18:45:40 -05:00
Matthias Clasen
6b691bc02d gtk-demo: Remove menus from listbox demo 2019-12-29 18:45:40 -05:00
Matthias Clasen
abcd83dd78 gtk-demo: Cosmetics 2019-12-29 18:45:40 -05:00
Matthias Clasen
5d2113ff5d gtk-demo: Remove the menus demo
Menus are going away.
2019-12-29 18:45:40 -05:00
Matthias Clasen
5c086b9d44 gtk-demo: Convert the dnd demo to a popover 2019-12-29 18:45:40 -05:00
Matthias Clasen
8efa612288 gtk-demo: Remove a somewhat silly bit of code
Putting a context menu on an overlay scrollbar
is too much of an easter egg to count as a useful
demo. Remove it, rather than changing it to a
popover.
2019-12-29 18:45:40 -05:00
Matthias Clasen
928f7faf7d gtk-demo: Use a popover in the clipboard demo 2019-12-29 18:45:40 -05:00
Matthias Clasen
4b4cf36b03 gtk-demo: Replace a menu with a popover 2019-12-29 18:45:40 -05:00
Matthias Clasen
663fb93af7 gtk-demo: Fix font explore initial state 2019-12-23 22:35:44 -05:00
Matthias Clasen
db42c23c0a gtk-demo: Fix a crash in the font explorer demo
gtk_widget_add_controller is transfer-full.
2019-12-23 22:33:02 -05:00
Matthias Clasen
33716d1e50 gtk-demo: Cosmetic fixes to the dnd demo 2019-12-23 22:14:52 -05:00
Matthias Clasen
65769fd7a6 gtk-demo: Cosmetic fixes to the assistant demo 2019-12-23 21:58:45 -05:00
Matthias Clasen
e6d3f3d91e gtk-demo: Fix the application demo
This was broken in d223752c55, when the
support for internal children was removed
from GtkInfoBar.
2019-12-23 21:52:52 -05:00
Matthias Clasen
4470e5bc93 gtk-demo: Some touchups
Make the theming style classes demo look a bit less odd.
2019-12-12 18:46:53 -05:00
Benjamin Otte
101298c54d gtk-demo: Don't include "gtk.h" 2019-12-12 19:50:55 +01:00
Benjamin Otte
a15fb95c46 gtk-demo: Use normal way to lookup up symbols
We're a normal application, so we can use the normal way to hook up code
into builder files, which is using dlsym() for the function pointers.

There's no need to to extra work exporting static symbols.
2019-12-03 18:12:25 +01:00
Robert Ancell
25e4174a38 gtk-demo: Fix incorrect use of g_strdup_printf
Was broken in a refactoring in 4a2f313
2019-11-26 10:11:28 +13:00
Benjamin Otte
b025ee428c builder: Connect signals automatically
gtk_builder_connect_signals() is no longer necessary, because all the
setup that made it necessary to have this extra step is now done
automatically via the closure functions.
2019-11-22 17:42:31 +01:00
Benjamin Otte
27d05102ab builder: Remove user_data argument from gtk_builder_connect_signals()
This is pretty unused and gets in the way of the next steps.

A potential side effect is that for templates the widget was passed as
the user data argument. If that turns out to be important, we have to
special case that situation.
2019-11-22 07:46:18 +01:00
Benjamin Otte
ab407ba57c Merge branch 'kill-entry-buffer-demo' into 'master'
gtk-demo: Drop the entry buffer demo

See merge request GNOME/gtk!1166
2019-11-05 19:08:22 +00:00
Matthias Clasen
e8d890ae0c gtk-demo: Drop the entry buffer demo
We all agree that entry buffers are not something
we should promote in demos.
2019-11-05 18:50:06 +00:00
Christian Hergert
dba9298c14 gtk-demo: set irreversable actions for textview demos 2019-11-05 10:27:29 -08:00
Christian Hergert
67c0f88c00 gtk-demo: add a demo for TextView undo/redo 2019-11-05 10:27:29 -08:00
Christian Hergert
e93408e962 gtk-demo: add an undo demo for GtkEntry 2019-11-05 10:27:29 -08:00
Christian Hergert
6d193d7cb4 gtk-demo: wrap text operations in irreversible actions
This ensures that the actions to set the text for the demo tabs cannot
be undone. This matches the previous behavior for GtkTextBuffer.
2019-11-05 10:27:29 -08:00
Matthias Clasen
4a2f3130d2 gtk-demo: Use harfbuzz for font features
We don't need freetype anymore here; harfbuzz
has what we need.
2019-11-01 13:01:54 -04:00
Matthias Clasen
1f0310ddff gtk-demo: Add a scrolling image demo
This tests big textures.
2019-10-22 21:20:36 -04:00
Benjamin Otte
427deb4f13 widget: Make gtk_widget_grab_focus() return a boolean
So now it can actually fail.

It doesn't yet though.
2019-10-15 16:33:05 +02:00
Matthias Clasen
019e3c02ed Make the scrolling demo more versatile
Allow to swap out the content, so we can compare
text and icon scrolling.
2019-10-11 22:04:30 -04:00
Matthias Clasen
60e2242256 Add an icon scrolling demo
This is good to exercise the GL renderer icon cache.
2019-10-11 17:36:38 -04:00
Timm Bäder
7cdb8d8565 gtk-demo: Fix up sidebar demo style
Remove a superfluous separator and add the icon-dropshadow class to the
gtk logo
2019-10-09 16:57:22 +02:00
Timm Bäder
3944d64d08 demo: Don't manually add labels to menubuttons 2019-10-09 16:57:22 +02:00
Timm Bäder
e20f547317 demo: Fix modelbutton demo 2019-10-09 16:57:22 +02:00
Timm Bäder
71339225eb icontheme: Remove gtk_icon_info_load_texture
It's the same as load_icon now.
2019-09-09 17:36:26 +02:00
Timm Bäder
fd16ac4d5e icontheme: Return paintables from more API 2019-09-09 17:36:26 +02:00
Timm Bäder
f3099afcc5 icontheme: Return textures from load_icon{,_for_scale} 2019-09-09 17:36:26 +02:00
Timm Bäder
6821fe0c13 icontheme: Add error argument to _load_texture
Loading an icon might fail.
2019-09-09 17:36:26 +02:00
Timm Bäder
b9473bc99c glarea: Fix buffer initialization
This only worked when the vao id and the buffer id accidentally matched,
for example when running gtk4-demo with --run=glarea

Fixes #2042
2019-09-09 17:36:25 +02:00
Timm Bäder
4cc4868e93 label: Remove "line" from wrap properties
The property names are "wrap" and "wrap-mode", so it doesn't make sense
that the accessors refer to line_wrap and line_wrap_mode.
2019-09-09 17:36:23 +02:00
Дилян Палаузов
6ded38de2b Minor typos in the Documentation (a/an) 2019-08-25 12:52:46 +00:00
Matthias Clasen
8b1f3936b6 font rendering demo: Make boxes optional 2019-07-26 00:31:07 -04:00
Matthias Clasen
108ea50179 font rendering demo: Show unrounded extents
This makes more sense.
2019-07-25 23:35:09 -04:00
Matthias Clasen
df1892c052 font rendering: Show ink rect too 2019-07-25 22:06:34 -04:00
Matthias Clasen
0820a79bf5 Improve the font rendering demo
Show the pixel grid, extents, and baseline.
2019-07-25 19:07:12 -04:00
Matthias Clasen
dec4db5943 Add a font rendering demo
This renders a magnified version of the text,
to make the effect of various font rendering options
more visible.

It also shows the phases of subpixel rendering,
if you have a recent pango and cairo.
2019-07-25 16:43:22 -04:00
Matthias Clasen
dea309144b gtk-demo: Fix a crash 2019-07-25 13:51:34 -04:00
Timm Bäder
1866aa93e3 fishbowl: Plug a small leak 2019-07-13 10:10:17 +02: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
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
1a93ab053c Add a theme loading benchmark 2019-06-05 04:20:31 +00: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
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
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
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
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
5368f98dd5 demos: Stop using gtk_button_clicked 2019-05-18 14:33:41 -04: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
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
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
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
Emmanuele Bassi
31b65e6721 demos: Update GtkGrid definitions in UI files 2019-04-05 00:12:26 +01: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
365400c13e gtk-demo: Rename to org.gtk.Demo4 2019-04-02 00:27:32 +00: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
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
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
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
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
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
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
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
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
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
Benjamin Otte
2f72353e0e gtk-demo: Update aspect-ratio when selecting new puzzle 2018-07-13 14:56:04 +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
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
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