Commit Graph

3119 Commits

Author SHA1 Message Date
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