Commit Graph

31429 Commits

Author SHA1 Message Date
Benjamin Otte
6a3c2a230a rbtree: Add gtk_rb_tree_node_get_tree()
Store a link to the tree in the root node. This allows looking up the
tree in O(log N) from the node without any extra memory usage.

This is useful because code can just store a pointer to the node and
doesn't need to keep the tree pointer around. And that can (for large
trees) save quite a bit of memory.
2019-01-14 02:14:11 +01:00
Benjamin Otte
a33ff4c6ab rbtree: Access node->parent only via accessors
This also adds a set_parent() function that automatically takes care of
updating tree->root for root nodes.
2019-01-14 02:14:11 +01:00
Benjamin Otte
7ff949ea30 rbtree: Remove gtk_rb_tree_find()
Searching through the tree is too specific to use a general function.
All the existing code just copies and slightly adapts the same 20 lines
instead, so there's no reason to keep the complicated API.
2019-01-14 02:14:11 +01:00
Matthias Clasen
25bca27bfe Rename GtkCssRBTree to GtkRBTree
This is a generally usable red-black tree api,
and it is not used in css at all.
2019-01-14 02:14:11 +01:00
Matthias Clasen
e269f43afc Rename GtkRBTree to GtkTreeRBTree
This frees up the generic name for a more
generic rbtree implementation.
2019-01-14 02:14:11 +01:00
Timm Bäder
44a2a49f31 overlay: Directly create cairo_region
Instead of doing a cairo_region_create + union, just pass the rect
directly to cairo_region_create_rectangle
2019-01-13 08:41:37 +01:00
Timm Bäder
69bc42f444 rendernodepaintable: Don't try to snapshot 0×0 nodes
Considering the operations that some of the rendernode constructors
do, nodes with width or height 0 (or both of course) are very well
possible. This would break in the rendernodepaintable when adding a
transform, which divides by width/height of the rendernode.
2019-01-13 08:39:05 +01:00
Timm Bäder
269535c844 overlay: Blur the clipped node, not clip the blurred node
Blurring is a lot more expensive than clipping, so try to blur less by
clipping first.
2019-01-13 08:23:25 +01:00
Timm Bäder
c7f773f3e3 overlay: Trivial indentation fix 2019-01-13 08:23:25 +01:00
Timm Bäder
d098cd5865 overlay: Don't offset the main window snapshot
We need the node without an offset applied.

Fixes the rose picture being offset in tests/testoverlay
2019-01-13 08:23:25 +01:00
Timm Bäder
5680393f9d label: Add missing nullable annotation 2019-01-13 08:23:25 +01:00
Mike Gorse
a52431d2b4 A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells
These functions were missing GDK_AVAILABLE_IN macros, so they were
listed in the gir but not exported.
2019-01-11 16:53:39 -06:00
Timm Bäder
5fd936beef spinbutton: Use increment/decrement icon names
And add list-{remove,add}-symbolic as fallback.

Fixes #1569
2019-01-11 18:29:20 +01:00
Timm Bäder
563b80d434 label: Skip updating link state if we have no layout
This can happen whenever the ::activate-link handler sets different
markup on the label, causing all links to be recreated. In this case,
the GtkLabelLink* passed to emit_activate_link is garbage after the
g_signal_emit call and we shouldn't try to do anything with it.

Fixes #1498
2019-01-11 17:46:12 +01:00
Timm Bäder
f4f0f0e6a0 snapshot: Get new GArray item directly
Instead of building it up ourselves, then coping it into the GArray and
then getting the last element of that array.
2019-01-11 17:02:23 +01:00
Emmanuele Bassi
ba9b0c6f7d Use the IEC power symbols for GtkSwitch labels
Unicode 9.0 introduced glyps for the "on" and "off" power states, in the
form of:

 - U+23FD POWER ON SYMBOL, or ⏽
 - U+2B58 HEAVY CIRCLE, or ⭘

With `HEAVY CIRCLE` as "power off symbol" selected to avoid adding yet
another circle to the standard.

Since we moved GtkSwitch to always show glyphs instead of (translatable)
strings, asking the localisation teams to either come up with a suitable
short string to replace the English "ON" and "OFF", or to fall back to
Unicode glyphs, we should ensure we're using the appropriate symbols to
begin with.

See also: gtk!503 for the corresponding gtk-3-24 change.
2019-01-11 15:25:30 +00:00
Alberts Muktupāvels
1cd934e105 listbox: set selected_row before emitting signal
Signal emittion was added in 6f857f87dc commit and it seems that
this is only place where selected_row is set after emitting signal.

Because of this gtk_list_box_get_selected_row currently returns NULL
as selected row if selection mode is set to GTK_SELECTION_BROWSE.
2019-01-11 13:19:28 +02:00
Timm Bäder
dc1d3824a2 Merge branch 'wip/dboles/EventControllerKey-docs-4' into 'master'
EventControllerKey: Add missing documentation bits

See merge request GNOME/gtk!454
2019-01-11 09:39:25 +00:00
Matthias Clasen
927e49ed86 switch: Always use I/O
This allows for smaller switches, and goes better with
modern themes that have round switches.
2019-01-10 17:21:48 -05:00
Timm Bäder
913b4fcc49 iconcache: Remove unused defines 2019-01-10 16:49:19 +01:00
Timm Bäder
7ac9fe3b60 shadowvalue: Remove unused API 2019-01-10 16:49:19 +01:00
bodqhrohro
ec22646210 Fix a typo in “popup-context-menu” documentation. 2019-01-09 14:24:29 +00:00
Mohammed Sadiq
d11bc68b27 gtkpopover: Fix popover when parent widget is partially visible
fixes https://gitlab.gnome.org/GNOME/gtk/issues/750
2019-01-09 17:12:23 +05:30
Benjamin Otte
b6d8d3975e revealer: Handle child-visible properly
The target position is irrelevant for determining if the child should be
visible. When the current position is 0, it needs to be hidden, period.

Fixes #1355
2019-01-08 01:29:41 +01:00
Benjamin Otte
5e96129be1 settings: Don't special case IM modules
The previous fixes made it unnecessary to hardcode IM modules for
different display types. The code now automatically skips system IM
modules for other displays.
2019-01-08 00:41:12 +01:00
Benjamin Otte
0ef7d07880 immodule: Check if module matches display
When loading IM modules from environment variables or GtkSettings, we
would accept "xim" on Wayland. That is a bad idea.
2019-01-08 00:41:12 +01:00
Benjamin Otte
545e95bb5c immodule: Don't load unsupported IM module
The code would technically allow loading the xim module when X11 support
was not compiled in.

This is probably an artificial concern, because it's pretty hard to
compile XIM support without X11 support, but it makes the code clearer,
so there we go.
2019-01-08 00:41:12 +01:00
Benjamin Otte
ca76675a69 immodule: Pass a GdkDisplay for default context ID
After all, the context depends on the display - we want to use the
wayland context for Wayland,  xim for X11 and so on.
2019-01-08 00:41:12 +01:00
Benjamin Otte
16d4ce4d03 immulticontext: Don't have a global_context_id
Context IDs are dependant on the display - both because displays can use
different backends, but also because changing the GtkSetting is a
per-display operation.

So just remove the cache.
If it turns out we need a per-display cache, we can add one to
GtkSettings.
2019-01-08 00:41:12 +01:00
Olivier Fourdan
58e273d056 a11y: Check display in *grab_cell_focus()
Calling the accessibility function `grab_focus()` on a `GtkCell` under
Wayland will cause the client to crash.

