Matthias Clasen
ea17728ee5
Prototype a sysprof helper
...
This is an attempt to see how we can use sysprof data
in our tests to extract useful performance numbers.
Use it as a wrapper around any GTK+ process:
./testperf ./gtk4-widget-factory
Currently, it repeatedly runs the given commandline,
extracts the first css validation time from the resulting
syscap file, and prints out the min/max/avg of the runs
at the end.
This relies on the environment variable GTK_DEBUG_AUTO_QUIT
to cause the process to exit soon after launch.
2020-01-21 17:31:48 -05:00
Benjamin Otte
b9c81b1b94
widget: Initialize cssnode name asap
...
That way, it's correct in subclass's init functions.
2020-01-21 12:47:16 +01:00
Matthias Clasen
ec255f9bb1
Update all callers
2020-01-11 00:50:22 -05:00
Matthias Clasen
f33fe6daed
testdnd: Fix up for current api
2020-01-09 10:29:33 -05:00
Matthias Clasen
1c03bbeb9c
Update all users
2020-01-08 18:48:23 -05:00
Matthias Clasen
5e57b3d07a
testdnd2: Fix the text case
...
We must take mime types into account when checking.
2020-01-08 18:48:22 -05:00
Matthias Clasen
0297039b38
Add another dnd testcase
...
This one tests nested drop sites and interaction between
DND and other gestures.
2020-01-08 18:48:22 -05:00
Matthias Clasen
5206a92522
Update all callers
2020-01-08 18:48:22 -05:00
Matthias Clasen
009228471c
testdnd2: Use GDK content formats api
2020-01-08 18:48:22 -05:00
Matthias Clasen
c95659bf32
testdnd2: Update to the api change in the previous commit
2020-01-08 18:48:22 -05:00
Matthias Clasen
c1029535ca
testtoolbar: Use gtk_widget_add_controller for drag source
2020-01-08 18:48:21 -05:00
Matthias Clasen
a5ca5eb865
testlist3: Use gtk_widget_add_controller for drag source
2020-01-08 18:48:21 -05:00
Matthias Clasen
2227d2a2b5
testdnd2: Use gtk_widget_add_controller for drag source
2020-01-08 18:48:21 -05:00
Matthias Clasen
61559e38f4
testdnd: 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
508570864d
Remove gtk_drop_target_get_target
...
Now that drop targets are event controllers,
we can just use gtk_event_controller_get_widget.
Update all callers.
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
58106af54d
testdnd2: Add a test for ASK handling
...
It is a bit unfortunate that we need to extend the
lifespan of the drop object by keeping our own
ref, but I don't see a better way of doing it.
2020-01-08 18:48:20 -05:00
Matthias Clasen
74d445636c
testtreednd: Use the new asyn selection read
2020-01-08 18:48:20 -05:00
Matthias Clasen
7048790931
testlist3: Use async read api for selection
2020-01-08 18:48:20 -05:00
Matthias Clasen
cd7303d47c
testtreednd: Convert to GtkDropTarget
2020-01-08 18:48:20 -05:00
Matthias Clasen
0f9cbf49ac
testnotebookdnd: Fix, partially
...
Make this mostly work again.
2020-01-08 18:48:20 -05:00
Matthias Clasen
a309e74be7
testtoolbar: Convert to GtkDropTarget
2020-01-08 18:48:20 -05:00
Matthias Clasen
ccaf70e1b7
testlist3: Convert to GtkDropTarget
2020-01-08 18:48:20 -05:00
Matthias Clasen
2fd9431f23
testdnd: Convert to GtkDropTarget
2020-01-08 18:48:20 -05:00
Matthias Clasen
3f33a0ed27
testdnd2: Port to GtkDropTarget
2020-01-08 18:48:20 -05:00
Matthias Clasen
b4c689ecd6
tests: Convert to GtkDragSource
...
Some tests, such as testimage did not have
anything particularly worth keeping, so
were removed instead of fixed.
2020-01-08 18:48:19 -05:00
Matthias Clasen
337057eb35
entry: Port icon dnd to GtkDragSource
...
This requires a small change in the api,
since we need to provide a GdkContentProvider now.
2020-01-08 18:48:19 -05:00
Timm Bäder
1477882b31
testentryicons: Fix a memory leak
2020-01-07 17:27:16 +01:00
Matthias Clasen
96d2bf10b9
Add a text view mark/cursor test
...
This has testcases for some issues around invalidation
of marks.
2020-01-03 11:18:08 -05:00
Matthias Clasen
e56eb7b17b
testtooltips: Test tooltips on popovers
...
They do not currently work right.
2019-12-29 22:09:13 -05:00
Matthias Clasen
5c97f09796
tests: Stop using menus
2019-12-29 20:31:58 -05:00
Matthias Clasen
7078765903
Revert unintended changes
...
I didn't mean to make this a complicated
portal test. Go back to being a simple test.
2019-12-29 13:03:44 -05:00
Matthias Clasen
29e1dac1ff
testfilechooser: Test the choice apis
2019-12-25 09:47:22 -05:00
Christoph Reiter
8f8229dcd2
Fix various new mingw compiler warnings
...
These are the result of us missing CI for some time now and
MSYS2 having a newer GCC now I guess.
2019-12-18 09:25:06 +01:00
Chun-wei Fan
d51e3e835e
tests/: Revert bbb56d8
for non-UNIX
...
The portal bits are only supported on *nix, so use the old code on
non-*nix.
2019-12-17 00:52:25 +08:00
Matthias Clasen
bbb56d8216
Merge branch 'file-transfer' into 'master'
...
clipboard: file transfer portal support
See merge request GNOME/gtk!1244
2019-12-12 19:33:02 +00:00
Matthias Clasen
a20c8af678
clipboard: file transfer portal support
...
Implement file-list <-> application/vnd.flatpak.file-list
serialization by talking to the file transfer portal.
See https://github.com/flatpak/xdg-desktop-portal/pull/222
2019-12-12 14:25:33 -05:00
Benjamin Otte
f6bdfc32d3
tests: Set an existing font in testfontchooser
2019-12-12 19:50:55 +01:00
Matthias Clasen
3ee9b0cf4b
Make a test with a custom display
...
This completely breaks the inspector.
2019-12-07 10:03:42 -05: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
Timm Bäder
8ca46169b1
gl renderer: Blur shader improvements
...
Use a two-pass blur shader, fix a few other things and unify the
blurring of blur nodes and blurred outset shadow nodes.
Related to #1283
2019-12-03 08:40:34 +01:00
Timm Bäder
642ced0cfc
testblur: Fix default blur radius
...
sync it up with the adjustment value. also just add the destroyed
handler.
2019-12-03 08:40:34 +01: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
Matthias Clasen
d4180931f8
Merge branch 'seal-popover-menu' into 'master'
...
Privatize popover menu pieces
See merge request GNOME/gtk!925
2019-11-18 01:57:55 +00:00
Emmanuele Bassi
b70e4f6de9
Rename "iconify" to "minimize"
...
The "iconified" state is mostly an X11-ism; every other platform calls
this state "minimized" because it may not involve turning a window into
an icon at all.
2019-11-16 20:07:37 +00:00
Timm Bäder
f8303c7a22
testpopover: Plug two GtkBuilder leaks
2019-11-14 09:15:58 +01:00
Matthias Clasen
bfa0509f08
Privatize popover menu pieces
...
Don't allow manual creation of popover menus
anymore. This lets us also make GtkModelButton
private
2019-11-11 12:42:06 +01:00
Christian Hergert
5e341210a1
texthistory: add GtkTextHistory helper
...
The GtkTextHistory helper provides the fundamental undo/redo stack that
can be integrated with other text widgets. It allows coalescing related
actions to reduce both the number of undo actions to the user as well as
the memory overhead.
A new istring helper is used by GtkTextHistory to allow for "inline
strings" that gracefully grow to using allocations with g_realloc(). This
ensure that most undo operations require no additional allocations other
than the struct for the action itself.
A queue of undoable and redoable actions are maintained and the link for
the queue is embedded in the undo action union. This allows again, for
reducing the number of allocations involved for undo operations.
2019-11-05 09:34:29 -08:00
Matthias Clasen
dbbb7eef15
testicontheme: Remove useless function
...
Contexts in icon themes are not useful for anything,
so drop this function from testicontheme.
2019-10-18 08:53:23 -05:00
Timm Bäder
8928323c6b
popover2.ui: Stop trying to set GtkModelButton:label
...
The property is called "text"
2019-10-09 16:57:22 +02:00
Timm Bäder
c7203550a2
testmodelbutton: Remove toggles for removed properties
2019-10-09 16:57:22 +02:00
Christian Hergert
fea2a82ef6
textview: use GtkTextViewChild for border and overlay children
...
This creates a new GtkTextViewChild that can manage overlay children at
given x,y offsets in buffer coordinates. This simplifies GtkTextView by
extracting this from GtkTextWindow as well as providing a real widget for
the borders.
With this change, we also rename gtk_text_view_add_child_in_window() to
gtk_text_view_add_overlay(). For those that were using
GTK_TEXT_WINDOW_WIDGET, they can use a GtkOverlay. It does not appear
that anyone was using GTK_TEXT_WINDOW_(LEFT|RIGHT|TOP|BOTTOM) for widgets
in this fashion, but that can be done by setting a gutter widget with
gtk_text_view_set_gutter(). We can make GtkTextViewChild public if
necessary to simplify this should it become necessary.
GtkTextViewChild will setup a CSS node of either "text" or "border"
depending on the GtkTextWindowType.
The old GtkTextViewChild has been renamed to AnchoredChild as it is only
used for widgets with anchors in the GtkTextBuffer. This also removes the
use of allocated GSList and instead embeds a GQueue and GList to save a
few extraneous allocations.
2019-10-04 14:45:43 -07:00
Matthias Clasen
9501fc2c14
Merge branch 'nested-popover-menu' into 'master'
...
Nested popover menus
See merge request GNOME/gtk!1076
2019-09-10 01:09:31 +00:00
Timm Bäder
7d93e9963a
testlist2: quit on window close
2019-09-09 17:36:27 +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
590e70d4d1
icontheme: Return a paintable from gtk_icon_info_load_icon
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
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
Matthias Clasen
ea44eade21
Add nesting popover menus
...
Add a variant of popover menus that are nesting
like traditional menus. This is a better fit for
replacing traditional main menus.
2019-09-08 19:02:06 -04:00
Timm Bäder
1c8b746b42
testscale: Properly call gtk_main_quit
2019-08-09 14:30:01 +02:00
Jonas Ådahl
7f6c31c041
tests: Remove obsolete props from popover2.ui
2019-07-24 22:42:37 +02:00
Jonas Ådahl
a2ff6af4b3
tests: Add back testpopupat
...
It's still useful for testing menus. Fixed the .ui file by removing a
property that no longer exists.
This effectively reverts commit
84d2150077
.
2019-07-03 11:42:28 +02:00
Benjamin Otte
d541aed165
testgtk: Remove unused code
...
This code has been doing nothing since 2010 when the optionmenu was
removed in 274395063a
.
2019-06-18 15:53:01 -04:00
Timm Bäder
66b081dc9c
glglyphcache: Use stb_rect_pack for better glyph packing
2019-06-04 22:42:00 +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
Matthias Clasen
d2bc5b490a
tests: 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
5675d585f4
testgtk: Fix a crash
...
Somebody forgot to update the signal handler
here when changing the size-allocate signal.
2019-05-29 11:07:01 -04:00
Benjamin Otte
a079fd2def
widget: Fix transform refcounting in allocate()
...
Make the transform (transfer full).
1. This makes sure we actually reference the transform. Previously we
did not.
2. Most callers create a new transform to pass to us. Now they don't
have to uref it anymore.
2019-05-29 16:34:56 +02: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
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
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
6ab8ab87c8
Reimplement GtkPopover
2019-05-28 20:25:13 +00:00
Daniel Boles
037454d904
testscrolledwindow: GtkMenuButton != GtkContainer
...
It's not anymore, so don't cast it to one... Use the new :label instead.
2019-05-21 21:21:01 +01:00
Benjamin Otte
5273634f47
tests: Use g_free(), not free()
...
Windows doesn't like that.
2019-05-21 07:23:30 +02:00
Benjamin Otte
a1d08b4b52
rendernode: Take a graphene_point_t for the offset
...
... instead of 2 floats.
2019-05-21 06:43:59 +02:00
Matthias Clasen
5368f98dd5
demos: Stop using gtk_button_clicked
2019-05-18 14:33:41 -04:00
Timm Bäder
dde69802cd
Add error func to node deserialization
2019-05-05 07:18:39 +02:00
Matthias Clasen
c9eca55c5e
tests: Stop using gtk_menu_set_display
...
It is not needed here.
2019-05-01 21:54:57 +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
fe3b5ba545
tests: Stop using gtk_widget_get_parent_surface
...
We can just use the surface of the parent.
2019-04-24 20:57:09 -04:00
Benjamin Otte
84d2150077
tests: Remove popupat test
...
The test hasn't worked for a while and nobody cared to fix it.
Neither do I.
2019-04-15 14:38:23 +02:00
Benjamin Otte
117fc68195
tests: Remove testboxcss
...
That test was cool in 2011, but hasn't been updated or used since then
because its features are now part of widget-factory and the inspector.
So let's remove it.
2019-04-12 19:34:29 +02: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
0a4a7b310d
testgtk: Stop using child properties
2019-04-05 12:01:43 +00:00
Matthias Clasen
f184393f07
Remove testactionbar
...
This test relies on child properties.
2019-04-05 12:01:43 +00:00
Matthias Clasen
1f37600c4c
Remove testtitlebar
...
This test relies on 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
9700543e02
tests: Update GtkGrid definitions in UI files
2019-04-05 00:20:45 +01:00
Matthias Clasen
09cd6e3b5f
Fix teststack
...
This testcase wasn't updated to new GtkStack apis.
2019-04-03 15:10:10 +00:00
Emmanuele Bassi
447dfc029f
Remove GtkLayout
...
The need of a specialised fixed layout container that can be placed into
a GtkScrolledWindow ceased to exist once GtkScrolledWindow gained the
ability to automatically interpose a GtkViewport when adding a child
that does not implement GtkScrollable.
All the other justifications that led to the existence of GtkLayout as a
separate widget from GtkFixed have been largely made irrelevant in the
20 years since its inception.
2019-04-02 15:29:20 +01:00
Matthias Clasen
53a28f7672
testrevealer: Cover the new transitions
...
Add tests for all the swing transitions.
2019-03-29 10:54:45 -04:00
Matthias Clasen
700183e5b6
Convert ui files
...
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-28 16:37:21 -04:00
Matthias Clasen
14ad26a599
Convert ui files
...
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 18:40:40 -04: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
Matthias Clasen
de741e57f3
tests: Stop using gtk_window_set_gravity
...
This api is going away.
2019-03-26 17:55:29 -04:00
Matthias Clasen
27c286773c
tests: Stop using gtk_window_move
...
It is going away.
2019-03-26 17:55:29 -04:00
Matthias Clasen
6b6f26ed45
Add a window move/resize test
2019-03-26 15:57:04 -04:00
Matthias Clasen
7ca24f12d7
window: Remove initial-focus builder support
...
With focus-widget now a property, this is no longer needed.
2019-03-16 21:24:45 -04:00
Matthias Clasen
2bf1561b48
Port widgets to the root focus API
2019-03-16 21:24:44 -04:00
Matthias Clasen
a3b73a416e
password entry: Add a way to see the content
...
Add a ::show-peek-icon property and show a clickable
icon when it is set. Clicking it toggles the visibility
of the content. The same functionality is also accessible
via a context menu item.
This is a common feature of password entries.
2019-03-14 20:31:45 -04:00
Benjamin Otte
0e1a50366a
transform: Move to GSK
...
The renaming of the prefix makes this a large patch.
2019-03-04 23:09:02 +01:00
Timm Bäder
f35b8a7541
Fix compile time warnings
2019-03-02 05:28:55 +01: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
41c0ac1a68
Merge branch 'overlay-cleanup' into 'master'
...
Overlay cleanup
See merge request GNOME/gtk!600
2019-02-22 03:38:20 +00:00
Matthias Clasen
f8609efa2b
testoverlay: Use gtk_widget_set_can_pick
...
Use gtk_widget_set_can_pick instead of the
overlay-specific api with the same purpose.
2019-02-21 21:55:05 -05:00
Matthias Clasen
3487ebe4fd
remove tests that no longer work
2019-02-21 19:46:38 -05:00
Benjamin Otte
e8b5056940
And another keybinding leftover
2019-02-22 00:07:35 +01:00
Benjamin Otte
c24f32619f
widget: Make gtk_widget_allocate() take a GtkTransform
...
We can reason about GtkTransform way better - and determine its category or
do equality checks.
2019-02-21 19:47:27 +01:00
Benjamin Otte
01f7f255b5
gtk: Check return value of compute_bounds()
...
Half of these calls will completely break if anybody ever uses CSS
transforms with them, but hey...
2019-02-20 05:26:31 +01:00
Timm Bäder
8ce6cf569f
Add test for widget transforms
2019-02-19 19:22:10 +01:00
Matthias Clasen
22ea832eb3
Fix testtreesort warnings
2019-02-19 00:25:59 -05:00
Matthias Clasen
210c5d88a2
Add a test for GtkPassworkEntry
2019-02-19 00:25:59 -05:00
Matthias Clasen
e5e2bd3187
Drop GtkAssistantPage::has-padding
...
This is causing us some internal complications, and
it is very easy to just add padding to the pages
yourself.
2019-02-15 10:23:48 -05:00
Emmanuele Bassi
61fbd5b541
tests: Fix comment for accuracy
...
The command line for compiling testwindowsize has changed.
2019-02-06 10:41:49 +01:00
Timm Bäder
55b99e9916
window: Remove icon list
2019-02-05 08:11:43 -05: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
Timm Bäder
25e199e7b7
testgtk: Fix image menu item child order
...
We want the image first, text second.
2019-02-04 17:05:30 +01:00
Emmanuele Bassi
3bb1423804
tests: Remove spurious gtk_container_add()
...
Commit bd71e744d2
removed
gtk_box_pack_end(), but it added a gtk_container_add() with an
uninitialised widget, and the compiler is very unhappy about it.
2019-02-04 10:03:33 +01:00
Matthias Clasen
b0e67f1eed
testcombo fixup
2019-01-23 22:52:16 -05:00
Matthias Clasen
f87e40bccd
Drop a grid combo example
2019-01-23 22:45:55 -05:00
Matthias Clasen
e2693ef44f
testgtk: Drop tabular menu
...
Tabular menus are basically unused, and we want to drop this.
2019-01-23 22:40:53 -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
28c51175d8
box: Remove pack-type child property
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
09361e7665
tests: Remove flicker test
...
gtk+ hasn't been flickering in ages so this test isn't very useful.
2019-01-23 19:30:46 -05:00
Timm Bäder
4dc8ab58a3
testoverlay: Re-enable blurring
...
Accidentally disabled in 8b14c8d0a8
2019-01-13 08:23:25 +01:00
Timm Bäder
8b14c8d0a8
testoverlay: Fix fancy effect
2019-01-10 16:49:19 +01:00
Timm Bäder
ad93806005
showrendernode: Fix GtkImage size
...
Make sure we show the paintable unscaled.
2018-12-02 16:14:31 +01: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
Timm Bäder
75deff035b
testappchooserbutton: Fix for class hierarchy change
2018-11-13 15:19:07 +01:00
Timm Bäder
45b909f2c5
testpopup: Fix GtkEventControllerMotion::motion callback signature
2018-11-08 05:48:14 +01:00
Daniel Boles
18199a3cef
testtreelistmodel: Don't use non-standard function
...
as per efd3758f6a
strcasecmp() is not a C
standard thing (not that we bothered including any header for it anyway)
and so this test failed to build on Windows with Microsoft Visual C.
2018-11-07 20:32:55 +00:00
Carlos Garnacho
f3674688bf
tests: Drop "saved positions" test in testgtk
...
This test solely relies on configure events, which aren't supported anymore.
2018-10-15 20:05:54 +02:00
Carlos Garnacho
dd6aa7b870
tests: Drop ::event handler in testgtk
...
We can use ::size-allocate for it, as window positions in root coordinates
are neither supported nor crucial here.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
3c73f70dae
tests: Use GtkEventControllerMotion in testpopup
...
Track motion through it, instead of a GtkWidget::event handler.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
65fbd0af4e
tests: Remove ::event handler in testwindowsize
...
We just want widget size here, not windowing configuration events.
2018-10-15 17:39:04 +02:00
Manu Cornet
a0056d5ca8
Remove some duplication in testfilechooserbutton
...
Most of the code creating the two types of dialogs (open file,
choose folder) is the same. This refactors the common code into a
helper method. This also makes it easier to add other chooser types
for this test (e.g. save file).
2018-09-17 12:27:46 +00:00
Benjamin Otte
ee5708f543
testtreelistmodel: Display the file icon, because why not
2018-09-16 18:50:17 +02:00
Benjamin Otte
b94b8ac38d
testtreelistmodel: Make the statusbar display more info
...
Now display how many items were filtered (if any) and how many
directories remain to be sanned (if any).
2018-09-16 18:50:17 +02:00
Benjamin Otte
afd69db678
testtreelistmodel: Sort files by name
2018-09-16 18:50:17 +02:00
Benjamin Otte
64b7c123cc
testtreelistmodel: Add search
...
Add a simple search that does a case insensitive substring search of the
file paths.
2018-09-16 18:50:17 +02:00
Benjamin Otte
fcb780ee13
testtreelistmodel: Make the directory loading async
...
This is way more complicated than it should be, because it requires
manually limiting the number of open file enumerators.
On the other hand, it exhaustively tests the items-changed emission of
all involved listmodels because those signals come in pretty much
randomly.
It's also 50% slower than the sync version, with the caeat that the sync
version only shows the UI after it's done loading, while this version
shows it right away.
2018-09-16 18:50:17 +02:00
Benjamin Otte
65b795b861
testtreelistmodel: Add a hack to handle LONG lists
...
... and make the lists long by autoexpanding the tree.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4b5fb5ec79
treelistmodel: Refactor to add GtkTreeListRow
...
This patch does multiple things:
1. Add a custom persistent per-row object.
2. Move all per-row API to that object. This means notifications are now
possible.
3. Add a "passthrough" construct-only property to the TreeListModel that
influences if the model returns these new object or passes through
the ones from the model.
This greatly simplifies the code needed to be written for widgetry,
because one can just connect the per-row object to the expanders that
expand and collapse rows.
As an added power feature, these objects can also be passed through
further models (like filter models).
It also adds kind of a hack to Adwaita to make the test look neat.
2018-09-16 18:50:17 +02:00
Benjamin Otte
573c63973a
gtk: Add GtkTreeListModel
...
This is a GListModel implementation with a neat API that can be used to
implement trees inside GtkListBox.
2018-09-16 18:50:17 +02:00
Timm Bäder
0082675de8
testoverlaystyleclass: Fix CSS snippet
2018-08-27 18:13:01 +02:00
Timm Bäder
ed8e784879
remove tests/testinput
...
It's broken and almost the exact same thing as the drawing demo in
gtk4-demo.
2018-08-27 17:56:02 +02:00
Benjamin Otte
50d5666db0
container: Remove focus chains
...
They're prectically unused.
Widgets who want to influcence the focus chain behavior should implement
GtkWidgetClass::focus and deal with focus there.
2018-07-31 22:34:27 +02:00
Carlos Garnacho
5d1b2f627c
tests: Port testwidgetfocus to using a motion controller
2018-07-30 13:14:12 +02:00
Carlos Garnacho
25b3b90920
tests: Port motion-compression to using a motion controller
2018-07-30 13:14:12 +02:00
Carlos Garnacho
5e0f2d7d20
tests: Use gesture in testtreepos
2018-07-30 13:14:12 +02:00
Carlos Garnacho
88743ab975
tests: Use gesture to popup menu in testiconview
2018-07-30 13:14:12 +02:00
Carlos Garnacho
6f15447633
tests: Update testgrid to use gestures
2018-07-30 13:14:12 +02:00
Jonas Ådahl
af21583d4d
tests: Stop using legacy gtk_menu_popup API
...
Use the new portable APIs, so that menus will be positioned properly on
all backends.
2018-07-27 17:16:44 +02:00
Ernestas Kulik
1fbbaef49e
testpopover: Don’t set margin in menu box
...
The gizmo already provides sufficient padding.
2018-07-23 13:05:57 +03:00
Matthias Clasen
7a1073c3ae
Revert "gdk: Drop configure events"
...
This reverts commit a8926c9d87
.
2018-07-15 20:23:45 -04:00
Matthias Clasen
a8926c9d87
gdk: Drop configure events
...
Replace configure events with a GdkSurface::size-changed signal.
This is part of the move to use events only for input.
2018-07-15 11:51:09 -04: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
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
b00609c21c
dnd: Make drag-motion and drag-drop signals use GdkDrop
2018-06-18 23:49:52 +02:00
Benjamin Otte
6d7cb2b781
dnd: Make drag-data-received use a GdkDrop
2018-06-18 23:49:52 +02:00
Benjamin Otte
314eaf7d10
widget: Make GtkWidgetClass::drag_leave() take a GdkDrop
...
Drag Contexts are on their way out!
2018-06-18 23:49:20 +02:00
Benjamin Otte
5b0a6a52c1
dnd: Get rid of gtk_drag_finish()
...
It's just a wrapper around gdk_drag_finish(), so use that one instead.
2018-06-18 23:49:20 +02:00
Benjamin Otte
4f3058f195
eventcontrollermotion: 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
4ddc94b293
multipressgesture: Port to new API model
2018-04-26 17:59:42 +02:00
Daniel Boles
1e5c79ed47
testentrycompletion: Use the model we already got
...
cherry-pick of gtk-3-22 commit af350b20b1
2018-04-24 13:45:49 +01: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
Ting-Wei Lan
43a7f36993
gtk-demo, testgtk: Don't pass an integer to fabs
...
It looks like a mistake which compilers are likely to warn.
2018-04-22 21:59:13 +08:00
Ting-Wei Lan
f922109a9c
build: Make the default setting work on non-Linux Unix-like systems
...
All of the four platform-dependent backends are enabled by default. It
is usually a good default because it requires users to explicitly choose
backends they want to use. Rules in meson.build also automatically
disable unavailable backends for macOS, Windows, Linux, so users on
these 3 major platforms don't have to manually disable things when
running meson commands.
However, meson.build doesn't do the same thing for other Unix-like
systems, which is acceptable but not ideal. To make it easier to build
GTK+ on these systems, the Linux case, which enables X11 and Wayland and
disables Win32 and Quartz, is made the default for all operating systems
that are not Windows or macOS.
This commit also changes most 'host_machine.system()' calls to os_*
variables, which are easier to read and less likely to be used wrongly.
2018-04-22 21:57:10 +08:00
Benjamin Otte
af6b2cdb37
testgtk: Don't set cairo surfaces as icons
...
The code expects textures these days, so use those.
2018-04-12 14:03:48 +02:00
Benjamin Otte
b9c8c146d2
tests: Use gdk_texture_save_to_png() where appropriate
2018-04-12 14:02:59 +02:00
Daniel Boles
8d8db89669
testmodelbutton: Test :centered, :icon, :inverted
...
Test more stuff.
2018-04-08 18:48:16 +01:00
Daniel Boles
15b569e64d
testmodelbutton: Fix wrongly overridding MB child
...
I was setting a GtkButton:label, which resulted in the ModelButton's own
custom children getting lost. That doesn't make for a useful test...
2018-04-08 18:48:16 +01:00
Daniel Boles
08126ffdf2
testmodelbutton: Add explanatory comments to CSS
...
and load at an earlier, more sensible place, before creating any widgets
2018-04-08 18:48:16 +01:00
Daniel Boles
5bbb185e14
tests/testmodelbutton: Add this
...
and test whether :action-name, :role, and CSS nodes work as expected
https://gitlab.gnome.org/GNOME/gtk/issues/163
2018-04-08 13:17:18 +01:00
Matthias Clasen
75024fea60
testgtk: Drop snapshot
...
This needs to be redone with modern snapshotting infrastructure.
Lets drop it for now, it is somewhat duplicative with inspector
features.
2018-04-05 19:26:53 +02:00
Matthias Clasen
98f31e61d7
testgtk: Drop the event watcher
...
This is not a very useful test, and it is hard to keep working
in an event controller world.
2018-04-05 19:26:53 +02:00
Benjamin Otte
1aacb14236
testgtk: Remove draw signal usage
2018-04-05 14:57:10 +02:00
Benjamin Otte
c85547667f
testgtk: Take an actual snapshot of a widget
...
Don't just draw the widget, take the paintable of it instead!
2018-04-05 14:56:39 +02:00
Benjamin Otte
a595a4c2ce
testlist3: Set the actual row as drag icon
...
(Well, don't do anything actually, because dnd is broken, but
in theory...)
2018-04-05 14:56:39 +02:00
Benjamin Otte
ffc7b2bb0a
snapshot: Allow passing the bounds of the created paintable
...
This allows being more specific about the size.
It's useful in particular when the resulting render nodes might be
too small for the size, not only when they are too large. For the
latter case, using a clip node would be enough.
It also requires adding a clip node when rendering the resulting
paintable, but that should be optimized out by GtkSnapshot when not
necessary.
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
e3a717363b
snapshot: Remove clip argument from gtk_snapshot_new()
...
It's not used anymore. And anybody who wants to have a clip on a
newly created snapshot can achieve that using gtk_snapshot_push_clip().
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
Timm Bäder
c2c1262766
testgtk: don't set a focus adjustment on a box
...
That will make the focus adjustment code in gtkcontainer.c scroll to the
wrong coordinates.
2018-03-28 16:32:47 +02:00
Benjamin Otte
cc9908353c
tests: Don't use gtk_drag_set_icon_surface()
2018-03-26 18:30:34 +02:00