Benjamin Otte
2bdc0748e5
snapshot: Remove gtk_snapshot_get_offset()
...
We use append() functions for everything now, thank you very much.
2019-02-21 19:47:28 +01:00
Benjamin Otte
1ef250f44a
snapshot: Add functions to append shadows
2019-02-21 19:47:28 +01:00
Benjamin Otte
0d119f81c8
snapshot: Refactor text rendering
...
The code didn't change, it was just shuffled around to make the
with_bounds() versions of the text rendering unnecessary and instead
pass through the generic append_node() path.
2019-02-21 19:47:28 +01:00
Benjamin Otte
e1570e9ebc
snapshot: Add gtk_snapshot_append_border()
...
This is adding functions for the remaining render nodes.
2019-02-21 19:47:28 +01:00
Benjamin Otte
4a293aa762
snapshot: Store an actual GtkTransform
...
Instead of just tracking 2 integer translate_x/y coordinates, tracka a
full GtkTransform.
When creating actual nodes, if the transform is simple enough, just
create the node in a way that makes use of the transform. If the
node, can't represent the transform, just push a transform node instead
and automatically pop that node with the next gtk_snapshot_pop() call.
2019-02-21 19:47:28 +01:00
Benjamin Otte
f0142b9c4b
snapshot: Remove dead code
...
Seems to be leftovers from way too long ago.
2019-02-21 19:47:28 +01:00
Benjamin Otte
6a4bf2b993
gsk: Remove offset nodes
...
They were a neat idea while they lasted. But now, it's time for
categorized transform nodes, where matrices with
GSK_MATRIX_CATEGORY_2D_TRANSLATE are the exact replacement.
Renderers have not been adapted for this purpose, so they (continue to)
run slow paths.
2019-02-21 19:47:28 +01:00
Benjamin Otte
f5b44c11c8
widget: Store category of widget transform
...
And pass that category through to the transform node that we create for
it.
2019-02-21 19:47:28 +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
49d83820a2
gtk: Add GtkTransform
...
This is a new object (well, boxed type, but I'm calling it object) for
dealing with transform in a more constructive way than graphene_matrix_t
by keeping track of how the transform was created.
This way, reasoning about the transform becomes easier, and we can create
better ways to print it or transition from one transform to another one.
An example of this is that while a 0 degree and a 360degree rotation are
both the identity matrix, doing a transition between the two would cause
a rotation.
2019-02-21 19:47:27 +01:00
Benjamin Otte
70a1233a28
gsk: Add GskMatrixCategory
...
We'll use that soon.
2019-02-21 19:47:27 +01:00
Matthias Clasen
96fa1fb5c1
Drop key themes
...
These were an abuse of css, and not very successful
as a concept. We are going to replace bindings with
a new way of doing customizable shortcuts.
2019-02-21 12:22:50 -05:00
Piotr Drąg
ffee2d4567
window: Rename GTK+ Inspector in user-visible strings
2019-02-21 17:49:44 +01:00
Piotr Drąg
8e97dc03de
assistant: Fix typo in a translatable string
2019-02-21 13:28:37 +01:00
Matthias Clasen
f95ed63b88
Merge branch 'nbpage' into 'master'
...
Notebook child metas
See merge request GNOME/gtk!594
2019-02-21 05:50:05 +00:00
Matthias Clasen
0961fe7a55
notebook: Fix up issues with property notification
2019-02-21 00:31:17 -05:00
Matthias Clasen
66b6824876
print dialog: Use notebook pages in ui file
...
This is the new way of doing things.
2019-02-21 00:31:17 -05:00
Matthias Clasen
0fe1091ba8
builder-tool: Rewrite notebooks
...
Just like we do for assistant and stack pages, rewrite
notebooks from child properties to child metas.
2019-02-21 00:31:17 -05:00
Matthias Clasen
f64b0a705e
Implement position property somewhat
2019-02-21 00:31:17 -05:00
Matthias Clasen
c1ad7217b5
notebook: Fix up ref counting
...
We need to keep a ref to the page objects.
2019-02-21 00:31:17 -05:00
Matthias Clasen
f11d0118a3
notebook: Add a pages model
...
Just like GtkStack and GtkAssistant, provide
a list model with the page objects.
2019-02-21 00:31:17 -05:00
Matthias Clasen
7f8ba95db5
Allow builder to add notebook pages
2019-02-21 00:31:17 -05:00
Matthias Clasen
ff4b3f1170
Turn labels into page properties
2019-02-21 00:31:17 -05:00
Matthias Clasen
78c54b27d7
Add GtkNotebookPage properties
2019-02-21 00:31:17 -05:00
Matthias Clasen
85fb368834
Make GtkNotebookPage an object
2019-02-21 00:31:17 -05:00
Matthias Clasen
0e29408215
notebook: Rename an internal macro
...
Avoid a clash between GObject boilerplate and the
GTK_NOTEBOOK_PAGE() macro, by renaming it.
2019-02-21 00:31:17 -05:00
Matthias Clasen
3df4d1440a
assistant: Remove weak pointer in finalize
...
Otherwise, bad things can happen later, if
somebody holds onto the list model.
2019-02-21 00:31:17 -05:00
Matthias Clasen
103637f3b9
text: Remove has-frame leftovers
2019-02-21 00:30:48 -05:00
Matthias Clasen
74f4aecef5
text: Make this a final class
...
No need to derive from it.
2019-02-20 13:11:17 -05:00
Matthias Clasen
2e9c7d0744
search entry: Quiet a compiler warning
2019-02-20 13:10:09 -05:00
Matthias Clasen
2e94891a6f
Merge branch 'wip/jimmac/unbreak-spinbuttons' into 'master'
...
Adwaita,HC: spinbutton selectors
See merge request GNOME/gtk!592
2019-02-20 18:04:16 +00:00
Matthias Clasen
b9a41a903b
Merge branch 'wip/carlosg/fix-search-entry' into 'master'
...
Fix search bars
See merge request GNOME/gtk!593
2019-02-20 17:02:15 +00:00
Carlos Garnacho
b741d36ced
inspector: Update callback to GtkText shuffling
...
Instead of trying to access the GtkText, use GtkEditable API.
2019-02-20 16:41:39 +01:00
Matthias Clasen
82bde1e10a
text: Remove the ::has-frame property
...
This is purely GtkEntry functionality and should
remain there.
2019-02-20 10:34:42 -05:00
Matthias Clasen
eb8b1095c8
emoji chooser: Don't use entry api on search entries
...
Use editable api, and cut through to the text widget
where necessary.
2019-02-20 10:32:12 -05:00
Matthias Clasen
b303c20570
search entry: Add private api to get the text widget
...
We need this to do some custom setup in the Emoji chooser.
2019-02-20 10:29:26 -05:00
Jakub Steiner
4dd7eb40a3
Adwaita,HC: spinbutton selectors
...
- spinbuttons use GtkText for the entry part
- FIXME: vertical spinbuttons need the flat class dropped so we can
extend the entry class easily
2019-02-20 14:08:44 +01:00
Carlos Garnacho
19bf937401
eventcontrollerkey: Use run_controllers() API to forward key events
...
All 3 phases are run ATM, but just on the specific widget.
2019-02-20 13:16:07 +01:00
Carlos Garnacho
9ca392b38d
gtkwidget: Expose gtk_widget_run_controllers() in private header
...
Allows for more fine grained access than gtk_widget(_captured)_event
which are meant to work across a hierarchy.
2019-02-20 13:16:07 +01:00
Carlos Garnacho
c739071d31
gtksearchentry: Forward captured events to the child GtkText
...
Catch up with the GtkEditable shuffling.
2019-02-20 13:15:16 +01:00
Carlos Garnacho
120ee17e09
gtksearchbar: Do not handle captured events for unmapped bars
...
If the bar is currently unmapped, it should not attempt to capture
and handle events.
Related: https://gitlab.gnome.org/GNOME/gtk/issues/1205
2019-02-20 13:15:16 +01:00
Benjamin Otte
02e856f62e
widget: Mark compute functions as G_GNUC_WARN_UNUSED_RESULT
...
Lots of code does not error-check these functions, and when we add CSS
transforms, they will start failing. And we want people to check that.
2019-02-20 05:26:39 +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
Benjamin Otte
514c3679dc
widget: Always set out value
...
Don't leave memory in an unitinialized case when returning FALSE from
gtk_widget_compute_transform().
We both know that people are going to call that function without
checking the return value.
2019-02-20 04:07:34 +01:00
Benjamin Otte
8fbfa955de
widget: Fail if matrix not invertible
2019-02-20 04:05:37 +01:00
Benjamin Otte
cfc7dc016e
widget: Add optimizations to gtk_widget_compute_transform()
...
Try to catch 2 common cases with as little work as necessary.
2019-02-20 04:04:29 +01:00
Benjamin Otte
8222631d63
widget: Clean up gtk_widget_compute_transform()
...
The code was all over the place and being clear here is very useful.
2019-02-20 03:48:41 +01:00
Matthias Clasen
93b47c12d7
Fix gtk_widget_compute_transform
...
We were collecting all the transforms from widget
up to ancestor, and then trying to collect the
ones from target to ancestor, but failing.
2019-02-19 19:31:16 -05:00
Benjamin Otte
9a8082bab2
widget: Remove gtk_widget_get_allocated_size()
...
Use gtk_widget_get_allocated_width/height in the only user (GtkStack),
even though that isn't 100% correct.
2019-02-19 19:29:58 +01:00
Benjamin Otte
e223f16aa9
widget: Add gtk_widget_compute_point()
...
It's the replacement for gtk_widget_translate_coordinates()
2019-02-19 19:22:10 +01:00
Benjamin Otte
dead174d70
Remove nonexisting function from header
2019-02-19 19:22:10 +01:00
Timm Bäder
e922ec1839
widget: Compute child point directly when picking
2019-02-19 19:22:10 +01:00
Timm Bäder
63a23ed0da
widget: Remove unused function
2019-02-19 19:22:09 +01:00
Timm Bäder
2ecb4003be
widget: Avoid some type checks in pick() and contains()
...
We've already verified that the given pointer is a proper GtkWidget, so
no need to do it all over again.
2019-02-19 19:22:09 +01:00
Timm Bäder
a953fd762e
widget: Add typecheck-less _is_sensitive
...
It adds up to a whopping 3% in gtk_widget_pick
2019-02-19 19:22:09 +01:00
Timm Bäder
dbf0654e5b
widget: Add gtk_widget_compute_transform
2019-02-19 19:22:09 +01:00
Timm Bäder
4529f52c02
widget: Use CSS boxes in gtk_widget_real_contains()
2019-02-19 19:22:09 +01:00
Matthias Clasen
63a8bd06a6
stack sidebar: Fix sorting
...
Fix sorting, by not sorting.
2019-02-19 11:23:28 -05:00
Matthias Clasen
7c6e3e31c7
Merge branch 'portal-session-state-master' into 'master'
...
Portal session state
See merge request GNOME/gtk!587
2019-02-19 12:35:14 +00:00
Matthias Clasen
d006ee65f5
application: Add a query-end signal
...
This lets us take just-in-time inhibitors, and makes
the session support a little more real.
2019-02-19 00:56:31 -05:00
Matthias Clasen
65e9d71da5
Application: Support sandboxed session state changes
...
React to the session-state in StateChanged signals from
the inhibit portal and call QueryEndResponse as appropriate.
2019-02-19 00:56:31 -05:00
Benjamin Otte
02bb364474
widget: Remove lefover debug code
...
According to someone involved with those lines, I suck at reviewing
their patches.
2019-02-19 06:50:34 +01:00
Matthias Clasen
9174616a17
Merge branch 'text' into 'master'
...
GtkEntry reshuffling
Closes #1483
See merge request GNOME/gtk!585
2019-02-19 05:45:44 +00:00
Matthias Clasen
0ef6c3afed
search entry: Add a tooltip to th clear icon
...
Similar to what we do for the caps-lock warning in the
password entry.
Closes #1483
2019-02-19 00:32:35 -05:00
Matthias Clasen
b299ac8dfa
Add editable delegate api to docs
...
And add a section that explains how to use these
functions when setting up a GtkEditable delegate.
2019-02-19 00:25:59 -05:00
Matthias Clasen
08bd6904b9
file chooser: Use editable api on the search entry
2019-02-19 00:25:59 -05:00
Matthias Clasen
37b841b59b
font chooser: Use editable api on search entry
2019-02-19 00:25:59 -05:00
Matthias Clasen
7d9e63ae38
app chooser: Use editable api on search entry
2019-02-19 00:25:59 -05:00
Matthias Clasen
b8c981fb2b
inspector: Work with new search entry
...
Don't assume a search entry is an entry, and
use the editable api as far as possible.
2019-02-19 00:25:59 -05:00
Matthias Clasen
3a1a7c43f3
treeview: make search work
...
Make search work with both GtkEntry and GtkSearchEntry,
even if a GtkSearchEntry is not derived from GtkEntry
anymore.
2019-02-19 00:25:59 -05:00
Matthias Clasen
fa3d1940bf
search bar: Work with the new GtkSearchEntry
...
Don't assume a search entry is an entry, and use
the editable api as far as possible.
2019-02-19 00:25:59 -05:00
Matthias Clasen
667ea2dd42
search entry: Use a GtkText
2019-02-19 00:25:59 -05:00
Matthias Clasen
c6e6fb19e7
Add GtkPasswordEntry
...
This is a simple editable which hides the entered
text and shows a caps-lock warning.
2019-02-19 00:25:59 -05:00
Matthias Clasen
39d5f9e07b
entry completion: Make this work again
...
Connect to GtkText signals where necessary.
2019-02-19 00:25:59 -05:00
Matthias Clasen
cbbc7dd70f
treeview: use a GtkText as search entry
2019-02-19 00:25:59 -05:00
Matthias Clasen
a31da76f95
treeview: Disable some search entry functionality
...
This needs to be rewritten. Until then, keep it limping along.
2019-02-19 00:25:59 -05:00
Matthias Clasen
8bb6d00ce2
search entry: temporarily disable some functions
...
The search entry needs to be rewritten to use a
text child until then, keep it limping along.
2019-02-19 00:25:59 -05:00
Matthias Clasen
1930c74736
spin button: Use GtkText
...
We already use GtkEditable api throughout. This just
means we create a GtkText instead of a GtkEntry.
2019-02-19 00:25:59 -05:00
Matthias Clasen
ea098f8d51
entry accessible: Make this work with the text widget
2019-02-19 00:25:59 -05:00
Matthias Clasen
45fb1d06e3
entry: Delegate to GtkText
...
Use a GtkText child, and delegate the editable functionality
to it. Also forward all the properties that are provided by
GtkText.
Some of the more internal APIs, such as layout and im context
access and caps-lock warning, are removed here, but we preserve
most of the plain GtkEntry API by forwarding it to the GtkText
child.
2019-02-19 00:25:59 -05:00
Benjamin Otte
d247e5707d
widget: Fix gtk_widget_size_allocate()
...
Compute the matrix for adjusted sizes etc properly.
2019-02-19 05:52:11 +01:00
Benjamin Otte
36ac867ea9
recorder: Print the matrix for transform nodes
2019-02-19 05:52:11 +01:00
Matthias Clasen
936181f354
Add a GtkTextAccessible
...
Add an accessible implementation for GtkText.
2019-02-18 14:24:21 -05:00
Matthias Clasen
fcb58887fa
Make emoji completion work for GtkText
...
GtkEntry will stop using it directly in the following commits.
2019-02-18 14:24:21 -05:00
Matthias Clasen
1801bf6d83
Add a GtkText widget
...
This is a GtkEntry without any of the extras, such as
icons, completion, progress, caps-lock warning, emoji icon.
2019-02-18 14:24:21 -05:00
Matthias Clasen
b9c8dd64b3
spin button: Implement and use editable interface
2019-02-17 23:07:18 -05:00
Matthias Clasen
32795963c0
entry: Implement new editable iface
2019-02-17 23:07:18 -05:00
Matthias Clasen
7325f8e204
editable: Add more to interface
...
Add all the things to the GtkEditable interface that
make sense for most implementations.
2019-02-17 23:07:17 -05:00
Timm Bäder
c9d9f8b750
flowbox: Implement get_child_at_pos properly
...
With transforms in the mix, checking if the coordinate is inside the
widget "allocation" makes even less sense. Just use gtk_widget_pick()
and walk up until we find a GtkFlowBoxChild.
2019-02-16 15:45:06 +01:00
Timm Bäder
ca2c05cdb3
widget: Push a transform node if we need to
...
This is the same as the old code since the transformation only contains
teh offset right now, but it will be different later where arbitrary
transformations are possible per widget.
2019-02-16 15:44:46 +01:00
Timm Bäder
10e5856583
widget: Save transform as matrix
...
The transform matrix is a translation matrix from the parent's origin to
the widget origin. We will later allow more transformations than just
translations.
2019-02-16 15:44:37 +01:00
Timm Bäder
0739399766
paned: Implement increased handle area using pick()
...
Otherwise, we do report the widgets below the invisible handle area as
hovered or active.
2019-02-16 11:19:29 +01:00
Matthias Clasen
bea1a02edd
Merge branch 'wip/otte/boxes' into 'master'
...
GtkCssBoxes
See merge request GNOME/gtk!584
2019-02-15 16:12:26 +00:00
Matthias Clasen
74d6d81db9
Merge branch 'assistant-cleanup' into 'master'
...
Assistant cleanup
See merge request GNOME/gtk!581
2019-02-15 15:54:53 +00: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
Matthias Clasen
d327d3fab2
assistant: Use a stack
...
We don't use any non-stack features of the notebook here.
2019-02-15 10:23:48 -05:00
Matthias Clasen
fb4f5e0a78
assistant: Add docs
...
Without this, introspection complains about a missing
transfer annotation.
2019-02-15 10:23:48 -05:00
Benjamin Otte
c44c44ee25
css: Pass boxes to the render functions
...
Instead of style + rect_of_one_box, pass the new GtkCssBoxes object.
This has the nice side effect that when drawing background + border +
outline, we only compute all the boxes we need once.
2019-02-15 06:53:22 +01:00
Benjamin Otte
7ad0f7fc52
css: Mark some hot functions as G_GNUC_PURE
...
By doing that, gcc will generate code that avoids calling these
functions when not needed.
2019-02-15 06:53:22 +01:00
Benjamin Otte
285aba6ece
widget: Make width, height and transform be widget-relative
...
Previously, those numbers stored the values relative to the margin box
of the widget. Now they store values relative to the content box,
thereby getting rid of the last remains of weird coordinate systems.
2019-02-15 06:53:22 +01:00