This is another case of `gdk_x11_get_server_time()` being called
regardless of the actual windowing backend used.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1507
2019-01-07 21:06:57 +00:00
Carlos Garnacho
1c14285dee flowbox: Accept multipress gesture late
So it's able to operate properly with the DnD gesture set by
gtk_drag_source_set(). We usually just react on button release,
that's the right time to claim the gesture.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1557
2019-01-07 21:01:59 +00:00
Daniel Boles
cd69570e78 searchenginequartz: Fix naming of Beagle @ comment
As funny as that is, it's not very instructive. :P

https://gitlab.gnome.org/GNOME/gtk/merge_requests/490#note_400993
2019-01-07 20:46:08 +00:00
John Ralls
52b9e4703b [GtkSearchEngineQuartz] Limit the returned hits.
When the result set is larger than the limit.
2019-01-07 20:46:08 +00:00
Daniel Boles
d7193eaf8b [GtkSearchEngineQuartz] Resolve the path to a GtkFile* for the hit list.
Instead of a char* path, which the search_hit parser doesn't expect,
causing a crash.

Closes: $https://gitlab.gnome.org/GNOME/gtk/issues/815
2019-01-07 20:46:08 +00:00
Carlos Garnacho
b52dea7a10 Merge branch 'fix-corner-resize' into 'master'
Fix resize corners

See merge request GNOME/gtk!481
2019-01-07 18:14:33 +00:00
Timm Bäder
f9a5a474f0 imcontextwayland: (Hopefully) fix if expression 2019-01-04 05:55:26 +01:00
Timm Bäder
ea3d0c0f01 buttonbox: Remove redundant if statement
This used to do something in the past.
2019-01-03 08:57:16 +01:00
Timm Bäder
2c1198f6c2 colorchooser: Remove extra custom color 2019-01-03 08:56:46 +01:00
Timm Bäder
66d3aa8101 window: Fix state_flags_changed impl name
This is unrelated to GdkSurface and was changed by accident.
2019-01-03 08:56:34 +01:00
Timm Bäder
0530637fef stack: Don't queue an unnecessary redraw
Both queue_allocate and queue_resize already queue a draw.
2019-01-03 08:52:35 +01:00
Timm Bäder
3d6bdb9af3 entry: Remove unused struct 2019-01-03 08:52:08 +01:00
Matthias Clasen
7e7c90961c Check for the session bus before using it
Patch by Chris Allen, #475
2019-01-02 20:35:19 -05:00
Matthias Clasen
3da9280a8a Merge branch 'wip/nbenitezl/move-bookmark-placeholder-index-4' into 'master'
gtkplacessidebar.c: move bookmark at the placeholder index

See merge request GNOME/gtk!459
2019-01-03 01:27:49 +00:00
Matthias Clasen
ed17a8ddd7 Merge branch 'patch-1' into 'master'
Zero-fill new GtkTextIter

See merge request GNOME/gtk!455
2019-01-03 01:02:07 +00:00
Matthias Clasen
cd7e70680c Merge branch 'wip/carlosg/imwayland-for-master' into 'master'
Use zwp_text_input_v3 on gtk4

Closes #1317 and #1525

See merge request GNOME/gtk!462
2019-01-03 00:36:35 +00:00
Matthias Clasen
dc68d04c32 Fix resize corners
I was stuck in an X session and noticed that my resize corners
all got east or north cursors. It turns out that gnome-shell
does not properly advertise support for edge constraints under X11,
and the absence of that makes the code for determining the edge
under the cursor misbehave.

This change should fix that.
2019-01-02 19:08:02 -05:00
Timm Bäder
bd95e16372 Merge branch 'wip/carlosg/revealer-fix-interrupted-animations-master' into 'master'
revealer: Fully set the target state if unmapped during animation

See merge request GNOME/gtk!466
2019-01-02 08:50:25 +00:00
Timm Bäder
c1e1e2da80 image: Avoid some unnecessary signal connections
Equivalent if fd9879e5ff but for GtkImage.
2018-12-31 12:44:02 +01:00
Timm Bäder
ea8f1469c1 image: Indentation fix 2018-12-31 12:44:02 +01:00
Timm Bäder
b4f2a3416e picture: Avoid some unnecessary signal connections
We don't need to ever invalidate the picture size if the paintable tells
us its size is static. Same for the contents.
2018-12-31 12:44:02 +01:00
Timm Bäder
3b46e2a558 image: Remove private struct from public header 2018-12-31 12:44:02 +01:00
Daniel Boles
480a04131c CellAccessible: Fix return type of row|column_span
See:
 * c876c74eb7
 * 63e0eb5de5
2018-12-30 18:15:11 +00:00
Christoph Reiter
325badc3eb Merge branch 'fix-typo-win32-compilation-speedup-macro-gtk4' into 'master'
Win32: Fix typo on compilation speedup macro define [Gtk4]

See merge request GNOME/gtk!473
2018-12-22 17:54:08 +00:00
Tomasz Miąsko
c665a1d5a5 Annotate values of PRIORITY constants
g-ir-scanner incorrectly evaluates macro definition that include
references to other macro definitions. Provide a correct value as an
annotation.

Differences in generated gir files:

```diff
@@ -19017 +19017 @@
-    <constant name="PRIORITY_REDRAW" value="20" c:type="GDK_PRIORITY_REDRAW">
+    <constant name="PRIORITY_REDRAW" value="120" c:type="GDK_PRIORITY_REDRAW">
@@ -74229,3 +74229,3 @@
     </constant>
-    <constant name="PRIORITY_RESIZE" value="10" c:type="GTK_PRIORITY_RESIZE">
+    <constant name="PRIORITY_RESIZE" value="110" c:type="GTK_PRIORITY_RESIZE">
       <doc xml:space="preserve">Use this priority for functionality related to size allocation.
@@ -106786,3 +106786,3 @@
     <constant name="TEXT_VIEW_PRIORITY_VALIDATE"
-              value="5"
+              value="125"
               c:type="GTK_TEXT_VIEW_PRIORITY_VALIDATE">
```

See !472
2018-12-22 18:52:20 +01:00
Luca Bacci
a52989842e Win32: Fix typo on compilation speedup macro define
There is a typo, the correct macro to define is WIN32_LEAN_AND_MEAN.
After this change <shellapi.h> must be included in order to use
ExtractIconExW().
2018-12-22 01:18:17 +01:00
Mohammed Sadiq
1df276f263 mediastream: Fix possible memory leak
@error is (transfer full).  So the error passed should be freed if not used
2018-12-20 10:26:56 +05:30
Carlos Garnacho
615f10f7c8 revealer: Fully set the target state if unmapped during animation
If the revealer is told do animate and then unrealize itself, we do
(correctly) stop the animation, but used to do a shortcut where we
just set the target state as current.

Other things are dependent on the animation properly finishing though,
like the contained widget child visibility. This may lead to inconsistent
state where gtk_revealer_get_child_revealed() returns TRUE but the child
widget is unmapped, or vice-versa.

