Commit Graph

52130 Commits

Author SHA1 Message Date
Matthias Clasen
6b2eafe1bb Drop widget style property test 2017-10-18 17:30:20 +02:00
Matthias Clasen
5824d8b5ee Stop testing deprecated css features 2017-10-18 17:30:20 +02:00
Timm Bäder
e0623fb5ad emojichooser: Plug memory leak 2017-10-17 08:54:08 +02:00
Julian Sparber
6f71e40546 icon-browser: Add scalable icons to icon detail modal window
When making mockups for GNOME apps in Inkscape, looking for symbolic
icons is a common task. Searching for icons in the file system is clumsy,
and icon-browser provides a much better interface for finding them.
However, currently there is no way to insert the symbolic icons as SVG
directly from icon-browser, so right now it is only useful for finding
the name.

This patch adds a sixth column to the modal window that appears when
clicking a symbolic icon. The icon in this column is labeled "scalable",
and dragging it onto another window results in the vector icon URI being
inserted.

This enables a much simpler workflow when designing with symbolic icons.

https://bugzilla.gnome.org/show_bug.cgi?id=778930
2017-10-16 14:26:42 +02:00
Carlos Garnacho
1607f8c4c6 gdk/wayland: Avoid idempotent wl_subsurface.set_position calls
These may not result on wl_surface.frame callbacks, yet we do trigger
a frame clock tick that would get stuck on the lack of such callback.

https://bugzilla.gnome.org/show_bug.cgi?id=784314
2017-10-16 11:31:00 +02:00
Aurimas Černius
c286fad473 Updated Lithuanian translation 2017-10-15 21:30:15 +03:00
Daniel Boles
a5c0a5c546 a11y/entry: Fixups for previous commit
We still declare all variables at the start of the block.

Also, we can use the fast private _gtk_widget_get_allocation().

https://bugzilla.gnome.org/show_bug.cgi?id=784509
2017-10-15 12:58:25 +01:00
Samuel Thibault
9af088693a a11y/entry: Fix text coords not adjusted for alloc
What is missing is the "allocation" part of x/y coordinates. Since
gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
the coordinates returned by gdk_window_get_origin don't include it.

This patch fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784509
2017-10-15 12:37:44 +01:00
Daniel Boles
29b8cfc952 Range: Fix inverted horizontal scroll wheel events
Bug 737175 aimed to ensure that scrolling up on a horizontal range would
result in its value increasing, as that’s what users intuitively expect.
However, its commit 416c370da1 meant that,
if the event gives scroll deltas, we inverted our delta unconditionally.

So it broke horizontal scrolling: scrolling left moved the slider right…

We must only invert if using dy as delta. dx already has the right sign,
so inverting it was wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=788905
2017-10-14 18:56:32 +01:00
Timm Bäder
d2f027a9d9 gtkcssimagefallback: Implement equals()
The default equals() implementation in gtkcssimage.c just returns FALSE.
This avoids needless redraws, e.g. for disabled switches.
2017-10-14 17:29:48 +02:00
Timm Bäder
00ce3abd6c listboxrow: Remove measure() and size_allocate() impls
GtkListBoxRow is a GtkBin which already does this.
2017-10-14 17:27:55 +02:00
Timm Bäder
4e24cb8588 css: Add GTK_CSS_AFFECTS_ICON_SIZE
And use it in GtkIconHelper. This way, we can avoid resizes when e.g.
the fg color of a symbolic icon changes.
2017-10-14 17:27:55 +02:00
Timm Bäder
ce5560a790 iconhelper: Short-circuit clear() if it's cleared already 2017-10-14 17:27:55 +02:00
Timm Bäder
c4c6a20998 popover: Explicitly call queue_allocate in tick callback
_gtk_window_set_popover_position is begin called in size-allocate.
2017-10-14 17:27:55 +02:00
Timm Bäder
d5fd2dca66 window: Remove widget parameter from popover_size_allocate
We already get that via the popover parameter.
2017-10-14 17:27:55 +02:00
Timm Bäder
c02e04b7b8 widget: Whitespace fix
Fallout from one of my earlier commits so not changing ownership here.
2017-10-14 08:12:05 +02:00
Timm Bäder
ec18661bbb widget: Only check display debug flags if the global ones are set
The gtk_widget_get_display call in this if statement is showing up in
profiles. It ends up walking up the hierarchy to the toplevel to get its
GdkScreen, etc. so it is relatively costly. Avoid that call in most
cases by first checking if the RESIZE debugging is enabled for any of
the displays and only then checking if it is enabled for the widget's
display.
2017-10-14 07:37:06 +02:00
Timm Bäder
eee335557c widget: Avoid some type checks when invalidating window
Use the private _gtk_widget_get_has_window instead of the public version
2017-10-14 07:26:09 +02:00
Timm Bäder
0be1ad437a adjustment: Drop priv pointer 2017-10-13 12:49:33 +02:00
Daniel Boles
be5a7b2db2 Fixed: If can’t add child, don’t add to child info
If the call to set_parent() failed, we were still adding the child to
the internal list of children, despite that it was not really added.
That meant we could later try to do invalid stuff with that non-child.

