Alexander Larsson
275185d415
widget: Avoid typechecks when accessing ->clip and ->allocation
2017-01-11 15:30:30 +01:00
Alexander Larsson
8cabfef9c9
GtkCSSImage: Avoid some type checks
...
The width/height/aspect getters are called a lot, and almost all
callers already verify it from _gtk_css_image_get_concrete_size (),
so just skip these checks.
2017-01-11 15:28:35 +01:00
Alexander Larsson
7bee22bcb6
Avoid some more type checks for internal calls
2017-01-11 15:27:51 +01:00
Alexander Larsson
68a27a9951
gtkcssgadget: Use private non-checking versions of gtk_widget calls
...
This avoids a lot of checking overhead.
2017-01-11 12:05:44 +01:00
Alexander Larsson
6341fab985
GtkSnapshot: Reuse snapshot state objects
...
Rather than allocate new ones all the time we reuse the previous ones.
We just clear them and save them in the parent for later reuse.
2017-01-11 11:41:46 +01:00
Alexander Larsson
f67ae85b7a
GtkSnapshot: Move collect data to a union in the state
...
This means we allocate the collect data with the state, avoiding
an extra allocation. Also, a union means every state object
is the same size and we could reuse the state objects.
2017-01-11 11:21:27 +01:00
Alexander Larsson
65ad2541d7
Snapshot: Only record names if inspector is recording
...
Otherwise we do a lot of allocations and vprintf calls which are
not used.
2017-01-11 10:22:40 +01:00
Alexander Larsson
882290b479
Skip dynamic type check in css value getters
...
This gets called a lot during snapshotting, and this change
alone brings down snapshot time by almost 10% in a syntethic
snapshot test.
2017-01-11 09:20:30 +01:00
Benjamin Otte
4c7ddbf519
cssimage: Fix cross-fade
...
Simgle image cross-fade opacity was computed the wrong way, which caused
weird fade-in/out animations, for example in flat buttons.
I messed this up when porting cross-fades to snapshot().
2017-01-11 02:53:12 +01:00
Matthias Clasen
9133ec5cd4
Remove an unnecessary check
...
Since the demise of theme engines, we can no longer hit
the case of id >= GTK_CSS_PROPERTY_N_PROPERTIES. So don't
check for this in a very frequently called function.
2017-01-10 19:56:21 -05:00
Matthias Clasen
c1dc36dff0
Use an internal parameter check here as well
...
We should not slow down the core parts of the css machinery
with type checks.
2017-01-10 19:56:16 -05:00
Matthias Clasen
ecd0ce3993
Use gtk_internal_return_val_if_fail here
...
It seems odd to have checks in just a few functions,
so switch everything over to use the internal versions.
2017-01-10 19:56:09 -05:00
Matthias Clasen
a013a16d1c
Use _gtk_widget_get_window more
...
This avoids type checks in places where we know it is safe.
2017-01-10 19:56:02 -05:00
Matthias Clasen
d9bc675cba
Refactor some css transition code slightly
...
Reshuffling things a bit to avoid a bunch of NULL and
type checks.
2017-01-10 19:55:57 -05:00
Matthias Clasen
4f0cf475a5
Use the .symbolic.png assets in Adwaita
...
Using an image() fallback from svg to png doesn't make too
much sense, since the svg is always used (unless librsvg is
not present), while the png icon is faster and cheaper to
load and thus preferable.
2017-01-10 17:16:10 -05:00
Daniel Boles
0b7542bad1
revealer: Fix a typo in a function doc
...
Also, "ie" wasn't very clear, but fixing that to "i.e." would cause
truncation of the summary when processed by bindings using doxygen. So,
I replaced it with "in other words", which is no _less_ clear, at least.
2017-01-09 22:44:46 +00:00
Chun-wei Fan
ea58ebe76d
Visual Studio builds: Move project files to win32/
...
It was suggested that the project files to be moved to win32/, so that we can
have one less layer of directories we need to go down into to reach the project files.
2017-01-09 15:38:48 +08:00
Benjamin Otte
dcb15d6728
cssgadget: Compute clip correctly
...
We were computing it relative to the gadget allocation, but it should be
relative to the widget allocation.
2017-01-09 01:12:06 +01:00
Timm Bäder
deb458c656
widget: Document child/sibling accessors
2017-01-08 16:58:27 +01:00
Timm Bäder
545fb271b7
switch: Use a widget as slider
2017-01-08 16:54:34 +01:00
Timm Bäder
9b76badb50
widget: Add construct-only css-name property
...
So we can set the css name of a widget to something that's not related
to the class name. If the css-name property is set to NULL, we will
still fall back to the one set using gtk_widget_class_set_css_name which
is alwasys non-NULL since GtkWidget itself sets it to "widget".
2017-01-08 16:44:46 +01:00
Timm Bäder
d15ca3b2b4
actionbar: Fix class and instance struct parent member
2017-01-08 15:12:45 +01:00
Timm Bäder
3d5a62a0c9
actionbar: Add revealed property
...
So we can show and hide it with a transition as well as bind another
property to it.
2017-01-08 14:57:11 +01:00
Timm Bäder
c392f41bb2
builderparser: Shuffle if-statements around once more
...
The previous reordering broke the builderparser test case.
2017-01-08 13:07:12 +01:00
Timm Bäder
de6b788a91
printunixdialog: Remove leftover draw handler
2017-01-08 11:06:49 +01:00
Timm Bäder
48d5f7843b
actionbar: Add revealer as internal child
2017-01-08 10:49:06 +01:00
Timm Bäder
12c2274750
actionbar: Remove show() and hide() implementations
...
They only show/hide the widget in a delayed fashion which doesn't
work, just like it doesn't work with infobars and popovers.
2017-01-08 10:46:26 +01:00
Benjamin Otte
2a9ae1e8df
tests: Remove gtk_widget_send_key()
...
It's unused in GTK.
2017-01-08 03:46:30 +01:00
Benjamin Otte
daf0270f1a
tests: Remove widget find functions
...
They are all unused by GTK.
And other people can write their own find functions if they need any in
their tests.
2017-01-08 03:36:05 +01:00
Matthias Clasen
507a1e4d7a
Make GTK_DEBUG=interactive work better
...
We currently have various ways to initialize GTK+, and not
all of them were supporting this way of bringing up the
inspector. Fix this.
https://bugzilla.gnome.org/show_bug.cgi?id=776807
2017-01-07 19:16:15 -05:00
Benjamin Otte
c1f1dae997
viewport: Remove API to query GdkWindows
2017-01-08 00:48:13 +01:00
Benjamin Otte
d50b73f66d
treeview: Remove gtk_tree_view_get_bin_window()
...
We don't want to expose GdkWindows in the public API.
2017-01-08 00:48:12 +01:00
Timm Bäder
47d4ad71fb
Remove gtk_container_snapshot_child
...
Replace it with the already existing gtk_widget_snapshot_child.
2017-01-07 17:19:30 +01:00
Timm Bäder
f486805ba0
Unparent child widgets
2017-01-07 17:19:30 +01:00
Timm Bäder
5f98597a0c
Add gtk_widget_set_focus_child
...
With a very useful implementation, but at least now we don't get runtime
warnings.
2017-01-07 17:19:30 +01:00
Timm Bäder
52aed5d607
Add gtk_widget_snapshot_child
2017-01-07 17:19:30 +01:00
Timm Bäder
08d644c4a5
widget: Warn if children are left in finalize()
2017-01-07 17:19:30 +01:00
Timm Bäder
7d0e534969
gtkmain: Correctly notify all widgets of a grab
2017-01-07 17:19:30 +01:00
Timm Bäder
8960bb7c8e
widget: Fix :parent property type
...
Parent widgets can now also be widgets, not just containers.
2017-01-07 17:19:30 +01:00
Timm Bäder
9aedbc376b
inspector: Don't try to access child props of non-containers
2017-01-07 17:19:30 +01:00
Timm Bäder
5ab2377afa
widget: Remove gtk_widget_style_get_property
2017-01-07 17:19:30 +01:00
Timm Bäder
25236dbed8
spinbutton: Use widgets for up/down buttons
2017-01-07 17:19:30 +01:00
Timm Bäder
b2b4d9e418
switch: Use GtkLabels for on/off labels
2017-01-07 17:19:30 +01:00
Timm Bäder
42f1ff0123
inspector: Show child widgets of widgets
2017-01-07 17:19:29 +01:00
Timm Bäder
d77b288e65
widget: Implement create_path for widgets with non-container parent
2017-01-07 17:19:26 +01:00
Timm Bäder
af9d932e47
widget: Unparent widgets in dispose()
...
If they have a non-container parent.
2017-01-07 16:44:01 +01:00
Timm Bäder
ef44d05894
widget: Check for containerness before calling container API
2017-01-07 16:44:01 +01:00
Timm Bäder
8ef73660e4
widget: Implement map/unmap with child widgets
...
Once again, do what GtkContainer did before.
2017-01-07 16:44:01 +01:00
Timm Bäder
b15b9e028f
widget: Implement show_all
...
Do what gtk_container_forall did: show_all all children, then the widget
itself.
2017-01-07 16:44:01 +01:00
Timm Bäder
8a55a6975c
widget: Iterate over child widgets instead of gtk_container_forall
2017-01-07 16:44:01 +01:00