Fully finish the animation here, so the child state is coherent the next
time the revealer is mapped. We can also skip notifying on the property
since it will be handled by gtk_revealer_set_position().
2018-12-19 20:53:40 +01:00
Carlos Garnacho
beb9ee6d4a build: wrap IM protocol building under have_wayland altogether
We poke variables that might not be defined if the wayland backend
is disabled.
2018-12-18 20:51:53 +01:00
Carlos Garnacho
8ce6d03c7b imwayland: Respect maximum length of 4000 Bytes on strings being sent.
Hitting the limit will raise protocol errors.
2018-12-18 20:38:44 +01:00
Carlos Garnacho
904202a636 imwayland: Plug leaks
The various strings (pending/current preedit, surrounding, and commit
buffer) are being leaked in the case of GtkIMContext destruction.
2018-12-18 20:38:44 +01:00
Dorota Czaplejewicz
7a0b6a3639 imwayland.c: fix formatting 2018-12-18 20:38:44 +01:00
Dorota Czaplejewicz
b465e04ae2 imwayland: rearrange functions to remove prototypes 2018-12-18 20:38:41 +01:00
Dorota Czaplejewicz
f67627875f imwayland: Handle enter and leave events
Before this patch, imwayland would assume that text-input enter and leave events follow the general (wl_keyboard) focus, and was unable to handle the situation where they would not be provided at the same time.
2018-12-18 20:27:12 +01:00
Carlos Garnacho
8912dc226c imwayland: Collect return value from ::delete-surrounding signal
There's not much we can do about the signal not being handled, but
we should fetch the return value anyway.
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
12ac9f351e imwayland: Don't reset serial while text-input is alive
The serial number is a persistent property of the text-input object.
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
c4b4e90f98 imwayland: Fix clearing of preedit text in webkitgtk
Fixes webkitgtk misbehaviour as outlined in https://gitlab.gnome.org/GNOME/gtk/issues/1316#note_312942 , which was introduced in 49b17e6c.
The preedit will be cleared on exit only if it is already present.
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
fcf28ded42 imwayland: Fix clearing of preedit text
Fixes terminal emulator misbehaviour as outlined in https://gitlab.gnome.org/GNOME/gtk/issues/1316, which was introduced in 49b17e6c. The original commit cleared preedit text by setting it to an empty string, which still counted as existing preedit. The fix sets preedit string to null, which is correctly understood as not present.
2018-12-18 20:27:12 +01:00
Carlos Garnacho
1e69d248cb modules: Check current context before retrieving surrounding
There may be situations where this might get called while the
currently focused context just went away (eg. after setting the
text widget unsensitive).

Closes: #1317
2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
c49b29fa53 imwayland: clear preedit on focus out 2018-12-18 20:27:12 +01:00
Dorota Czaplejewicz
024220aee8 imwayland: Add text-input-unstable-v3 support
The wayland input module now represents text-input-unstable-v3 support, while the old module supporting gtk-text-input was renamed to gtkwayland.
2018-12-18 20:27:12 +01:00
Benjamin Otte
89c48a08a0 mediastream: Allow multiple calls to gtk_media_stream_error()
Just ignore all further ones.
2018-12-18 02:04:16 +01:00
Benjamin Otte
c30968861f a11y: Fix function return type
Typo right there.
2018-12-18 01:20:36 +01:00
Nelson Benítez León
65240967e4 gtkplacessidebar.c: move bookmark at the placeholder index
As that index is set in drag_motion_callback() and visually shown
on the widget as a drop target hint.

https://bugzilla.gnome.org/show_bug.cgi?id=787356
https://gitlab.gnome.org/GNOME/gtk/issues/904
2018-12-17 19:19:20 +00:00
Peter Bloomfield
8a27302d56 gtkmain: Terminate two loops early
In propagate_event_{down,up}(), set handled_event to TRUE if a widget is
unrealized, so as to terminate the corresponding loop early.

See https://gitlab.gnome.org/GNOME/gtk/merge_requests/442
2018-12-17 12:04:10 -05:00
Peter Bloomfield
8ce01084af gtkmain: Avoid critical messages on closing window
Do not call _gtk_widget_captured_event(), in propagate_event_down(), or
gtk_widget_event(), in propagate_event_up(), when the widget has been
unrealized.
2018-12-17 11:41:17 -05:00
Orivej Desh
3ec2d5fa38 Zero-fill new GtkTextIter
iter_init_common() is used on uninitialized GtkTextIter, and since neither it
nor its callers initiliaze its padding fields, they contain garbage.

This is a problem for Go - which checks that structs passed to C functions do
not contain pointers to Go-allocated memory - when the garbage happens to be
such a pointer.  Although Go zero-fills all GtkTextIter that it allocates, this
does not help when GTK functions such as insert_pixbuf_or_widget_segment called
for gtk_text_buffer_create_child_anchor copy garbage from their stack-allocated
GtkTextIter into a clean iter.  To work around this a GtkTextIter has to be
discraded after use in text buffer anchor inserting functions:
https://github.com/gotk3/gotk3/pull/307
2018-12-16 17:03:47 +00:00
Daniel Boles
a350192ea2 EventControllerKey: Add missing documentation bits 2018-12-14 23:28:54 +00:00
Emmanuele Bassi
cb0d8d6d90 Remove gtk_widget_show_all() call
Extraneous chunk from 7601bca758.

Cherry picked from gtk-3-24, which has a gtk_widget_show_all() function.
2018-12-14 20:38:03 +00:00
Mike Gorse
8f29a0633b A11y: Add support for AtkTableCell 2018-12-14 19:25:27 +00:00
António Fernandes
7601bca758 placesview: List only available protocols as available
We display a list of supported protocols in the server_addresses_popover.

However, this curated list contains protocols which may or may not be
available, depending on the respective gvfs backend being installed.

So, populate the list only with protocols which are available.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-12-14 12:30:52 -05:00
António Fernandes
3bbfff9280 placesview: Set .error style if unsupported protocol
When the user types an address with a schema that is not supported,
the Connect button doesn't become sensitive, but there is no visible
feedback at all.

This feels unresponsive and leaves the user clueless.

While it doesn't help explain why the address doesn't work, this will
provide a hint that the input was acknowledged but doesn't work.

https://gitlab.gnome.org/GNOME/gtk/issues/1476
2018-12-14 12:28:47 -05:00
Matthias Clasen
5b049364dc Merge branch 'fix-polygon-svg-recolor' into 'master'
icontheme: Recolor <polygon> elements in SVGs too

See merge request GNOME/gtk!443
2018-12-14 17:02:30 +00:00
Jakub Steiner
77792b6475 Revert "Adwaita: GNOME 3.32"
This reverts all GNOME 3.32 styling from master
2018-12-10 21:22:56 +01:00
Philip Chimento
284d909347 icontheme: Recolor <polygon> elements in SVGs too
Otherwise, it's possible to have a symbolic icon where some of the
shapes keep the #bebebe chroma key color.
2018-12-08 01:40:32 +00:00
Timm Bäder
43ef4d7b53 menushell: Listen to non-primary button clicks
Menus should also be deactivated on right-button clicks.
2018-12-07 17:03:45 +01:00
Timm Bäder
82a1d4f280 gesturestylus: Use proper syntax when refering to signals 2018-12-07 16:36:10 +01:00
Jakub Steiner
80f2660838 Adwaita: regenerate CSS
- for the previous patch
2018-12-07 12:00:21 +01:00
Jakub Steiner
edd4d2918a Merge branch 'context_menus' into 'master'
Adwaita GTK Theme: Add bigger shadow and border-radius to menus

See merge request GNOME/gtk!432
2018-12-07 09:58:56 +00:00
Jakub Steiner
320d272ec8 Adwaita: buttons & headerbar tweaks
- tone down the button z-depth
- flatter headerbars
2018-12-05 16:21:45 +01:00
Daniel Boles
72d09d22e9 Box, Grid: Improve various bits of documentation
Issue #1495 showed that the docs of GtkGrid retain outdated implications
that (as was once, but is no longer, the case) it is intended to replace
GtkBox, by discussing HfW and widget properties in a way that suggests
GtkBox can't handle them. But of course it does, and it's preferable for
simple single-row/column cases. Worse, we said GtkGrid “provides exactly
the same functionality” for the latter case, but the original point of
that Issues was that it doesn’t, at least for CSS positional selectors!