Fix that by asserting and giving up if the child that the user is
attempting to add is already parented.

https://bugzilla.gnome.org/show_bug.cgi?id=701296
2017-10-13 09:50:19 +01:00
Daniel Boles
9dde11bdea Fixed: Don’t dereference before typechecking 2017-10-13 09:50:19 +01:00
Daniel Boles
3a91d36913 icon-browser: Stop repeating folder-documents too 2017-10-13 00:24:41 +01:00
Daniel Boles
3354ad080b StyleContext: Add CSS snippet language comments
The language is useful for parsing tools, such as that of gtkmm, which
otherwise assumes these are C snippets and elides them from its
generated documentation.
2017-10-12 19:40:45 +01:00
Carlos Garnacho
06b21b4bec testsuite: Make all gesture test touches happen in the middle of the window
The event coordinates are (so far) irrelevant to what we are testing here,
just make all events happen in the middle of the window in order to ensure
all widgets receive it. More importantly, avoid using fixed pixel distances,
since we don't get guarantees about window sizes.

Fixes the gestures testsuite on X11.
2017-10-12 18:32:27 +02:00
Timm Bäder
54ed2d1e63 testsuite: Updated expected GtkSwitch nodes
The slider comes last now.
2017-10-12 16:09:31 +02:00
Timm Bäder
9bc7581f1c css: Replace _AFFECTS_TEXT with _TEXT_SIZE and _TEXT_CLIP
It was used to mark css properties that affect widgets with text, but it
caused unnecessary invalidations. E.g. 'color' was marked as
AFFECTS_TEXT but changing just the color of a label should not
automatically queue a resize, which is what the code in
gtk_widget_real_style_updated does.

Replace this flag with GTK_CSS_AFFECTS_TEXT_SIZE and
GTK_CSS_AFFECTS_TEXT_CLIP, which GtkWidget can use only if the widget
actually has text.
2017-10-12 15:42:03 +02:00
Timm Bäder
30096de341 csstypesprivate: Remove AFFECTS_PANGO_LAYOUT mention
Doesn't even exist!
2017-10-12 15:42:03 +02:00
Timm Bäder
2c9bbb9a71 GtkCssStyleChange: Only print values that really changed 2017-10-12 15:42:03 +02:00
Timm Bäder
a6904ba2cc widget: Use blue for resize debugging
Red is already taken by drawing.
2017-10-12 15:42:03 +02:00
Timm Bäder
d027e365d3 glarea: Make the code snippet compile 2017-10-12 15:42:03 +02:00
Timm Bäder
114f232a99 drawingarea: Fix code snippet
Remove state parameter to gtk_style_context_get_color
2017-10-12 15:42:03 +02:00
Timm Bäder
f2ca2e1242 window: Make code snippets compile
Fix the wrong signature of a size_allocate signal handler
2017-10-12 15:42:03 +02:00
Carlos Garnacho
40a2b91a6c testsuite: Update gestures test to pointer emulation removal
Now all widgets are mandated to handle the real thing, which means no
pointer events are emulated for the pointer emulating touch. The output
of these tests relied on this fact, so update to the tests handling real
touch events.
2017-10-12 14:47:15 +02:00
Carlos Garnacho
ff31bdd334 testsuite: Fix gesture test inconsistencies due to legacy event handling
Legacy GtkWidget vmethods are now handled on an event controller, which
due to being the very first controller added to every widget, runs in
a different order than the previously hardcoded.