Box:
• Use an actually meaningful @Short_description.
• Remove unhelpful @See_also references to unrelated containers.
• Remove references to “rectangular area”: it might be another shape
  via CSS, or “rectangular” might falsely imply 2 dimensions of children.
• Mention Orientable:orientation.
• Emphasise usefulness of :[hv]align for allocating in the other axis.
• Don’t say that Grid “provides exactly the same functionality” for a
  single row or column, since (A) it is overkill for that case and (B)
  said Issue proved that it *doesn’t* for CSS child order, for example.

Grid:
• Don’t dwell on widget properties and height-for-width in a way that
  wrongly implies that Box can’t handle those (or Grid can better). In
  fact, just get rid of that bit altogether: Box handles them fine, and
  such wording was only needed years ago for migration from GTK+ 2 to 3.
• Point to GtkBox as being preferred for the simple row/column use case.
2018-12-04 20:43:19 +00:00
Timm Bäder
8de1ba2cc4 application: Remove dead assignment 2018-12-04 06:30:47 +01:00
Timm Bäder
2644da106b button: Remove some dead code 2018-12-04 06:30:47 +01:00
Timm Bäder
4860410c4a button: Remove some unnecessary includes 2018-12-04 06:30:47 +01:00
Matthias Clasen
1e129c1dd2 emoji chooser: Actually force Emoji presentation
The previous commit was using the text presentation selector
instead of the Emoji one. Oops.
2018-12-03 21:47:53 -05:00
Timm Bäder
fb6adaaa62 window: Don't try to size-allocate unmapped popovers
The gtk_widget_size_allocate call won't do anything anyway.
2018-12-02 13:25:43 +01:00
Timm Bäder
f8df527c68 sizerequest: Directly query new request_mode
We are already inside the function that populates the size request
cache, so do it here instead of implicitly in get_request_mode.
2018-12-02 13:25:43 +01:00
Matthias Clasen
6f8c4f873d Merge branch 'force-emoji' into 'master'
Force emoji presentation

See merge request GNOME/gtk!431
2018-11-30 21:38:02 +00:00
Matthias Clasen
7a4e9fa4d3 Force emoji presentation
Append a variation selector to the Emoji sequences,
to force Emoji presentation. Without this, some
Emoji come out with text presentation by default.

Closes: Pango #334
2018-11-30 16:20:44 -05:00
Jakub Steiner
f3c704b82e Adwaita: updated switch control
- might be nasty to hide labels with CSS. We can fix properly later.
- the blue border seesm aliased when :checked
2018-11-30 20:55:00 +01:00
frederik.feichtmeier
a6a69dd567 Adapt border-radius and box-shadow of menus to popovers 2018-11-30 11:54:22 +01:00
Jakub Steiner
8921c868a5 Adwaita: shade buttons
- it was a bit too flat
2018-11-29 21:56:45 +01:00
Jakub Steiner
3f8598baa4 Adwaita: button tweaks
- step back on toning down the borders. Flatness !> legibility.
- darker active state for light
- draw gradinets from bottom up, to keep px sized shading regardless
  of button size.
2018-11-29 20:19:41 +01:00
Jakub Steiner
b5fd7b3211 Adwaita: headerbar backdrop state 2018-11-29 14:34:53 +01:00
Jakub Steiner
e9fe9410e0 Adwaita: sync headerbar styling for devel mode 2018-11-29 13:12:44 +01:00
Timm Bäder
904fd5f1fc Remove gtk_widget_intersect
It's been broken for quite a while now and doesn't make sense anymore
these days.
2018-11-29 11:14:26 +01:00
Timm Bäder
f598836d6c popover: Don't recalculate position if unmapped 2018-11-29 08:50:18 +01:00
Timm Bäder
7c020bfaaa inspect-button: Remove custom pick() implementation
This was added to work around the fact that pick() does not look at
insensitive widgets at all, but the replacement didn't properly work
either.
2018-11-29 08:50:18 +01:00
Timm Bäder
2bd02d9185 popover: Get rid of a gtk_widget_get_allocation call
Use _compute_bounds instead.
2018-11-29 08:50:18 +01:00
Timm Bäder
c17c18f1ae widget: Remove one translate_coordinates copy
Just use the double version in the integer version.
2018-11-29 07:39:11 +01:00
Jakub Steiner
dbde7b68c0 Adwaita: flatten the headerbar again 2018-11-28 20:28:56 +01:00
frederik.feichtmeier
95f06f6e75 Add bigger shadow and border-radius to menus
Increase the visibility of the box-shadow for menus
Introduce a border-radius variable for menus
Use this variable for all corners of menus except top for the top menus
2018-11-28 17:43:55 +01:00
Jakub Steiner
a26edd59d1 Adwaita: tune button & hederbar colors 2018-11-28 14:22:21 +01:00
Mohammed Sadiq
dcd21e12cd texttag: Replace gtk3-demo reference with gtk4-demo 2018-11-28 16:51:45 +05:30
Jakub Steiner
e5efc84eda Adwaita: buttons & headerbars
- tone down the bottom border contrast (increase bottom lightness,
  decrease overall lightness)
- darken headerbars slightly (might require darkening wm colors when
  dust settles)
2018-11-28 00:16:20 +01:00
Federico Mena Quintero
e5f9bf2e9b (#1471): base64-encode included SVGs to avoid mis-escaped characters
We wrap SVG data from icons within another SVG with extra styling
information.  The wrapped SVG may contain characters that cannot be
part of a data: URL (https://fetch.spec.whatwg.org/#data-urls).

Librsvg 2.45 got more strict in its parsing of data: URLs; whereas
previously it ignored '#' characters in them, now it considers them to
be the start of a fragment identifier, which is not allowed in data:
URLs anyway.

To avoid unallowed characters, we now create a data: URL with a
base-64 encoded SVG.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1471
2018-11-27 13:57:21 -06:00
Timm Bäder
0be4d31217 headerbar: Remove superfluous parentheses 2018-11-27 06:06:28 +01:00
Timm Bäder
eebb849760 widget: Query CSS values later in size_allocate
Move it below the "this widget only changed its position" check.
2018-11-27 06:00:30 +01:00
Timm Bäder
f92745aacf widget: Save baseline without CSS values applied
Similar to what we do with width/height.
2018-11-27 05:59:47 +01:00
Timm Bäder
7aee30bfc2 adwaita: icon-shadow -> -gtk-icon-shadow 2018-11-27 05:41:53 +01:00
Timm Bäder
fe49f83982 colorplane: Convert crosshair rendering to snapshot
This is slightly different than the cairo version since the
half-transparent lines now overlap but nobody can see that anyway.
2018-11-27 05:37:38 +01:00
Timm Bäder
059d9376da colorscale: Cache hue texture
Otherwise we regenerate a new one on every snapshot() call.
2018-11-27 05:37:38 +01:00
Timm Bäder
b7963a06ab widget: Parent widgets may also consume motions
This is important when the target widget of an event is not the one that
would otherwise receive the gesture. For example, the GtkSwitch
implementation currently attaches a pan gesture to the switch itself,
but the target widget below the pointer might be the switch slider or
label.

See #1465
2018-11-27 05:37:38 +01:00
Timm Bäder
eeeefb40c7 switch: Shorten size_allocate impl a bit 2018-11-27 05:37:38 +01:00
Jakub Steiner
97d8676b40 Adwaita: help fullcolor app icons
- draw a large dropshadow for aboutboxes
- draw an outline for low res

See issues #1434 and #1445.
2018-11-26 17:33:28 +01:00
Jakub Steiner
6e28d004ae Adwaita: tone down broders, buttons
- very contrasty lines feel dated in today's flat world
- tone down the contrast a little
2018-11-23 17:32:46 +01:00
Jakub Steiner
8d7bf3ad0c Adwaita: list buttons
- tone down buttons when inside lists

Fixes issue #1473
2018-11-22 13:24:49 +01:00
Timm Bäder
d76a0feef6 widget: gdk_display_get_monitor can return NULL
Fixes #1466
2018-11-20 12:45:18 +01:00
Timm Bäder
08a07d4ae5 entry: Shorten finalize implementation
By using g_clear_pointer and g_clear_object where appropriate.
2018-11-20 12:45:18 +01:00
Zander Brown
ea487b2233
window: Actually emit notify::transient-for
Because it seems we weren't doing that
2018-11-19 21:17:01 +00:00
Benjamin Berg
8c9c3e4426 container: Document that removal from foreach is permissible
It is permissable to remove a widget using gtk_container_remove from the
gtk_container_foreach callback handler. Document this fact to make it
more discoverable.

Fixes #1461
2018-11-19 13:58:34 +01:00
Christoph Reiter
b061821f24 g-i: Add some nullable annotations
Based on grepping arg docs for NULL.
See https://gitlab.gnome.org/GNOME/pygobject/issues/261
2018-11-18 13:36:50 +01:00
Timm Bäder
55faaf1aa1 Merge branch 'jjardon/no_G_TYPE_INSTANCE_GET_PRIVATE' into 'master'
Stop using G_TYPE_INSTANCE_GET_PRIVATE completely

See merge request GNOME/gtk!402
2018-11-15 09:59:01 +00:00
Timm Bäder
7aa02b9e95 Merge branch 'include-ft2build.h' into 'master'
font chooser: Properly include freetype headers

Closes #1432

See merge request GNOME/gtk!413
2018-11-14 13:30:28 +00:00
Timm Bäder
c65c6ba11f widget: Fix size-allocate signal docs 2018-11-13 20:54:18 +01:00
Timm Bäder
359d874ddb Use g_clear_pointer to unparent widgets 2018-11-13 20:53:14 +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
28bd56454d appchooserbutton: Remove priv pointer 2018-11-13 15:19:07 +01:00
Timm Bäder
87ee7e31a4 appchooserbutton: Inherit from GtkWidget 2018-11-13 15:19:05 +01:00
Timm Bäder
5a3ecb9703 render: Fix a position/size mixup
Fixes the foreigndrawing demo.
2018-11-13 14:10:17 +01:00
Timm Bäder
e656f66720 toolbar: Remove dead code
The size definitely changes, otherwise ->size_allocate does not get
called.
2018-11-13 14:10:17 +01:00
Timm Bäder
0d47a6c970 toolbar: Remove some unused defines 2018-11-13 14:10:16 +01:00
Ernestas Kulik
edc4b2f7d0 eventcontrollerscroll: Conditionally propagate ::scroll
Currently, gtk_event_controller_scroll_handle_event() always returns
TRUE if it is handled, which stops the propagation of the event. If
there’s a single GtkEventControllerScroll in the widget hierarchy, that
means that no others will run, depending on the propagation phase. In
Nautilus, this can be observed when adding a scroll controller to the
GtkScrolledWindow (ctrl-scrolling controls the zoom level) - either the
scrolling or the zooming breaks.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/45
2018-11-12 10:35:37 +01:00
Leonardo Taccari
b3ba2961d2 font chooser: Properly include freetype headers
freetype headers should be included via <ft2build.h> and then
indirectly via FT_*_H macros.

Fixes issue #1432.
2018-11-09 22:13:30 +01:00
Timm Bäder
c2c1acc73e calendar: Remove unused struct member 2018-11-09 20:18:13 +01:00
Timm Bäder
c44728282c scrolledwindow: Remove some useless code
This is all being done already be the add_class/remove_class calls
before.
2018-11-09 19:37:55 +01:00
Timm Bäder
85a002bf9f scale: Don't set label css name to "label"
That's already the css name of all labels.
2018-11-09 18:59:30 +01:00
Timm Bäder
6eba544ad4 colorscale: Remove x/y arguments from snapshot_scale
We only pass 0 anyway.
2018-11-09 18:01:58 +01:00
Jakub Steiner
f610fbfc0e Adwaita: use HIG grey for bg_color
- refresh with a light bg color, use the new color palette
2018-11-09 15:37:08 +01:00
Jakub Steiner
1e2d11cc62 Adwaita: fix osd bg color
- don't try deriving from bg_color, osd should be consistent
  for light & dark.

FIxes issue #1449
2018-11-09 11:19:41 +01:00
Adrien Plazas
f1e24ca30a Adwaita: Propagate bg color to titlebar separator descendants
Gives the same background color to all separators descending from a
title bar than to its direct childrens.

This prevents separators which are in a titlebar but not direct children
from the widget with the titlebar style class from being almost
transparent and hence it prevent them from revealing the clear color of
the window's titlebar (black).

https://gitlab.gnome.org/GNOME/gtk/issues/1231
2018-11-09 08:49:38 +01:00
Jakub Steiner
1787f04097 Merge branch 'wip/jimmac/insensitive-progress' into 'master'
Adwaita: draw insensitive progressbars

See merge request GNOME/gtk!360
2018-11-09 07:27:49 +00:00
Jakub Steiner
671f69c6ca Merge branch 'wip/jimmac/hig-colors-gtk4' into 'master'
Adwaita: use new HIG colors

See merge request GNOME/gtk!407
2018-11-09 07:25:05 +00:00
Jakub Steiner
7b51de6bbd Adwaita: use new HIG colors
- blue selection color, success & destructive colors updates
- blueish tint for dark

Addresses issue #1443
2018-11-08 16:58:13 +01:00
Timm Bäder
0b4ee06f8e eventcontrollerlegact: Fix ::event docs
As discussed in !388.
2018-11-08 05:48:14 +01:00
Timm Bäder
797739198f icontheme: Stop exporting gtk_icon_info_new_for_file 2018-11-08 05:48:14 +01:00
Timm Bäder
0c017ff109 icontheme: Stop exporting gtk_icon_theme_color_symbolic_pixbuf 2018-11-08 05:48:14 +01:00
Timm Bäder
aad3686726 icontheme: Drop remaining emblem code 2018-11-08 05:48:14 +01:00
Timm Bäder
fe7a2635d0 icontheme: Don't reference nonexistent parameter in docs 2018-11-08 05:48:14 +01:00
Timm Bäder
2834b38d2c icontheme: Use a bit field in AsyncSymbolicData
176 -> 144 bytes
2018-11-08 05:48:14 +01:00
Timm Bäder
29563a33ba icontheme: Stop strdup'ing css colors when loading
... symbolic icons.
2018-11-08 05:48:10 +01:00
Timm Bäder
481a78eee7 widget: Avoid some more ->priv accesses 2018-11-08 05:13:50 +01:00
Timm Bäder
ac4134c298 range: Remove multipress_gesture member
We don't need it in the instance struct since we only set it up and then
access it in its signal callbacks.
2018-11-08 05:13:50 +01:00
Timm Bäder
145659af93 widget: Some whitespace fixes 2018-11-08 05:13:50 +01:00
Daniel Boles
31b8e0f109 Popover: Minimally document the ::closed signal
This is better than nothing at all. The wording is taken from Carlos's
commit message when he added this shortly before 3.12 (but skip Since).
Skip the bit from his commit message explaining what this replaced; we
don't need to say all the less good things our convenience API replaces.
2018-11-07 20:33:15 +00:00
Daniel Boles
3194c39471 TreeMenu: Don't manually reinvent g_list_index()
g_list_index() "Gets the position of the element containing the given
data (starting from 0)." That is exactly what we were manually doing.
2018-11-07 20:32:55 +00:00
Javier Jardón
9d51a8f53a gtk/gtktoolbutton.c: Document why we need to still use G_TYPE_INSTANCE_GET_PRIVATE
This is the excellent explanation from Emmanuele at
https://gitlab.gnome.org/GNOME/gtk/merge_requests/402#note_361210:
"
Every time you instantiate a type, the instance_init() function is called for each
parent type T_p of your type T; to preserve invariants, the class pointer inside
the instance data is set to the parent type before each invocation, until you hit
your type T. This means that calling GET_CLASS() inside an instance_init() function
will give you a pointer to the class vtable for the parent type T_p while you're
iterating over parent types. What if you want to access the actual class vtable of
the type T, though? Well, you can because the actual signature of instance_init() is:

  void (* GInstanceInitFunc) (GTypeInstance *instance, gpointer g_class);

i.e. all instance_init() functions get passed the instance they are initialising
and the class vtable of the real type you're instantiating.

This is how GtkToolButton works: it "peeks ahead" at instance initialisation time,
to use the button_type class field of the actual type you're instantiating,
and calls g_object_new() with it to store the resulting object in its own private
data structure.

This whole contrived mechanism is needed to allow out-of-tree tool buttons to just
set the button type on their class init, and have their parent class create the
button they want, instead of asking all tool buttons to do this themselves and have
a virtual function called get_button() for GtkToolButton to call whenever it needs
to operate on the button instance.

Now we're coming to a close: we cannot use the G_DEFINE_TYPE macro because the
instance_init() function it creates internally will not pass the class pointer
to your custom instance_init(). Since we cannot use G_DEFINE_TYPE, we also cannot use
G_ADD_PRIVATE either.

This is the reason why, when I ported GTK 3 to the new private instance data structure
macros, I left GtkToolButton alone. I should have left a comment there, because @matthiasc
tried doing that as well, and then had to revert it in commit 1c4a7bd5. So: my bad,
sorry about that.

If we want to drop the G_TYPE_INSTANCE_GET_PRIVATE and the g_type_class_add_private() calls,
we cannot use G_DEFINE_TYPE, but what we can do is unrolling what the macros do themselves:

- add a global GtkToolButton_private_offset variable
- add a static inline gtk_tool_button_get_instance_private() that does return
(G_STRUCT_MEMBER_P (self, GtkToolButton_private_offset));
- call g_type_add_instance_private (g_define_type_id, sizeof (GtkToolButtonPrivate)) inside
gtk_tool_button_get_type() and store the result in GtkToolButton_private_offset
- replace g_type_class_add_private() inside gtk_tool_button_class_init() with
g_type_class_adjust_private_offset (klass, &GtkToolButton_private_offset)
"
2018-11-07 17:50:04 +00:00
Javier Jardón
c37c86a9bf gtk/gtktextview.c: Remove unused GTK_TEXT_VIEW_GET_PRIVATE() macro 2018-11-06 13:45:58 +00:00
Marco Trevisan
9946dd2ab7 gtk-autocleanups: add cleanup function for GtkRecentInfo 2018-11-05 21:37:42 +00:00
Matthias Clasen
8099669466 Move the should_use_portal helper to gdk
We want to use it there too, in the future.
Update all callers.
2018-11-04 08:17:32 -05:00
Timm Bäder
60b0f48fbc Merge branch 'wip/carlosg/public-legacy-controller' into 'master'
Make legacy controller public

See merge request GNOME/gtk!388
2018-10-31 13:39:08 +00:00
Timm Bäder
b4acf81609 Merge branch '1422-gtkentry-s-minimum-width-is-hardcoded-to-150px-GTK4' into 'master'
gtkentry: set minimum-width to 0 instead of 150

Closes #1422 and evince#1002

See merge request GNOME/gtk!393
2018-10-26 09:25:36 +00:00
Nelson Benítez León
45e6e0cd04 gtkentry: set minimum-width to 0 instead of 150
and use 150 as natural-width.

Currently there's no way for a GtkEntry to be less
than 150px wide (apart from using "width-chars" property),
this is too much for a default minimum-width, an app
developer may need to have a shorter GtkEntry, for example
when the UI it's been shrunk by the user (see [1]) or when
you want to match the size of another widget (which is less
than 150px) see [2] for Evince bug on using
gtk_combo_box_new_with_model_and_entry() for PDF forms where
GtkEntry of ComboBox is too wide and doesn't match the combo
list width.

Using "width-chars" property may be a workaround to obtain
a short minimum-width for the entry, but is not a proper
solution for the mentioned cases as you may not know how
short your GtkEntry will be, or the fact that using "chars"
as a width unit is not pixel accurate.

Curious note: the commit that introduced the GtkEntry
minimum-width to be 150px is from 20 years ago, see
https://bit.ly/2ySEfK4

[1] This change was already suggested by Benjamin Otte
in a blog comment https://bit.ly/2J96wRo

[2] Fixes issue evince#1002
2018-10-24 23:02:31 +05:00
Jakub Steiner
ef82f1799f Adwaita: prevent devel styling break selection mode
- Selection mode does not get the special devel styling.

- removed teh last-child() selector for it doesn't work anymore.
  Better style all section of the headerbar than none. Proper fix pending.

https://source.puri.sm/Librem5/libhandy/issues/57
2018-10-22 10:31:20 +02:00
Matthias Clasen
a3ac3b61ef Merge branch '1397-gtknotebook-built-in-popup-menu-listing-tabs-doesn-t-use-tab-label-text-for-the-last-tab-4' into 'master'
Notebook: Ensure menu label updates with tab_label

Closes #1397

See merge request GNOME/gtk!386
2018-10-16 20:49:42 +00:00
Carlos Garnacho
55b32c8a8f gtkwidget: Drop obsolete code
This path is not being hit anymore, gtkmain.c does handle those events
itself.
2018-10-15 17:39:04 +02:00
Carlos Garnacho
0f4a6bfbf8 gtkeventcontrollerlegacy: Make public
And move ::event into it, dropping the GtkWidget::event signal.
2018-10-15 17:39:04 +02:00
Daniel Boles
4e884b6056 Notebook: Ensure menu_label updates with tab_label
This was noticed in Firefox and demonstrated using a GtkBuilder ui file.
buildable_add_child() calls set_tab_label(), but the latter did nothing
to update the menu_label corresponding to that tab with the new text.
Using Builder to populate the tab child, only tabs other than last got
the right non-default labels, and even that was mostly coincidental, as
adding the main child called update_labels() via real_insert_page(), so
it took effect when the 2nd last main child is added, updating the rest
but leaving the last with the default label, not that given in Builder.

Fix by factoring out the code from child_reordered() to a new helper
menu_item_recreate() and calling that in set_tab_label(), so that
whenever the tab_label is updated, so is its corresponding menu_label.

This fixes the reported case and presumably others that we could write.

fixes https://gitlab.gnome.org/GNOME/gtk/issues/1397
2018-10-12 23:50:12 +01:00
Daniel Boles
f252bbc02c Notebook: Don't notify 2x from set_tab_label_text
It calls set_tab_label(), which already does that.
2018-10-12 23:40:16 +01:00
Timm Bäder
ae3e6d1949 emojichooser: Pass chooser to add_emoji 2018-10-11 12:27:56 +02:00
Timm Bäder
114efa83c6 widget: Stop adding a legacy event controller
The only event signal left is ::event and everything needing that
connects to it directly.
2018-10-11 12:27:56 +02:00
Timm Bäder
e0a1311e5b spinbutton: Don't use gfloat in a code sample 2018-10-11 12:27:56 +02:00
Timm Bäder
50c63fc39a Merge branch 'gtkbuilder-tag-end-wrong-type' into 'master'
GtkBuildable: Fix the type of the user_data in GtkBuildable.custom_tag_end

See merge request GNOME/gtk!378
2018-10-10 11:09:25 +00:00
Chun-wei Fan
1ca5b41571 gtkimcontextime.c: Fix Korean input
Commit 64a489ad inadvertently introduced a regression that broke Korean
text input because the changes there resulted that only the last input
string that we have from ImmGetCompositionStringW() for each time the
commit signal is emitted is kept, and also as a result the final Korean
character that is input by hitting space is also lost as a result, as we
didn't check for whether we are done with preediting.

Fix these issues by doing the following when we receive the
WM_IME_COMPOSITION message with GCS_RESULTSTR from Windows:
-Do not emit the commit signal during WM_IME_ENDCOMPOSITION, and...
-Emit the commit signal anyways, as we did before c255ba68, however...
-We still save up the string to commit, because we need to re-compute
 the cursor position when we do ->get_preedit_string(), which needs to
 take the GCS_RESULTSTR string we get from WM_IME_COMPOSITION into
 account as well, so that we avoid getting the Pango criticals that
 occur during Chinese (and most likely Japanese) input as the cursor
 position is out-of-range.

Fixes issue #1350.
2018-10-09 17:10:23 +08:00
Robert Ancell
dd69c4e0f2 GtkBuildable: Fix the type of the user_data in GtkBuildable.custom_tag_end
The previous type was a pointer to a pointer, which seems to be a copy-paste
error from GtkBuildable.custom_tag_start which is an out parameter. It was
always cast in use so this is an API break, but not an ABI one.
2018-10-08 11:38:20 +13:00
Daniel Boles
cbb0d7ba69 Merge branch 'master' into 'master'
gtkstack: fix null pointer dereference

See merge request GNOME/gtk!361
2018-10-07 17:28:31 +00:00
Benjamin Otte
8e2fb9c2be docs: Update GtkSliceListModel 2018-10-07 02:23:40 +00:00
Mohammed Sadiq
f48ed12e78 slicelistmodel: Fix typos in docs 2018-10-07 07:46:58 +05:30
Benjamin Otte
0657a53940 inspector: Highlight CSS node on selection
Fixes #1383
2018-10-06 00:29:31 +02:00
Benjamin Otte
99b769706c video: Add header include guard 2018-10-06 00:29:31 +02:00
Jakub Steiner
39843ebb3f Adwaita: fix devel styling for sidebar apps
- don't put the gradient/cogged wheel on apps that have a split headerbar
  due to having a sidebar
2018-10-04 20:36:44 +02:00
Alex Monday
aa14b187e0 Adwaita: Horizontal OSD spinbutton entry fix
Add placeholder to hande horizontal spinbutton entries,
add instructions for horizontal OSD spinbutton entry to use this
placeholder.
2018-09-30 23:54:14 +05:00
Hugo Lefeuvre
44655932c4 gtkstack: fix null pointer dereference
The gtk_stack_snapshot_slide() function dereferences the
last_visible_child pointer without proper != NULL ckeck. This might
result in NULL pointer dereference and crash if last_visible_child is
invalid.

Add a != NULL check before dereferencing the pointer.
2018-09-27 09:53:22 -04:00
Jakub Steiner
278f9a9eda Adwaita: draw insensitive progressbars
- keep inheriting stuff from scales, but
  do draw highlights

Addresses issue #1191
2018-09-26 22:43:31 +02:00
Jakub Steiner
aeca5858d8 Adwaita: tone down the 'devel' styling
The selected bg was too prominent and intefered with button styling.
2018-09-26 15:50:58 +02:00
Timm Bäder
89b96a864e Merge branch 'wip/arnaudb/fix-dashed-border-4' into 'master'
Make dashed border-style work correctly

See merge request GNOME/gtk!355
2018-09-25 07:12:58 +00:00
Arnaud B
42d064c62f Make dashed border-style work correctly
There’s a short-path done for focus rectangles, but it can be taken in other conditions, and then fail occasionally to render a dashed line if the border-width is too big.
2018-09-24 09:39:55 +02:00
Timm Bäder
d51abaea2e scalebutton: Remove unused define 2018-09-23 18:01:59 +02:00
Timm Bäder
248708c282 button: Remove key_controller member
Unneeded now.
2018-09-23 17:59:37 +02:00
Timm Bäder
0e2748006a assistant: Remove some unused defines 2018-09-23 17:34:03 +02:00
Timm Bäder
e89bd7dfa2 menu: Remove useless if statement 2018-09-23 17:34:03 +02:00
Timm Bäder
2f6e998a27 menu: Show scroll arrows if necessary 2018-09-23 17:34:03 +02:00
Timm Bäder
7b7296410e menu: Remove arrow visibility flags 2018-09-23 17:34:03 +02:00
Jan Alexander Steffens (heftig)
d90e2733ea GtkApplication: Fix CRITICAL on shutdown when register_session=FALSE
Close https://gitlab.gnome.org/GNOME/gtk/issues/1323#note_327705
2018-09-22 17:56:38 +01:00
Daniel Boles
19bf502fde Merge branch 'master' into 'master'
flattenlistmodel: Fix uninitialized variable warning

See merge request GNOME/gtk!347
2018-09-22 16:52:49 +00:00
Piotr Drąg
2b8e30a8ed Use Unicode apostrophes in new strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2018-09-20 19:01:14 +02:00
Yi-Soo An
4ad8dcebd8 flattenlistmodel: Fix uninitialized variable warning
Variable, added, would be a garbage value if model is NULL and
the following code, if condition, use the uninitialized variable.
A side effect could be occurred by that.

To avoid, the variable is initialized to zero.
2018-09-20 12:45:33 +09:00
Benjamin Otte
be2609a271 inspector: Handle case where there's no default application 2018-09-19 04:31:29 +02:00
Benjamin Otte
5bf009a203 cssrbtree: Fix a crasher
After removing elements, there were a few cases where the tree wasn't
properly balanced which could further down violate assumptions about the
layout.

Attached is the original testcase that triggered it. I didn't bother
simplifying it.
2018-09-19 04:31:29 +02:00
Benjamin Otte
60cb315be6 Merge branch 'revealer-support-min-size-master' into 'master'
gtkrevealer: support minimum size of child

Closes #635

See merge request GNOME/gtk!317
2018-09-18 15:19:12 +00:00
Carlos Soriano
57ef793e6d revealer: Support minimum size of child
Up until now when allocating the child it only used the natural size
while the measuring also used the minimum size, resulting in a clipped
child when animating if the child had different minimum size and
natural size. This was an obvious case when using labels that had
ellipsization.

This commit gives full allocation to the child by inverting the size
the revealer reduces from its animation progress.

Code done by Benjamin Otte.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/635
2018-09-18 11:36:29 +02:00
Benjamin Otte
2c84049769 treelistmodel: Improve naming a bit
The complexity with model items vs row items is really confusing. Add to
that treelistmodel position vs child model position vs parent position,
and you're so confused, even the best naming can't help.

And once you're there, consider passthrough vs non-passthrough...
2018-09-18 08:03:03 +02:00
Benjamin Otte
29c700d1c7 listmodels: Clarify documentation for function prototypes
Fixes #1341
2018-09-18 08:02:21 +02:00
Mohammed Sadiq
0d7c987b1a Revert "listlistmodel: Fix documentation comment"
This reverts commit 03679d4342.

listlistmodel is private
2018-09-18 10:01:12 +05:30
Mohammed Sadiq
03679d4342 listlistmodel: Fix documentation comment 2018-09-18 09:56:19 +05:30
Georges Basile Stavracas Neto
1a4b60fb36 tree-list-model: Return the correct item type
When passthrough is enabled, it should return the GType
of the child GListModels; when disabled, it should be
GTK_TYPE_TREE_LIST_ROW.

The conditions are inverted however, causing a few
warnings to trigger.

Fix that by returning the correct GType.
2018-09-18 00:51:57 -03:00
Mohammed Sadiq
f211d71f74 treelistmodel: Fix memory leak
gtk_tree_list_model_init_node() increases the reference count
of the model passed. Let's not do that, and let it take the
model passed.
2018-09-18 07:50:44 +05:30
Mohammed Sadiq
9e3e9e83ef treelistmodel: Fix signal emission on row destroy 2018-09-18 07:11:27 +05:30
Rico Tzschichholz
f3e6d00db1 gtk: Fix some g-i annotations warnings 2018-09-17 13:00:36 +02:00
Robert Ancell
c8a13a2d8a toolbar: Use hexpand/vexpand Gtk+ properties 2018-09-17 10:25:59 +02:00
Matthias Clasen
231b76bdd1 tree list model: Add docs 2018-09-16 23:07:00 -04:00
Matthias Clasen
57ba4048de Minor doc fix
Clarify some wording.
2018-09-16 23:07:00 -04:00
Benjamin Otte
b92c328425 sortlistmodel: Actually insert unsorted items at the wrong place
We were adding items in reverse order, oops.
2018-09-17 03:57:37 +02:00
Benjamin Otte
9ffd88012d docs: Add missing TreeListModel docs 2018-09-16 19:39:39 +02:00
Benjamin Otte
b7bf04fabd inspector: Update the controllers list to show parent controllers
Now we show all the controllers that are relevant when widget gets sent
events.
2018-09-16 18:50:17 +02:00
Benjamin Otte
f3834138f7 GtkSortListModel: Add 2018-09-16 18:50:17 +02:00
Benjamin Otte
64d97b233b GtkSliceListModel: add 2018-09-16 18:50:17 +02:00
Benjamin Otte
db8474e5b1 inspector: Make controllers page use gtk_list_box_bind_model() 2018-09-16 18:50:17 +02:00
Benjamin Otte
5e8983883e inspector: Rename "Gestures" page to "Controllers"
And rename GtkInspectorGestures => GtkInspectorControllers, too.
2018-09-16 18:50:17 +02:00
Benjamin Otte
59006e2e03 inspector: Make gestures page handle all controllers
This requires removing support for gesture groups.
2018-09-16 18:50:17 +02:00
Benjamin Otte
b6acc31d44 GtkMapListModel: add 2018-09-16 18:50:17 +02:00
Benjamin Otte
6d0fe46cba propertylookuplistmodel: Add
This model just takes an object and a property name and recursively
looks it up. In particular, I want it for:

widget, widget.parent, widget.parent.parent, ...
2018-09-16 18:50:17 +02:00
Benjamin Otte
05e752e096 inspector: Turn object tree into a GtkListBox
The code gets rid of the GtkTreeView and replaces it with a GtkListBox.

Most of the logic is now done via GListModel subclasses.

A big change is that this new list is now tracking updates itself and
doesn't need to be manually updated. All code that used to cause rescans
or add forgotten objects to the tree has been removed.

If objects are missing from the object tree, the logic for tracking them
needs to be added.
2018-09-16 18:50:17 +02:00
Benjamin Otte
417ac4ab43 inspector: Use a GtkPicture to display render nodes
Instead of the outdated render node view, use modern GTK APIs.
2018-09-16 18:50:17 +02:00
Benjamin Otte
4495eaae84 inspector: Add an icon to the render node list 2018-09-16 18:50:17 +02:00
Benjamin Otte
aba76fe8e9 inspector: Make the render node tree use a ListBox
It used to be a treeview.
2018-09-16 18:50:17 +02:00
Benjamin Otte
867042f88f widget: Add gtk_widget_observe_controllers()
This mirrors gtk_widget_observe_children() - just that it observes the
controllers, not the children.
2018-09-16 18:50:17 +02:00
Benjamin Otte
32ec7dec61 gtk: Add GtkFlattenListModel
We can flatten lists of lists into lists now!
2018-09-16 18:50:17 +02:00
Benjamin Otte
d6161e09cd treelistmodel: Add more API to navigate the tree
This adds functionality from GtkTreeIter into GtkTreeListRow that allows
finding items in the model and getting their position for use in
GtkListBox.
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
4f70f72349 gtk: Add GtkFilterListModel
This is a GListModel implementation that filters the given source model.
2018-09-16 18:50:17 +02:00
Benjamin Otte
dd94129e27 widget: Add gtk_widget_observe_children()
This creates a listmodel that tracks a widget's children. Doing so turns
adding/removing children from O(1) to O(N) though, so use with caution.
2018-09-16 18:50:17 +02:00
Benjamin Otte
63e5b827ed window: Add gtk_window_get_toplevels()
This one returns a list of all toplevel windows.
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
Matthias Clasen
d7a5dcba0b gtk_application_inihit: allow no reason
We document this argument as nullable, so treat it as such.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1327
2018-09-13 23:31:48 -04:00
Jakub Steiner
0edec9bcae Merge branch 'adwaita-fixes' into 'master'
Adwaita fixes

See merge request GNOME/gtk!333
2018-09-10 14:29:54 +00:00
Adrien Plazas
7d12a843f2 Adwaita: Set selection mode to headerbars if it's on ancestors
This allows to set the container of the headerbars in selection mode
rather than having to set the mode to each element of the title bar.
2018-09-10 15:51:12 +02:00
Adrien Plazas
867efe2e33 Adwaita: Style separator.sidebar
Let separators be declared as sidebars to have the same style as those
drawn by GtkStackSidebar. This also let them handle the selection-mode
class, whether they are assigned it or they descend from something in
selection mode.

Also drop setting the selection mode color for non-sidebar separators.

This is convenient when building a custom sidebar using a GtkSeparator
and to extend a sidebar to the title bar.
2018-09-10 15:50:43 +02:00
Adrien Plazas
a121bfa7ec Adwaita: Drop the background of nested headerbars
This is needed to work around headerbar sliding animation issues without
refactoring Adwaita's support of titlebars and headerbars as it may
break applications.

https://gitlab.gnome.org/GNOME/gtk/issues/1264
2018-09-10 15:49:37 +02:00
Jakub Steiner
02758cd48d Merge branch 'wip/adwaita/linked-entry-error-state-fix-master' into 'master'
Adwaita: Fix linked elements in error state

See merge request GNOME/gtk!315
2018-09-10 10:47:05 +00:00
Peter Simonyi
4e8c06eb7a win32 theme: Fix css syntax error 2018-09-07 08:31:22 -04:00