Probably testing legacy events is not really futurible, specially after
we stop installing this legacy controller by default. I'll leave the
choice to remove these specific tests for later though.
2017-10-12 14:47:15 +02:00
Carlos Garnacho
d4a6c2c241 gtkwidget: Check return value before running bubble phase
If the target widget gets the event consumed on the target phase,
we should not attempt to bubble up, not even within the same widget.
2017-10-12 14:47:15 +02:00
Carlos Garnacho
564ae6967d gtkwidget: Lookup target widget when propagating emulated pressed
After a gesture first claims, and later rejects a touch sequence,
a press event will be propagated further along. However propagation
got messed up since we only emitted as far as the toplevel.
2017-10-12 14:47:15 +02:00
Matthias Clasen
cb19bbba0c Update the css style test
The new font-variant support affected the output here.
2017-10-12 17:23:35 +08:00
Matthias Clasen
18519a7ca0 Make css node and style tests run
Just like the previous commit, we need to set G_TEST_SRCDIR.
2017-10-12 16:06:03 +08:00
Matthias Clasen
37f1d180c3 Make css parser tests run
We need to set G_TEST_SRCDIR and friends for this to do anything.
Setting it reveals that a bunch of the tests are broken.
2017-10-12 15:58:05 +08:00
Matthias Clasen
9ea8235cc7 Update some a11y tests 2017-10-11 20:09:21 -05:00
Matthias Clasen
f09b5a8953 Fix a typo 2017-10-11 19:59:07 -05:00
Matthias Clasen
eb71cd195a testsuite: cosmetics
Put all tests in a suite, and order them in a nicer way.
This makes the test output look better.
2017-10-11 19:33:43 -05:00
Daniel Boles
9c3479b605 Settings: Mention Shift+primary click on Range too
This already existed, and since this doc blurb is already inflating
dramatically, what’s another half a line?
2017-10-11 22:35:31 +01:00
Daniel Boles
46e46ba099 Settings: Reflect resurrected middleclick in Range
and while here, make the explanation more explicit as to which values do
what, & use general Range terminology instead of focussing on scrollbars

https://bugzilla.gnome.org/show_bug.cgi?id=787669
2017-10-11 21:55:41 +01:00
Daniel Boles
1e8a166e34 ToggleButton: Actually show buttons in new snippet
Also, create a Window, instead of a Dialog without a transient parent,
which is (noisily) discouraged. Then s/content_area/box/g to match.
2017-10-11 21:15:54 +01:00
Emmanuele Bassi
eaae832697 docs: Clarify the visibility of buttons in GtkStackSwitcher
If a page in the GtkStack is not visible, then the GtkStackSwitcher
won't show a button for it.
2017-10-11 20:21:28 +01:00
Matthias Clasen
2120ea60ed range: Bring back middle clicks
It does not hurt us to keep middle clicks doing the same
as shift-primary clicks. This makes the transition from gtk2
less painful in terms of muscle memory.

https://bugzilla.gnome.org/show_bug.cgi?id=787669
2017-10-11 14:07:53 -05:00
Philip Withnall
7e8831d668 gtktextview: Add a missing g_assert_not_reached() for switch default
Clarifies the code and helps catch invalid enum values before they
propagate further. Also add a comment about why two seemingly legitimate
values are not handled there (they’re handled higher up in the file).

Coverity CID: 1457700

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788787
2017-10-11 17:26:54 +01:00
Timm Bäder
1c232ed583 bindings: Fix code snippet
Just use a more realistic example, adapted from gtklistbox.c
2017-10-11 13:01:27 +02:00
Timm Bäder
da3d2593b2 accellabel: Fix code snippet 2017-10-11 12:56:42 +02:00