Commit Graph

29668 Commits

Author SHA1 Message Date
Florian Müllner
07beb6dba2 appchooserwidget: Don't limit application list unconditionally
As documented, GtkAppChooser is "typically [used] for the purpose of
opening a file". However given that applications that support neither
opening files nor URLs are filtered out, the chooser is not actual
useful for any other (atypical) usage. Change that by only applying
the filtering if a content-type was set, and use the full unfiltered
list otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=789327
2017-10-26 06:18:01 -04:00
Christian Persch
29d1cc2fcd actionable: Allow all detailed action name formats
Use g_action_parse_detailed_name() to enable use of this API
for actions with non-string parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=788841
2017-10-26 06:16:59 -04:00
Matthias Clasen
5bdc67f3f6 Drop gtk_cell_renderer_get_size
This function has been deprecated since 3.0, time to drop it.
2017-10-25 22:27:19 -04:00
Matthias Clasen
fb8589671d Drop unused includes of gtkrender.h
We don't use the gtk_render apis internally anymore.
Drop these includes so it is clear where the remaining
uses are.
2017-10-25 21:46:46 -04:00
Matthias Clasen
f8e74e8f04 Some minimal theme fixes for focus drawing
We don't want focus rectangles everywhere, so set them up
explicitly for the widgets where we want them, and only
if focus(visible) is set.
2017-10-25 18:35:32 -04:00
Matthias Clasen
46d4deeb1e Remove a shortcut in gtk_widget_set_focus_child
Since focus can now be represented by more than one state,
just looking at the focus_child is no longer sufficient - we
may fail to propagate :focus(visible) if we do so. For now,
just remove the shortcut and always do the work.
2017-10-25 18:26:06 -04:00
Matthias Clasen
0d4bd034c6 Always draw outline
We can now control with CSS where there the outline
is drawn.
2017-10-25 17:59:00 -04:00
Matthias Clasen
4209c1762d Support the new state in CSS selectors
Make :focus(visible) match the new state.
2017-10-25 17:59:00 -04:00
Matthias Clasen
8b15eabad2 Set the new state flag
For now, we only set the new visible focus state
on the focus widget, when we have visible focus.
Later on, we will allow setting it on other widgets.
2017-10-25 17:49:43 -04:00
Matthias Clasen
18b8a7f91f Add a state flag for visible focus
The new flag is called GTK_STATE_FLAGS_FOCUS_VISIBLE.
2017-10-25 17:49:43 -04:00
Timm Bäder
0d82de585c Adwaita: Remove focus outlines from scrollbars and scales
gtk3 didn't have focus outlines for these, so remove them for now.

Sorry lapo.
2017-10-25 09:34:52 +02:00
Chun-wei Fan
20fc576275 gtk/gtkcssenumvalue.c: Deal with __builtin_popcount on MSVC
__builtin_popcount is a GCCism that is used to count the number of bits
involved, which means any non GCC/CLang compilers won't like the code,
meaning that on MSVC builds we must implement it ourselves.

We first use __cpuid() to check whether the CPU supports the popcount
instruction, if it does, we use the __popcnt intrinsic, otherwise
(untested, since I don't have a system that does not have the
instruction), we use the suggested hacks at
http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:53:37 +08:00
Chun-wei Fan
a601e5d10e gtk/gtkwin32theme.c: Include gdk/gdkprivate.h
We still need to access the GdkEvent structure here directly, as using
the GdkEvent getters is likely not worth the trouble involved.

Please see Emmanuele's comment (#97) of the following bug URL.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:48:01 +08:00
Benjamin Otte
373b407bd2 Fix build
Don't do two things at once and forget to run ninja before pushing.
2017-10-24 18:26:08 +02:00
Benjamin Otte
8549e62d85 Add default return values to switch statements
We are using g_assert_not_reached() without doing anything, assuming it
aborts the program. In release builds however, it is ignored.
2017-10-24 18:21:03 +02:00
Matthias Clasen
6c74a8c755 inspector: Show more render node details
Should clip and container node details.
2017-10-24 15:24:23 +02:00
Alexander Larsson
96b04836d8 Drop all uses of GdkPixbufAnimation in the gtk APIs
These are basically animated gifs, and don't fit well in how
modern things animate.
2017-10-23 16:56:49 +02:00
Alexander Larsson
b1250935a0 GtkIconHelper: Remove unused code 2017-10-23 15:34:17 +02:00
Alexander Larsson
0089e4ad58 Drop pixbuf support in IconHelper and ImageDefinition
These are no longer used, instead we always covert to surface as
early as possible and drop the pixbuf.

This means we never store both the pixbuf and the surface at
for any longer time, which is wasteful. Also, its one step further
to drop GdkPixbufs from generic use in our APIs.
2017-10-23 15:28:33 +02:00
Alexander Larsson
61b2ab5d90 GtkDragSource: Don't use gtk_image_definition_new_pixbuf
We want to get rid of pixbuf image definitions.

Long term this should probably be gtk_drag_source_set_icon_surface instead.
2017-10-23 15:28:33 +02:00
Alexander Larsson
e205ae9fc1 CellRendererPixbuf: Never store pixbufs
Rather than store the pixbufs as themselves we immediately convert
them to surfaces. In the uncommon case that a pixbuf is read back
from the renderer we generate a new one from the surface data.
2017-10-23 15:28:33 +02:00
Alexander Larsson
2b194089dd GtkImage: Drop support for storing pixbufs
This drops the pixbuf property and the pixbuf getters. We keep
gtk_image_new/set_from_pixbuf, but these are small helpers that
immediately convert to a surface, and there is no way to later get
back the pixbuf you passed in.

The from file/resource codepaths are also changed to load a surface
instead of a pixbuf.
2017-10-23 15:28:33 +02:00
Timm Bäder
7ee2ab32b8 window: Use correct destroy notify for icon list
The list contains cairo_surface_t instances now, not GdkPixbuf anymore.
2017-10-23 14:43:47 +02:00
Timm Bäder
134ba2ebf7 icontheme: Silence some compiler warnings 2017-10-23 14:23:52 +02:00
Matthias Clasen
493f5d6b18 dnd: Add more surface apis
The new function, gtk_drag_source_set_icon_surface, is for setting
a drag source icon without using GdkPixbuf.
2017-10-23 14:16:31 +02:00
Alexander Larsson
d3fc937b4d GtkWindow/GdkWindow: Finish converting icons to surfaces
There were some parts left, for instance gdk_window_set_icon_list.
2017-10-23 13:45:25 +02:00
Alexander Larsson
6f8644ad25 GtkEntry: Use surfaces, not pixbufs for bitmapped icons 2017-10-23 13:45:25 +02:00
Alexander Larsson
7a0ce9804f aboutdialog: Use set_boxed on surface
cairo_surface_t is boxed, not a GObject.
2017-10-23 13:45:25 +02:00
Matthias Clasen
dfaed90f67 inspector: show color matrix node details
Show the matrix and the offset for color matrix nodes.
2017-10-23 11:47:23 +02:00
Matthias Clasen
a072f9fc06 Use a color matrix for symbolic icons
The recoloring of symbolic icons is just a color matrix
operation.
2017-10-23 11:47:17 +02:00
Matthias Clasen
e4cdbef092 Allow passing a color matrix when rendering icons
This will be used for symbolic icons.
Update all callers.
2017-10-23 11:44:52 +02:00
Matthias Clasen
b543257e42 icon helper: Use cached textures
Use a cached texture for themed icons if we can.
Currently, we only do this for non-symbolic icons.
2017-10-23 08:07:35 +02:00
Matthias Clasen
02db8ccd89 icon theme: Add a texture cache
Return cached textures for icons. This lets us avoid duplicate
texture uploads for icons whose surfaces we already cache.
2017-10-23 08:07:35 +02:00
Matthias Clasen
6c7d9c6445 recent manager: Remove dead code
These functions are no longer used.
2017-10-23 08:07:08 +02:00
Timm Bäder
f59e5b2b31 adwaita: Remove focus outlines from textviews 2017-10-23 07:58:07 +02:00
Matthias Clasen
8eea3e2ddd window: Correct the property definition for icon
cairo surfaces are boxed types, not objects.
2017-10-23 07:39:12 +02:00
Matthias Clasen
85503a8f95 about dialog: Correct the property definition for logo
cairo surfaces are boxed types, not objects.
2017-10-23 07:38:36 +02:00
Matthias Clasen
8b84df422b Drop gtk_recent_info_get_icon
We are moving away from pixbuf-based apis.
Use gtk_recent_info_get_gicon instead.
2017-10-23 06:21:59 +02:00
Matthias Clasen
b775238bc4 Document new clipboard apis
These are surface-based replacements for some pixbuf apis.
2017-10-23 05:58:54 +02:00
Matthias Clasen
65408a0b0c Document new selection apis
Document the new cairo surface-based apis for GtkSelection.
2017-10-23 05:58:54 +02:00
Matthias Clasen
50006c229f Drop gtk_drag_set_icon_pixbuf
We are moving away from GdkPixbuf in the api.
Use surface-based replacements instead.
2017-10-23 05:58:54 +02:00
Matthias Clasen
27e89c69cd selection: Add another surface api
Of course, we need a getter too.
2017-10-23 05:58:54 +02:00
Alexander Larsson
a4f7d0c0e0 GtkAboutDialog: Use surfaces for logo 2017-10-22 23:03:19 +02:00
Alexander Larsson
d22c91127f gtk_image_get_surface: Add docs 2017-10-22 22:57:55 +02:00
Alexander Larsson
aa873e7709 GtkWindow: Use cairo_surface_t for icons 2017-10-22 22:57:21 +02:00
Matthias Clasen
d8a4503c53 recent chooser: Don't use pixbuf based apis
Use gtk_drag_set_icon_surface here.
2017-10-22 22:23:01 +02:00
Matthias Clasen
6c57432e79 recent manager: always return a GIcon
Make gtk_recent_info_get_gicon return a useful GIcon in
all cases.
2017-10-22 22:22:55 +02:00
Matthias Clasen
ad00108678 selection: Add surface based apis
Add gtk_selection_data_set_surface.
2017-10-22 22:22:44 +02:00
Matthias Clasen
e5ce3144e0 image: Add surface based apis
Add gtk_image_get_surface.
2017-10-22 22:22:37 +02:00
Matthias Clasen
8f6fbc9c24 clipboard: Add surface apis
Add gtk_clipboard_set_surface and gtk_clipboard_wait_for_surface.
2017-10-22 22:22:31 +02:00
Timm Bäder
afea254526 overlay: Remove unused NULL-check 2017-10-20 15:12:28 +02:00
Timm Bäder
04c550bfb5 window: Make sure we query the window size before size-allocate'ing 2017-10-20 14:56:29 +02:00
Timm Bäder
09750f9937 renderborder: Don't snapshot all-invisible borders
If all of the borders have an alpha of 0, we don't need to snapshot
anything.
2017-10-20 14:56:29 +02:00
Timm Bäder
99026d2df8 renderbackground: Minimize style lookups
Move the early returns up so we don't look up all those css values for
no reason.
2017-10-20 14:56:29 +02:00
Timm Bäder
f5b0692cfc widget: Remove outdated comment on get_allocation
The allocation passed to gtk_widget_size_allocate can be retrieved these
days, using gtk_widget_get_allocated_size.
2017-10-20 14:55:53 +02:00
Matthias Clasen
55df74a102 window: Remove dead code
GtkWindow never has a parent widget, so we never need to create
a child window for it.
2017-10-20 14:43:11 +02:00
Matthias Clasen
04f6b26205 gsk: Tweak text node apis
Rename getters to follow the peek naming pattern.

Update all callers.
2017-10-20 13:54:01 +02:00
Matthias Clasen
243bd4f0c8 gsk: Tweak cairo node apis
Rename the surface getter to peek, following other render
node getters, and make the surface-based constructor private,
since it is not something we want to encourage.

Update all callers.
2017-10-20 13:54:01 +02:00
Emmanuele Bassi
95beabe4d6 build: Fix gtk_tools array expansion
The gtk_tools variable is an array of arrays; adding a new element
requires to maintain the same type, or we'll get a build failure when
we try to extract the newly added element.
2017-10-20 11:22:45 +01:00
Chun-wei Fan
18abb78bfd Meson: Support Windows builds
Add the necessary machinery into the Meson definition files so that we
can build for Windows.

Since we don't have Wayland or X support for our use case here, disable
them once we know that we are building for Windows, as they are
(otherwise) enabled by default, and enable the items that need to be
built for Windows builds.

Exclude gtk4-launch from Windows builds as that is something that
is not supported on Windows.

As we won't have gio-unix on Windows, and PangoFT2 is optional, don't use
fallbacks for them when we are on Windows (but do use fallbacks for
gio-win32, as it will be used).

Also, clean up meson.build a bit as we can just force-include
msvc_recommended_pragmas.h from GLib since we depend on GLib, and so we
can handle these warnings from msvc_recommended_pragmas.h instead.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-10-20 17:30:58 +08:00
Matthias Clasen
9c391e7a9f Optimize away trivial opacities
No need to go color matrix on an opacity of 0 or 1.
2017-10-19 12:08:39 +02:00
Debarshi Ray
7ee0e65631 GtkGestureZoom: Don't leak the list of sequences
https://bugzilla.gnome.org/show_bug.cgi?id=789149
2017-10-19 10:03:46 +02:00
Matthias Clasen
9da057568c Fix GtkStatusbarAccessible
GtkStatusbar is no longer a container, so GtkStatusbarAccessible
can no longer be a container accessible.
2017-10-18 17:30:20 +02:00
Matthias Clasen
3287469929 gtk: Stop using pixdata resources
It does not really help, and pixdata is deprecated.
2017-10-18 17:30:20 +02:00
Timm Bäder
e0623fb5ad emojichooser: Plug memory leak 2017-10-17 08:54:08 +02: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
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
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
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
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
Timm Bäder
bec55e216c aboutdialog: Fix code snippets
Define all variables and fix a missing comma in the first
gtk_show_about_dialog call.
2017-10-11 12:55:01 +02:00
Timm Bäder
0f8abcd112 applicationwindow: Fix code sample
Declare all variables, use proper GtkApplication constructor and the
right GTK_APPLICATION() cast for gtk_application* API.
2017-10-11 12:41:47 +02:00
Timm Bäder
236098f89b togglebutton: Fix code snippet
Remove gtk_box_pack_start usage, gtk_dialog_get_content_area, fix wrong
gtk_dialog_new parameters and actually add a output_state callback.
2017-10-11 12:35:55 +02:00
Timm Bäder
cc5fb1db03 gtksettings: Fix code snippet
gtk_init does not take any arguments anymore and
GTK_TYPE_IMAGE_MENU_ITEM is gone.
2017-10-11 12:21:20 +02:00
Timm Bäder
8ff713840b label: Make all code snippets properly compile 2017-10-11 12:18:22 +02:00
Timm Bäder
b2fd6dd3dd accellabel: Document new API 2017-10-11 11:08:46 +02:00
Timm Bäder
e19dae4b74 conview: Fix rubberband coordinates when scrolling 2017-10-11 10:55:20 +02:00
Timm Bäder
21108475a8 iconview: Remove double-MAX when updating rubberband 2017-10-11 10:50:03 +02:00
Timm Bäder
9455c92b99 rendericon: Fix texture transformation
Use the one from snapshot_icon, which works.
2017-10-11 09:24:35 +02:00
Timm Bäder
c8add3d169 modelmenuitem: Fix icon/label alignment
gtk_box_pack_end will put the label child at the right side of the label
(in LTR orientation), but we want it left, directly next to the icon.
Also remove the spacing from the box child as this is a theme thing.
2017-10-11 09:03:40 +02:00
Timm Bäder
b3fedda29e grid: Only pass baselines to children that request it 2017-10-11 08:50:21 +02:00
Timm Bäder
e7e3ef9d3e grid: Simplify allocating children
allocation->x and allocation->y are always 0. MAX'ing width/height with
1 is also wrong now since 0 is a valid width/height for widgets.
2017-10-11 08:50:21 +02:00
Timm Bäder
804476a07f eventcontrollerscroll: Emit ::scroll for -1/+1 discrete steps
The > 1 meant it only emits the signal for -2/+2 steps.
2017-10-11 08:50:21 +02:00
Timm Bäder
abed139a59 cssnode: Delay getting the parent style until we need it
There's an early return before.

Look at all those saved cycles.
2017-10-11 07:35:09 +02:00
Matthias Clasen
5d86d209e9 Don't set child position in a ui file
It is not necessary, and causes assertions in some of
our tests.
2017-10-10 19:40:29 -04:00
Benjamin Otte
0836e8cf59 cssnode: Don't put wrong styles in the style cache
~Company ╡ so TL;DR: we put the static style in the cache, but then
       ⤷ ╡ compute a child style from the animated style in the cache
       ⤷ ╡ and we put the child style also in the cache (because
       ⤷ ╡ it's not animated)
       ⤷ ╡ then we run the animation, but reuse the cache every time
       ⤷ ╡ for both child and parent
       ⤷ ╡ so after the animation is done, we end up with a cache that
       ⤷ ╡ has the correct static style for the parent but an
       ⤷ ╡ incorrect static style for the child
       ⤷ ╡ because that static style was computed from the
       ⤷ ╡ initial animated style

This fixes https://bugzilla.gnome.org/show_bug.cgi?id=763517
2017-10-10 21:45:18 +02:00
Timm Bäder
a22ef67b17 cssnodedeclaration: Add gtk_css_node_declaration_to_string 2017-10-10 20:59:57 +02:00
Timm Bäder
7e8f2f6178 build: Drop redundant workaround
This is fixed and we require a meson > 0.39 anyway.
2017-10-10 12:53:06 +02:00
Timm Bäder
657983cfda Don't try to snapshot invisible icons
These spew criticals when width == 0 || height == 0.
2017-10-10 09:49:35 +02:00
Timm Bäder
f50832864e scalebutton: Fix comparison for empty icon list 2017-10-10 09:49:35 +02:00
Timm Bäder
c1af127c28 stylecontext: Fix doc comment
There is no @cr here anymore.
2017-10-10 09:49:35 +02:00
Timm Bäder
4a03e86d4f textdisplay: Remove widgets parameter from gtk_text_layout_draw
All calls in gtk+ were passing NULL anyway.
2017-10-10 09:49:35 +02:00
Timm Bäder
b994cac6dd grid: Drop priv pointer 2017-10-10 09:49:35 +02:00
Matthias Clasen
672fb60879 snapshot: Use a better placeholder
An empty container has the same effect as transparency
with the cairo renderer, but creates black with Vulkan.
To avoid this, explicitly use a transparent color node.

This fixes the css blendmode example in gtk4-demo with
the Vulkan renderer.
2017-10-08 22:19:22 -04:00
Daniel Boles
2cd65158a0 Dialog: Clarify that response ID 0 is not reserved
I only got so far in math, but it looks to me like zero isn’t positive.
We don’t reserve it, so be clear about that.
2017-10-08 22:21:12 +01:00
Daniel Boles
77b75bdab1 MenuButton: Document the correct no-direction icon
Document open-menu-symbolic, which we use, not view-context-menu, which
does not exist.
2017-10-08 21:09:42 +01:00
Matthias Clasen
ab22734159 Fix application window snapshot differently
As Timm Baedert pointed out, the previous fix made the
menubar go on top of popovers, which is just wrong. Instead,
make gtk_window_snapshot handle all direct children of the
window, taking care to stack popovers correctly.
2017-10-08 14:03:19 -04:00
Matthias Clasen
9e613be8c6 inspector: Show child bounds for repeat nodes
The more information, the better.
2017-10-08 09:02:35 -04:00
Timm Bäder
007e4639a8 snapshot: Set blend mode directly after pushing state
This is important since _push_state returns a pointer into a GArray
which could be invalidated and point to garbage after the subsequent
push_state call.
2017-10-08 08:28:35 +02:00
Matthias Clasen
f597de817e snapshot: Fix blend mode handling
We were getting out states confused and were always creating
a blend mode node with mode NORMAL.
2017-10-07 23:31:47 -04:00
Matthias Clasen
f8c48240d9 Adwaita: theme the shortcuts window search results
Add some margins, and, since we can, also move the spacing here.
2017-10-07 22:45:49 -04:00
Matthias Clasen
c9eab36216 Shortcuts window: Make search results themable
Add a style class to the box containing search results,
so we can apply style here.
2017-10-07 22:45:05 -04:00
Matthias Clasen
4903f809a6 application window: Make menubar appear
This needed to be ported to snapshot, still.
2017-10-07 22:24:09 -04:00
Matthias Clasen
de2074d3a3 Adwaita: theme shortcuts windows a bit
Add some space around the content.
2017-10-07 20:13:13 -04:00
Matthias Clasen
fee3d20e44 shortcuts: Add css names to some widgets
This will let us put some styling in place for these.
2017-10-07 20:12:18 -04:00
Matthias Clasen
7e64ee52a8 scrollbar: keep populate-popup signal working
This is used for example in the source tab of gtk4-demo.
It broke because GtkScrollbar no longer is a GtkRange,
but rather has one. So we need to forward the signal.
2017-10-07 19:53:19 -04:00
Matthias Clasen
9f8f3fc7ac notebook: Don't steal right-clicks from content
We only want to pop up the context menu in the tab strip.
2017-10-07 19:26:39 -04:00
Matthias Clasen
0f0557157b Adwaita: Fix scrollbar theming a bit
Reinstate the fine-tune mode scrollbars.
2017-10-07 19:10:58 -04:00
Matthias Clasen
f2a7e1219b scrollbar: Correct css docs
The .fine-tune class appears on the range node.
2017-10-07 19:10:10 -04:00
Matthias Clasen
e49615184a Drop the env var for scrolling control
This was never meant to be an official api, but rather
a transition help. Time to drop it for GTK+ 4.
2017-10-07 18:27:51 -04:00
Matthias Clasen
5b8b892dd6 textview: Fix memory handling
When cleaning up the text appearance struct, we forgot
to add the new strikethrough_rgba member to the copy
function.
2017-10-06 23:06:52 -04:00
Matthias Clasen
41cd4c812e printing: Fix page drawing
We were drawing frames around our drawing areas.
2017-10-06 22:50:03 -04:00
Matthias Clasen
8e1ef3620a printing: Some fixes to the print dialog
Hide widgets that are meant to be hidden initially, and use
the right spin button apis.
2017-10-06 22:33:55 -04:00
Matthias Clasen
acb12e1198 button: Fix label alignment in checks and radios
Yes, this is ugly, but the alternative is broken ui.
2017-10-06 22:32:53 -04:00
Daniel Boles
4269ca0bfa HC: Avoid inflated titlebar separator in GEdit etc
It was selecting paned separator, which means any separator at any level
of descent within a paned, including the toplevel container in GEdit.

We need to be more specific and only select the relevant separator that
is the direct child of the paned. This is what Adwaita does.

https://bugzilla.gnome.org/show_bug.cgi?id=788573
2017-10-07 01:30:49 +01:00
Daniel Boles
497e877755 TreeViewCol: Fix SEGV on remove/add, + memory leak
Nulling priv->button in _unset_tree_view() is asymmetrical: we create
it via init(), not _set_tree_view(), so we shouldn’t null in the latter.

Worse, doing so manifests in criticals + a SEGV easily with basic use of
testtreecolumns, removing the TVC from a TV then trying to add it to one

Finally, the wrong null-out meant dispose() failed to unref the button,
so it leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=728452
https://bugzilla.gnome.org/show_bug.cgi?id=788614
2017-10-07 00:46:37 +01:00
Daniel Boles
af28c031fc TreeViewCol: Don’t try to disconnect null treeview
https://bugzilla.gnome.org/show_bug.cgi?id=788614
2017-10-07 00:46:37 +01:00
Daniel Boles
161b063909 Revert "treeviewcolumn: Don't leak button"
This reverts commit 2c28c627c1.

See following commits: the real problem is setting priv->button to NULL
soon after this, so this just makes that wrong decision look more right.

https://bugzilla.gnome.org/show_bug.cgi?id=788614
2017-10-07 00:45:40 +01:00
Daniel Boles
c1a5afb3a8 FileChooserButton: Avoid unref()ing a null model 2017-10-07 00:44:24 +01:00
Matthias Clasen
b5fe4c0a1d settings: Don't assert in notify
We can legitimately hit the default case in this switch,
so don't assert that we don't.
2017-10-06 19:30:27 -04:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Carlos Garnacho
a0de570e47 gtktreeview: Transform cell area to widget coordinates
GtkCellArea uses event coordinates (thus in treeview relative
coordinates), but calculations used to happen in bin window coords.
We can just offset the cell area by the bin window, fixes cell
renderer activation and edition.
2017-10-06 18:26:08 +02:00
Carlos Garnacho
f7d02bfb61 treeviewcolumn: Don't swallow motion/crossing events
If the column is not clickable, it may make some sense to stop
event propagation here for button events. However motion events
should be left alone.

Fixes treeview column resize pointer cursors, since that's
implemented up the bubbling phase in the treeview.
2017-10-06 18:25:44 +02:00
Carlos Garnacho
0724fa7f61 treeview: Transform motion event coords to "bin window" coords
The operations rely there on bin window relative coordinates, but we
are receiving GtkTreeView relative coordinates there. Fixes clicking
on treeview expanders, which was offset by visible headers.
2017-10-06 18:23:26 +02:00
Timm Bäder
d832e5b2dd modelbutton: set_relative_to(NULL) the popover in dispose
We do set_relative_to(menu_button) when creating it so we should do this
here (or nothing).
2017-10-06 17:35:28 +02:00
Timm Bäder
2c28c627c1 treeviewcolumn: Don't leak button
We g_object_ref_sink the button in _create_button, so we need to unref
it ourselves.
2017-10-06 17:23:34 +02:00
Timm Bäder
d292ebc7bd filechooserbutton: Don't leak priv->model 2017-10-06 17:14:31 +02:00
Timm Bäder
b34c84ab6d applicationwindw: Don't leak show-help-overlay action 2017-10-06 16:30:31 +02:00
Benjamin Otte
c1e9869329 build: Don't turn off critical warnings
-Wint-conversion is important because it checks casts from ints to
pointers.

-Wdiscarded-qualifiers is important to catch cases where we don't
strings when we should.
2017-10-06 16:03:08 +02:00
Benjamin Otte
2936953d9f build: Remove old Makefile.inc files
They seem to have been forgotten in the meson transition
2017-10-06 16:03:07 +02:00
Timm Bäder
869d9e8fe7 Widget: make sure windowed widgets have a 1×1 min size 2017-10-06 14:38:07 +02:00
Timm Bäder
3b9aa2f8d9 widget: Allow 0×0 allocations
Don't MAX the allocations with 1 anymore.
2017-10-06 14:38:07 +02:00
Timm Bäder
aef86a8b2c searchbar: Remove superfluous padding
So it's not 6px high when the child revealer is concealed.
2017-10-06 14:38:07 +02:00
Timm Bäder
9125dc7069 box: Drop priv pointer 2017-10-06 14:24:52 +02:00
Timm Bäder
02a526c04a image: Remove mention on gdk-pixbuf-csource
gdk-pixbuf-csource as well as gdk_pixbuf_new_from_inline are deprecated.
Mention GResource instead.
2017-10-06 10:40:23 +02:00
Daniel Boles
fbf24d1bd0 HC: Add border/hilight when hovering flat buttons
The border and icon highlight are useful feedback that was defeated by
CSS precedence. It worked for .titlebuttons due to their implementation,
but the same was not true for custom .flat buttons. This makes it so.

https://bugzilla.gnome.org/show_bug.cgi?id=788580
2017-10-06 02:40:42 +01:00
Daniel Boles
70fa5be983 HC: Flat titlebuttons became non-flat in backdrop
When the window was backdropped, they suddenly regained their border.
This was clearly not intentional or of any practical use to anyone.

Shuffle around some selectors so that the backdrop ones do not override
the flat ones and make the borders magically reappear when backdropped.

Note that, whereas standard titlebuttons get the border on :hover, other
.flat buttons in the headerbar do not. That should probably be fixed too

https://bugzilla.gnome.org/show_bug.cgi?id=788580
2017-10-06 02:40:15 +01:00
Daniel Boles
018bee64aa HighContrastInverse: Make window borders visible
They were hard-coded to a transparent black, but that is our bg colour
in HC Inverse, so windows stacked on top of each other or a dark
background blended together into a mush.

Fix this by making the $_wm_border* colours relative to the fg colour,
so that HighContrastInverse gets borders that are transparentised white.

https://bugzilla.gnome.org/show_bug.cgi?id=788575
2017-10-06 00:38:53 +01:00
Daniel Boles
efaf9948be HC: Fix MessageDialog’s rounded bottom borders
A missing decoration selector meant that we got a solid black background
behind the rounded corners of the dialog.

Copy the equivalent code from Adwaita, including nicely rounding the
focus outline too (& sorry, but this needs more newlines to be readable)
2017-10-06 00:25:10 +01:00
Daniel Boles
84de918ce0 HighContrast: Fix titlebar containing >1 headerbar
by migrating the relevant code from Adwaita, to dodge unwanted doubling
up of the bottom border and such.

https://bugzilla.gnome.org/show_bug.cgi?id=769877
2017-10-05 23:03:01 +01:00
Marco Trevisan (Treviño)
d2a577d797 HighContrast: set min-height for headerbars
https://bugzilla.gnome.org/show_bug.cgi?id=784562
2017-10-05 22:36:52 +01:00
Daniel Boles
0fb4a018f5 HC: Copy working tooltip code from Adwaita & tweak
There were various problems, like only selecting on .tooltip and not the
widget node tooltip, not being specific enough for tooltip.csd, etc. So,
specific theming was absent, and default popup window styles got applied

This commit copies in the better working tooltip CSS from Adwaita, but
applies a couple of changes to make it work better in the HC themes:
 • Reduce the transparency of the tooltip, so we achieve higher contrast
 • Drop the black text-shadow, as it is not useful on this more black bg

Note: we may then need to re-add some of this to the .tooltip class. But
it is unclear what needs done there. While Adwaita is not doing it, we
are better not to confuse by keeping it in HC only; we should try to be
as close as possible, to make it easier for HC to keep up with Adwaita.

https://bugzilla.gnome.org/show_bug.cgi?id=769879
2017-10-05 19:40:36 +01:00
Daniel Boles
6b2c8bfcf1 HC: Give tooltips a border for contrast on Inverse
https://bugzilla.gnome.org/show_bug.cgi?id=769879
2017-10-05 18:44:04 +01:00
Daniel Boles
3ad7a86961 HighContrast: Actually style tooltips...
We need to select on the widget itself too, not just other things with
the .tooltip class.

https://bugzilla.gnome.org/show_bug.cgi?id=769879
2017-10-05 18:44:04 +01:00
Timm Bäder
7770bdcb36 switch: Fix int/double comparison
We get a double coordinate.
2017-10-05 10:21:54 +02:00
Timm Bäder
786d89cd9d scrolledwindow: Make sure gtk_get_current_event_state returned a state
Technically correct and pleases Coverity.
2017-10-05 10:21:54 +02:00
Timm Bäder
3515a27f8e appchooserdialog: Remove unused macro 2017-10-05 10:21:54 +02:00
Timm Bäder
f9744cf194 combobox: Remove unneeded queue_resize call
The remove/add/set_parent/unparent calls in there already do the
necessary work.
2017-10-05 10:21:47 +02:00
Daniel Boles
a4fda99539 HighContrast: Correctly select window decoration
We need

    .window-classes decoration

but within the decoration parent selector, we were doing
&.window-classes, which gave us

    decoration.window classes

We need to fix this by selecting on .window-classes &

https://bugzilla.gnome.org/show_bug.cgi?id=788496
2017-10-05 01:40:24 +01:00
Daniel Boles
88b15beb0a updateiconcache: Avoid confusing loop construct
n_attach_points is the result of g_strv_length(): the index at which the
string vector ends in NULL. So by definition, when i == n_attach_points,
string[i] == NULL, and there is no need to check for the latter. The
fact that we did appears to confuse static analysers, as the dereference
and index check were inverted from what would normally be safe. We could
reverse them, but we may as well just remove the unnecessary NULL check.

https://bugzilla.gnome.org/show_bug.cgi?id=788458
2017-10-04 22:59:11 +01:00
Colomban Wendling
e4754a007b Enter submenus when activating their parent item
This gives consistent behavior with e.g. Qt, Mozilla's suites and
LibreOffice (with non-truly native backends like "gen" and "gtk",
but unlike "gtk2" and "gtk3" ones that probably use true GTK menus).

This behavior is expected by at least some accessibility users, and
it seems good to behave like other common applications and toolkits
in this area.  There should be no issue in doing so either for current
users, as it only enters the submenu instead of not doing anything.

https://bugzilla.gnome.org/show_bug.cgi?id=778811
2017-10-04 22:52:18 +01:00
Daniel Boles
f63519dc01 TreeMenu: Remove accidentally duplicated doc lines
Not that it actually matters, as this is not public anymore, but this
was done accidentally. Also, sync a property description to ComboBox.
2017-10-04 12:05:13 +01:00
Daniel Boles
9c3ea3f9a0 ComboBox|TreeMenu: Slightly clarify wrap-width doc 2017-10-04 10:22:21 +01:00
Daniel Boles
5849b98568 ComboBox|TreeMenu: Clarify :row|column-span-column
ComboBox and TreeMenu warned in the doc for :row-span-column that the
value must not exceed :wrap-width, but :wrap-width does not interact
with the number of rows; it’s the :column-span-column that’s relevant.

Also: Warn that spans must be > 0 for rows too, and that column spans <=
:wrap-width are also not useful for items at menu column positions > 0.

Finally, refer to items having spans, not values, as we were already
talking about values in the model (and rows in the menu).
2017-10-04 10:22:20 +01:00
Matthias Clasen
ffaaba6676 inspector: Add gsk and vulkan information
Show the used gsk renderer, as well as some information
about Vulkan, in the General tab.
2017-10-03 21:06:50 -04:00
Daniel Boles
252b03c43e Frame: Enhance CSS docs
Indicate how the old shadow types are replaced by CSS border-style et
al., and quote the names of nodes and classes for easier readability.
2017-10-02 19:50:02 +01:00
Carlos Garnacho
3bdc9d7b3a imcontext: Fix typo on ctrl+shift+u hex sequences handling
This condition was meant to exit when the event has no keyval (eg. fed a
non-keyboard event somehow).
2017-10-02 18:13:57 +02:00
Timm Bäder
604da889ea snapshot: Fix mixup when creating crossfade nodes
We need to set the progress on the end node.
2017-10-02 15:25:44 +02:00
Timm Bäder
f5297e6f4b snapshot: Use one GPtrArray for all nodes
Instead of creating one GPtrArray per GtkSnapshotState and saving nodes
in there, create one GPtrArray per snapshot and assign a
start_node_index to every GtkSnapshotState as well as a n_nodes variable
so every state knows which nodes belong to it.
2017-10-02 14:34:47 +02:00
Timm Bäder
8e59b3b387 snapshot: Use one large GArray for all states
Allocating all of them separately shows up in profiles.
2017-10-02 14:34:47 +02:00
Timm Bäder
d2afa1d72a gtkroundedbox: Remove some unneeded conditionals
Always pass exactly 4 GtkCssValue* parameters to apply_border_radius
and make sure they are properly const.
2017-10-02 14:34:47 +02:00
Timm Bäder
0f6574dd05 stylecontext: Drop priv pointer 2017-10-01 09:19:09 +02:00
Timm Bäder
b5c3c51124 spinner: Remove priv pointer 2017-10-01 09:19:09 +02:00
Timm Bäder
29a6c66aec switch: Remove priv pointer 2017-10-01 09:19:09 +02:00
Timm Bäder
edaa2c42ee label: Remove priv pointer 2017-10-01 09:19:09 +02:00
Timm Bäder
bcaed4b420 image: Remove some unneeded includes 2017-10-01 09:19:09 +02:00
Timm Bäder
2da82f890a image: Remove priv pointer
Look at all the free ram!
2017-10-01 09:19:09 +02:00
Timm Bäder
a32725bc9a iconhelper: Don't inherit from GObject
It's not a GtkCssGadget anymore, it doesn't have any properties or
signals either and it's not public. Further, its lifetime is very clear
the way it's being used inside GTK+.
2017-10-01 09:19:09 +02:00
Timm Bäder
773973db78 cssshadowsvalue: Don't heap-allocate shadows
This showed up in profiles in certain scenarios, so export a
_get_n_shadows getter instead and let callers provide a sufficiently
large allocated array of GskShadows, which we can use with
g_alloc/g_newa.
2017-10-01 09:19:09 +02:00
Timm Bäder
53409623e5 switch: Remove some unneeded includes 2017-10-01 09:19:09 +02:00
Benjamin Otte
e9dedc5036 inspector: GSK_IS_RENDER_NODE() does NULL-check
That means we don't need an extra one just so gcc can complain.
2017-09-30 20:23:11 +02:00
Timm Bäder
a196ad725a widget: Fix inserting child widgets at the beginning
We have to care about the child widget's current prev/next sibling as
well.
2017-09-29 12:15:23 +02:00
Timm Bäder
392af59140 box: Remove return value from box_pack
Unused.
2017-09-29 10:50:33 +02:00
Timm Bäder
ad1f5fe61a box: Remove size_allocate_no_center
GtkBox never has a center widget these days.
2017-09-29 10:49:41 +02:00
Timm Bäder
f38555712b adwaita: Remove outlines from focused entries for now 2017-09-29 09:23:56 +02:00
Matthias Clasen
5d698c1452 Recorder: Add details for inset and outset shadow nodes 2017-09-28 21:41:24 -04:00
Matthias Clasen
352b566179 Recorder: Show details about linear gradient nodes 2017-09-28 21:06:35 -04:00
Matthias Clasen
89261d18c2 Recorder: Show details of blur nodes 2017-09-28 19:48:42 -04:00
Matthias Clasen
5e4f7301d6 recorder: Show details for blend nodes 2017-09-28 19:40:03 -04:00
Matthias Clasen
0d8b2535d8 Recorder: Show details of crossfade nodes 2017-09-28 19:20:25 -04:00
Matthias Clasen
2d5a121c3c recorder: Show details for opacity nodes 2017-09-28 19:14:32 -04:00
Matthias Clasen
9e9df66b81 Recorder: Show details of border nodes 2017-09-28 18:58:18 -04:00
Matthias Clasen
ae549c6ce4 recorder: Put text color in the right row
It ended up in the wrong place by accident.
2017-09-28 18:41:39 -04:00
Matthias Clasen
cddf415cbb Recorder: Show colors visually for text too
Just because we can do it.
2017-09-28 18:37:47 -04:00
Matthias Clasen
2da234d70d Reshuffle the recorder ui a bit
Make it possible to see the properties and the rendering at
the same time, it makes navigating easier.
2017-09-28 18:37:00 -04:00
Matthias Clasen
e58ee9ad52 recorder: Show surfaces and textures
This makes the properties list much more interesting.
2017-09-28 18:17:38 -04:00
Matthias Clasen
65bfdf4b15 recorder: Show text node properties 2017-09-28 17:16:41 -04:00
Matthias Clasen
149dd1f558 recorder: show color information for color nodes
A first step towards showing more information for render nodes.
2017-09-28 15:54:30 -04:00
Timm Bäder
29a4f0ce1f Plug some memory leaks
Make sure the scroll controllers in GtkComboBox and GtkScrolledWindow
get destroyed.
2017-09-28 20:01:01 +02:00
Piotr Drąg
91bb86ca20 inspector: Mark missing strings for translation 2017-09-28 14:01:57 +02:00
Sam Thursfield
c9df0c34bf flowbox: Fix annotation for GListModel binding callback
The GtkFlowBoxCreateWidgetFunc type lacked GObject Introspection
annotations for its arguments. This made gtk_flow_box_bind_model()
unusable from Python as the callback function would be passed useless
values.

The annotations that I've added match those of the similar callback
type GtkListBoxCreateWidgetFunc.

https://bugzilla.gnome.org/show_bug.cgi?id=780758
2017-09-27 13:33:20 +02:00
Debarshi Ray
60cee7339f GtkBuilder: Enforce "class" as a mandatory attribute for <object>
https://bugzilla.gnome.org/show_bug.cgi?id=786931
2017-09-25 15:26:34 +02:00
Daniel Boles
00f8a11aec Label: Replace allow-none with nullable/optional 2017-09-24 19:32:19 +01:00
Timm Bäder
da701ede91 emojichooser: Plug a memory leak 2017-09-24 18:15:41 +02:00
Matthias Clasen
88664f7ccb Fix a typo 2017-09-21 22:53:49 -04:00
Daniel Boles
c0fdf522dd ToolItem: Fix nullable annotation put on wrong arg
D’oh
2017-09-20 23:55:15 +01:00
Daniel Boles
761194dad7 Overlay: Document style classes added per position 2017-09-20 19:19:25 +01:00
Carlos Garnacho
e0a3c9d2de gtkmain: Ensure to emit real GDK_LEAVE_NOTIFY events.
If we got a GDK_LEAVE_NOTIFY event from GDK, we would reset the
GtkPointerFocus, but the event would be silently consumed.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
44cb3ccfa1 gdk: Remove motion hints
Motion hints are now literally a thing of the past. Everything should be
using the full motion event stream.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
a9988e18b0 gtk: Remove 2BUTTON and 3BUTTON events and event types
Those should be interpreted by widget-local gestures, not guessed at a
high level with no notions of the specific context. Users will want
GtkGestureMultiPress to replace these events.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
1f91ca0cec gtklistbox: Remove enter/leave/motion event handlers
Those worked similarly to those in GtkFlowBox, but would additionally
handle "active" state for child rows. Simplify this to just enabling/
disabling active state on gesture press/release, we don't get the
nice state updates when hovering around with a mouse button pressed,
but the rationale from flowbox applies here, and makes a nice cleanup.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
7d196db4c0 gtkcolorswatch: Remove enter/leave event handlers
Those just maintained prelight state, which is already managed internally.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
9d5c04012e gtkbutton: Remove enter/leave event handlers
They just maintain priv->in_button and widget state up-to-date, this
basically matters during user interaction, and is already maintained
in the gesture ::update handler. This seems to be sufficient.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
c4d57f85f4 gtkflowbox: Drop crossing/motion event handlers
Those basically controlled priv->active_child_active, which would
1) trigger a redraw when the pointer enters/leaves it, and 2) ensure
that press/release happen on the same child for it to be activated.

The former is not necessary, and the latter can be simplified by
just checking again the child on the coordinates given by the
::release gesture handler. This makes all enter/leave/motion_notify
event handlers unneeded.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
27a391bad8 gtkspinbutton: Remove motion notify handler
It does nothing nowadays.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
b31029457b gtkcalendar: Use scroll event controller 2017-09-19 18:40:50 +02:00
Carlos Garnacho
cf6ecc9095 gtkscrolledwindow: Use scroll event controller
All kinetic scrolling initial velocity calculations are now
taken from the scroll controller. The handling of timeouts
to snap back when overshooting has been also made to just
apply on devices that can't emit ::scroll-begin/end.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
ad05caedd3 gtkspinbutton: Use scroll event controller 2017-09-19 18:40:50 +02:00
Carlos Garnacho
9a204921ae gtkscalebutton: Use scroll event controller 2017-09-19 18:40:50 +02:00
Carlos Garnacho
861916fd0b gtkrange: Use scroll event controller 2017-09-19 18:40:49 +02:00
Carlos Garnacho
f3474645c4 gtkpathbar: Use scroll event controller 2017-09-19 18:40:49 +02:00
Carlos Garnacho
d0e27ba760 gtkmenu: Use scroll event controller 2017-09-19 18:40:49 +02:00
Carlos Garnacho
215c4ed419 gtkcombobox: Use scroll event controller 2017-09-19 18:40:49 +02:00
Carlos Garnacho
c3fbd58916 gtk: Add GtkEventControllerScroll
This is a GtkEventController implementation to handle mouse
scrolling. It handles both smooth and discrete events and
offers a way for callers to tell their preference too, so
smooth events shall be accumulated and coalesced on request.

On capable devices, it can also emit ::scroll-begin and
::scroll-end enclosing all ::scroll events for a scroll
operation.

It also has builtin kinetic scrolling capabilities, reporting
the initial velocity for both axes after ::scroll-end if
requested.
2017-09-19 18:39:03 +02:00
Carlos Garnacho
f2ded6a685 gtk: Change gtk_propagate_event() to propagate both ways.
This change is made for consistency, it doesn't make sense to expose
one-way propagation, as it can only break expectations from GTK+. This
function might be made entirely private in the future, but it still
makes sense to do this in one go for our internal usecases.
2017-09-19 18:39:03 +02:00
Carlos Garnacho
c02d0f3c0a eventcontroller: Drop event_mask API
This is unchecked, we can remove it entirely as well.
2017-09-19 18:39:03 +02:00
Carlos Garnacho
5b9287ed77 gtkwidget: Drop pointer emulation out of touch events
Users of touch events are required to either use a GtkGesture, or handle
touch events themselves.
2017-09-19 18:39:03 +02:00
Carlos Garnacho
8c350459ae gtk: Run GtkWidgetClass event signals inside a GtkEventController
This will allow further cleanups and optimizations in capture/target/bubble
event delivery. For simplicity, ATM every widget will receive its own
GtkEventControllerLegacy, it could be desirable to add finer control over
this in the future, so widgets that fully use event controllers for input
management can do away without this legacy piece.
2017-09-19 18:39:03 +02:00
Matthias Clasen
880d44aa48 widget: Give up on GdkEvent api for now 2017-09-19 18:39:03 +02:00
Matthias Clasen
0ab20b6253 treeview: Give up on GdkEvent api for now
There's multiple places where events are manually generated
here, this needs more thought.
2017-09-19 18:39:03 +02:00
Matthias Clasen
d0c92fba69 entry accessible: Give up on GdkEvent api for now
Just include gdkeventsprivate.h here for now. This may be
resolved by just dropping icon support from GtkEntry down
the road.
2017-09-19 18:39:03 +02:00
Matthias Clasen
0554f6372b a11y: Stop listening for configure events
This needs to be done differently.
2017-09-19 18:39:03 +02:00
Matthias Clasen
208a85c3fe treev view column: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
56189fdb74 clipboard: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
efd287feb3 a11y: Use GdkEvent API in some places
More work needed.
2017-09-19 18:39:03 +02:00
Matthias Clasen
853602bf63 tooltip: Use GdkEvent API
And at the same time, reshuffle things slightly to avoid
creating synthetic events.
2017-09-19 18:39:03 +02:00
Matthias Clasen
96daf93821 text view: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
9c477951cb text handle: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
aeaa42121f selection: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
f43849901d search bar: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
c7225bc8c1 scrolled window: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
7793e8f071 places view: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
5d5ae459c4 place sidebar: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
3b266de66c path bar: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
75b16ac855 pad controller: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
ebc66eefa8 menu shell: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
d7ccf36d71 menu item: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
b99c3d33ec im context simple: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
67489349a5 header bar: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
50701abcc3 gesture zoom: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
5430751644 gesture swipe: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
1a8f0686ca gesture single: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
17832f9617 gesture rotate: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Matthias Clasen
b5b84e6abe gesture drag: Use GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
7d6a2a832c gesture: Use GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
9794dc5628 window accessible: Use GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
16781c8598 widget accessible: Use GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
c68c754f3e settings: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
7cbd35dd86 gesture rotate: Partially convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
d20efc15a9 gesture: Partially convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
6b4dfcadaf flowbox: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
c586a6486f file chooser widget: Covert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
2246387d21 expander: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
7ed6add550 entry: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
067e209582 dnd: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
c12a54a3ed cell renderer accel: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
01b993d1fb bindings: Convert to use GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
63eecd3dfa bindings: Partially update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
e5a3e95b8c a11y: Partially update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
261fdad7ca inspector: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
177f3ef655 gtkwindow: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
14a28224e4 treeview: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
b4f88e1544 tooltip: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
9f32f5f994 textview: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
35301530bb texthandle: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
e2eb20208b spinbutton: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
0a55573ca3 scrolledwindow: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
627a73cf57 scalebutton: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
e41844f751 recentchoooser: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
c0b77a2941 range: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
5785db64ce popover: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
8803886319 placesview: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
2abfc602ca placessidebar: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
e6349c940e paned: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
b9db1a5410 notebook: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
46336aaebe mountoperation: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
e023367a8a menu: Update to using GdkEvent API
To some extent, plenty of root coordinate calculations left...
2017-09-19 18:39:02 +02:00
Carlos Garnacho
1b6ff9df76 listbox: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
dee14dda8d imcontext: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
3d7ad2af4f iconview: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
7545b908de gesture: Update to using GdkEvent API
To some extent, pad and touchpad gesture events need extra API.
2017-09-19 18:39:02 +02:00
Carlos Garnacho
67239f112e fontchooser: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
e67090df91 flowbox: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
c48a196d77 filechooser: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
75d8175715 entrycompletion: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
e46a1d32f0 entry: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
92be6488c4 combobox: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
df4b0340a6 colorswatch: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
510554f679 colorplane: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
a46173980e coloreditor: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
75492e3cef cellrendererspin: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
769ce02aef cellarea: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
ff187eeb17 calendar: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
fac9ba0fff button: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
96e7777198 appchooserwidget: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
9b7b1b65b6 aboutdialog: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Matthias Clasen
49aada63ee css: Drop the new indent api again
It is not used anymore, and it was not a good idea.
2017-09-18 23:22:38 -04:00
Matthias Clasen
6859f0a6d1 css: Use enums instead of idents for font-variant properties
As Benjamin says, ident should only be used if any value
is valid, which is not the case here. So use enums instead,
which should also be more efficient. To handle the more
complicated cases like font-variant-ligatures, we have to
introduce flags-like values.
2017-09-18 23:22:38 -04:00
Daniel Boles
50106521d6 Window: Clarify documentation of set_application()
Clarify that ::destroy, not ::hide*, removes a window from its app, by
replacing the mention of open windows with the blurb on destruction from
:application, completing commit 7db4bee4b6

Also link to the equivalent gtk_application_(add|remove)_window() calls,
since Application.add_window() already links back to Window:application.

* unless you use gtkmm…

https://bugzilla.gnome.org/show_bug.cgi?id=639931
2017-09-19 00:20:17 +01:00
Daniel Boles
7178ab8e41 PlacesSidebar: Avoid unused mem if !CLOUDPROVIDERS
The member GList *cloud_rows is only ever used if HAVE_CLOUDPROVIDERS is
defined, so don’t declare it if not.
2017-09-19 00:20:17 +01:00
Daniel Boles
94eecf57dc PlacesSidebar: Unref cloud_manager in dispose()
We ref the CloudProviders singleton in init() but did not unref it in
dispose(). Do so, using g_clear_object().

https://bugzilla.gnome.org/show_bug.cgi?id=787600
2017-09-18 23:30:57 +01:00
Daniel Boles
383fa87993 SidebarRow: Unref CloudProvider on change/finalize
It was never unref()d, either when replacing the existing GObject in
set_property(), cleaning up in finalize(), or becoming a placeholder.

Fix by using g_set_object() and g_clear_object() to unref as needed.

This also drops the check that the newly set object is a valid cloud
provider account, as we don’t do the equivalent for any of the other
object-typed properties, and Carlos didn’t think this was important.

https://bugzilla.gnome.org/show_bug.cgi?id=787600
2017-09-18 23:30:57 +01:00
Matthias Clasen
f87dc24867 Fix a typo
The property is called font-variant-alternates, not -alternatives.
Correct this everywhere.
2017-09-18 18:10:08 -04:00
Matthias Clasen
92398bb1bb css: implement font-variant as a shorthand
Drop the current css2-style font-variant property and
replace it with a shorthand as specified in the css3 fonts
module. Currently, we fully support the font-variant-ligatures,
font-variant-position, font-variant-caps, font-variant-numeric
and font-variant-east-asian subproperties. font-variant-alternatives
is only partially supported.
2017-09-18 14:27:06 -04:00
Matthias Clasen
b91f3ce331 css: Implement font-variant-east-asian
This is translated to the corresponding OpenType features.
2017-09-18 14:26:57 -04:00
Matthias Clasen
8a7f2ca0be css: Implement font-variant-alternatives
This is only a partial implementation, since we don't support
@font-feature-values. The only supported value is historical-forms,
for now.
2017-09-18 14:26:57 -04:00
Matthias Clasen
b99cb70299 css: Implement font-variant-numeric
This gets translated to the corresponding OpenType features.
2017-09-18 14:26:57 -04:00
Matthias Clasen
8525afc408 css: Implement font-variant-caps
This gets translated to the corresponding OpenType features.
2017-09-18 14:26:57 -04:00
Matthias Clasen
01ed84fbef css: Implement font-variant-position
This gets translated to the corresponding OpenType features.
2017-09-18 14:26:57 -04:00
Matthias Clasen
c4cbe5feca css: Implement font-variant-ligatures
This gets translated into corresponding OpenType features.
2017-09-18 14:26:57 -04:00
Matthias Clasen
cee4622567 css: Implement font-kerning
This gets translated to the OpenType feature kern.
2017-09-18 14:26:57 -04:00
Matthias Clasen
6420dd934f Add an auxiliary ident parsing function
This lets us conveniently create ident values from
multiple candidates.
2017-09-18 14:26:57 -04:00
Georges Basile Stavracas Neto
0bdaebef1e window: Improve detection of edge constraint support
Instead of relying on special values of edge constraints, this
patch adds an internal-only gdk_window_supports_edge_constraints()
function that by default returns FALSE, and is implemented by
GdkWindowWayland and GdkWindowX11.

This way, we can properly detect server-side support for this
feature and adapt accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Georges Basile Stavracas Neto
b1c4e9afef window: Add individual CSS classes based on edge constraints
The last touch on this patch series is making GtkWindow able to
selectively adjust various UI details based on the different
tiled edges. The main driver here is that we don't want to show
shadows on edges that are constrained.

This patch adds the necessary code to do that, while still
maintaining compatibility with the old ways.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Georges Basile Stavracas Neto
45f4844880 window: handle tiled edges separately
GTK windows don't have their tiling states really
hooked into the client-side decoration code, and
the only effect it has is disabling the resizing
edges.

With the introduction of per-edge tiling information,
we are backed by much more precise data on how the
window manager wants the app to behave.

This patch, then, fixes GtkWindow to take into account
per-edge tiling information. For compatibility purposes,
the previous tiled field was kept, and thing will just
continue working if no edge information is supplied.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Matthias Clasen
d0cae3ecba Fix the -gtk-outline-radius shorthand
It needs to refer to the -gtk-prefixed subproperties now.
2017-09-17 21:17:30 -04:00
Matthias Clasen
d3198536a4 Drop support for deprecated pseudo-classes
We no longer have any of those.
2017-09-17 17:04:16 -04:00
Matthias Clasen
a08e2b5692 Drop code parsing deprecated forms of url
We no longer allow whitespace between url and (.
2017-09-17 17:01:29 -04:00
Matthias Clasen
d1b77fd60f Drop code handling deprecated style properties
We no longer have any deprecated style properties.
2017-09-17 16:59:26 -04:00
Matthias Clasen
82b86c2c1c Drop the aliasing api for style properties
This was added to deprecate style properties. All deprecated
style properties are gone now, so this is no longer needed.
2017-09-17 16:57:53 -04:00
Matthias Clasen
793513993b Drop the gtk-key-bindings property
This has been deprecated for a while. Just use the -gtk-prefixed
name.
2017-09-17 16:57:53 -04:00
Matthias Clasen
226aee0828 Drop the icon-shadow property name
This has been deprecated for a while. Just use the -gtk-prefixed
name.
2017-09-17 16:57:53 -04:00
Matthias Clasen
de3179e7c0 Drop aliases for outline radius
The outline-{top,bottom}-{left,right}-radius names have been
deprecated for a while, so lets remove them. Everybody should
just use the -gtk-prefixed names for these properties.
2017-09-17 16:57:53 -04:00
Matthias Clasen
d3727817ff Drop support for one-stop gradients
These have been deprecated for a while. Time to make this an
error for GTK+ 4.
2017-09-17 16:53:02 -04:00
Matthias Clasen
737cae8e10 Drop support for pango syntax in css
This has been deprecated for a while, so it should go away
for GTK+ 4.
2017-09-17 16:52:55 -04:00
Daniel Boles
f714500b8d Adwaita: Fix color of focus outline on colorswatch
The focus outline disappeared as the colour of the swatch got close to
the normal focus outline colour, which is alpha(currentColor, 0.3).

Fix by making the outline an alpha’d version of the tick colour, but
more opaque than normal outlines. 0.6 seems good enough; feel free to
improve it, but at least this ensures the outline can’t vanish anymore.

HighContrast achieves this already because it applies the color property
to the main node, not the overlay. Doing that means the outline is fully
opaque, which is fine for HC obviously but was excessive for Adwaita.

https://bugzilla.gnome.org/show_bug.cgi?id=787757
2017-09-16 17:02:48 +01:00
Daniel Boles
7c809cfb73 Adwaita: dark: Make colorswatch.light tick visible
It used $text_color unconditionally, but in :dark, text is white, so we
overlaid a white tick on any light colours, all the way to white itself.

Using these named colours doesn’t make practical or semantic sense.
Instead, use white/black over dark/light swatches, as in HC, so all
variant–swatch combos work. Light looks the same, & :dark works now.

For backdrop, use alpha 0.5, unlike 0.7 in HC, as that seemed excessive
& different from the current effect. 0.5 is almost identical to how
$backdrop_fg_colour is a 50% mix of $fg_color, & matches backdrop text.

https://bugzilla.gnome.org/show_bug.cgi?id=787531
2017-09-16 17:02:48 +01:00
Daniel Boles
7161b57063 Expander: get_label() return is nullable
Also, use gchar to match the header.
2017-09-15 18:25:47 +01:00
Chun-wei Fan
0332dbca94 gtk/gentypefuncs.py: Open files in utf-8 encoding
On Python-3.x, we need to set the encoding when opening files, when this
script is run, as it might contain items that are not supported by the
system's locale (for example, non-English Windows).  So, we use a
wrapper to set the encoding on Python 3.x, but open the file as we did
when using Python 2.x, since file encodings are not supported there.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-09-15 21:41:15 +08:00
Daniel Boles
89790bb412 Expander: Annotate new()’s label arg as nullable
to match new_with_mnemonic()
2017-09-14 21:21:09 +01:00
Daniel Boles
050531a9f2 Expander: Replace (allow-none) with (nullable)
The former is deprecated in favour of the latter.
2017-09-14 21:21:08 +01:00
Daniel Boles
3cd117e3a1 Expander: Explain how to conditionally style arrow 2017-09-14 21:21:08 +01:00
Daniel Boles
d48f904e3c Spinner: Document how to select on animated in CSS
This is not particularly obvious, so it seems worth including.
2017-09-14 19:25:50 +01:00
Daniel Boles
ac4faad8a2 Frame: Add missing fixed-width format to enums 2017-09-14 18:29:08 +01:00
Timm Bäder
c8efb575f8 iconview: Stop using ::button-{press,release}-event
Use a gesture instead.
2017-09-13 17:58:45 +02:00
Timm Bäder
054df8e6ec calendar: Stop using ::button-{press,release}-event 2017-09-13 17:37:25 +02:00
Daniel Boles
d207e03918 FlowBox: Explain how to avoid inflated min size
along the orthogonal orientation. It seems a FlowBox on its own can only
handle being shrunk along its main orientation. The orthogonal requests
a huge min size – reserving what it would need if the main orientation
got its min size, which would flow all children in 1 line orthogonally.

Adding it to a ScrolledWindow (any policy) enables free shrinking, so
size_allocate() can reflow how users in this situation probably expect.

https://bugzilla.gnome.org/show_bug.cgi?id=787021
2017-09-12 22:49:48 +01:00
Hiroyuki Ito
efaf99b039 ColorButton: Don’t destroy dialog @ ::delete-event
Without specifically connecting ::delete-event to something, the dialog
will be destroyed when it is closed, for example by pressing Esc. This
meant that when dismissing it this way, unlike by pressing Cancel, any
custom palette would be lost when the dialog was next opened, and so on.

Resolve this by making ::delete-event just do GTK_RESPONSE_CANCEL, so
closing the dialog has the same effect as clicking its Cancel button.

https://bugzilla.gnome.org/show_bug.cgi?id=787444
2017-09-12 20:52:43 +01:00
Philip Withnall
80b10aa1bd gtksettings: Add a debug message if there is no default GtkSettings
Make it slightly more obvious when things are about to slide sideways
because a NULL GtkSettings has been returned to a caller. This is a
valid return value, but is rarely handled correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=778382
2017-09-12 16:04:44 +01:00
Philip Withnall
69102ac8df gtknotebook: Simplify some if-conditions
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=787303
2017-09-12 15:22:13 +01:00
Philip Withnall
7069dc0261 gtkmountoperation-x11: Do array length check before dereference
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=787302
2017-09-12 15:21:59 +01:00
Nirbheek Chauhan
aa3e8ee097 build: Add dependency fallbacks for libs with meson ports
With these changes gtk+ builds for me using fallbacks for all libraries
with fallbacks available. Needs the following changes:

https://github.com/ebassi/graphene/pull/109 (graphene)
https://bugzilla.gnome.org/show_bug.cgi?id=787414 (pango)
https://github.com/mesonbuild/meson/pull/2291 (will be in meson 0.42.1)

https://bugzilla.gnome.org/show_bug.cgi?id=787416
2017-09-12 00:24:58 +05:30
Nirbheek Chauhan
1a11d0071b build: Add girs and typelibs as sources to libgtk_dep
This will be needed by any projects that want to use gtk+ as
a subproject.

https://bugzilla.gnome.org/show_bug.cgi?id=787416
2017-09-12 00:24:58 +05:30
Matthias Clasen
86f018c6a7 Fix a corner-case for emoji input
As reported in https://github.com/ibus/ibus/issues/1944,
typing u201e while holding Ctrl+Shift used to give a „
when letting go of Ctrl+Shift. This broke when we introduced
Ctrl+Shift+e to start Emoji sequences. Fix this by only
looking for Ctrl+Shift+e if we are not already in a hex
sequence.
2017-09-11 11:20:07 -04:00
Matthias Clasen
b0e8d8483d More work on text nodes
This commit takes several steps towards rendering text
like we want to.

The creation of the cairo surface and texture is moved
to the backend (in GskVulkanRenderer). We add a mask
shader that is used in the next text pipeline to use
the texture as a mask, like cairo_mask_surface does.
There is a separate color text pipeline that uses the
already existing blend shaders to use the texture as
a source, like cairo_paint does.

The text node api is simplified to have just a single
offset, which determines the left end of the text baseline,
like all our other text drawing APIs.
2017-09-10 14:36:26 -04:00
Daniel Boles
09d1d5a0d6 Entry: Fix leak of text in ensure_has_tooltip()
Thanks to Mohammed Sadiq for noticing this. I guess I got
Widget.get_tooltip_text() confused with Label.get_label().

https://bugzilla.gnome.org/show_bug.cgi?id=787410
2017-09-07 14:56:20 +01:00
Matthias Clasen
15edfbbc88 Rename and document the enable-gir option
You can disable introspection now with -Dintrospection=false.
2017-09-06 09:53:34 -04:00
Matthias Clasen
af5d3e3299 popover: Fix a warning
We were unintentionally disconnecting an already-disconnected
signal handler in some cases. Don't do that, it causes warnings.
2017-09-06 08:04:33 -04:00
Matthias Clasen
863a9cef98 entry: Set a clip
Now that GtkEntry is using a text node, we were spilling
the contents out to the side when the entry is scrolling.
Avoid that by setting a clip.
2017-09-05 23:29:59 -04:00
Chun-wei Fan
1b7f08171a gskpango.c: Include cairo.h consistently
The other source files use "#include <cairo.h>", so we should do
likewise.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-09-06 10:42:32 +08:00
Daniel Boles
d97db77ad4 ActionBar: Fix links in set_revealed() doc, etc.
mostly: syncing with previous commit, where InfoBar copied this all from

Also, remove my unhelpful “and vice-versa” from InfoBar.
2017-09-05 21:33:00 +01:00
Daniel Boles
14387ed2e7 InfoBar: Fix typos in set_revealed() documentation
Fix a parameter type and a link to the corresponding property.
Tweak the wording and whatnot a little while at it.
2017-09-05 20:20:46 +01:00
Jakub Steiner
90ba317d92 adwaita: use generic sidebar icon style
https://bugzilla.gnome.org/show_bug.cgi?id=786613
2017-09-05 13:53:46 +02:00
Daniel Boles
9699a954cd HighContrast: Stop hovered emoji from disappearing
Otherwise emoji are invisible in the normal variant & nearly in Inverse.

https://bugzilla.gnome.org/show_bug.cgi?id=787279
2017-09-05 01:42:56 +01:00
Daniel Boles
edad5e5c09 Adwaita: Fix a selector not regenerated in the CSS 2017-09-05 01:42:13 +01:00
Daniel Boles
23ea09aa48 HighContrast: Kill abominable headerbar vseparator
Commit 8cd37ff0df fixed a syntax error and
unwittingly released this bizarre mutant.
2017-09-05 01:00:53 +01:00
Daniel Boles
b97f1900b7 EmojiChooser: Ensure always have a selected button
We were only selecting a section’s button if the adjustment y coord was
within its heading, so scrolling slightly into it unchecked all buttons.
This also fixes how we could end up with the first 2 selected, somehow.

https://bugzilla.gnome.org/show_bug.cgi?id=787172
2017-09-04 22:58:24 +01:00
Daniel Boles
002a1d9c1c EmojiChooser: Check the 1st button before 1st show
We scroll to the top in show() but only ever selected a button when the
adjustment changed, which doesn’t happen in init(). Check it manually.

https://bugzilla.gnome.org/show_bug.cgi?id=787172
2017-09-04 22:58:24 +01:00
Matthias Clasen
86c60592fb css: Implement the blur filter
This implementation is somewhat incomplete, since
we don't allow combining blur with the other filters
yet.
2017-09-04 14:28:16 -04:00
Matthias Clasen
5f6fdc4dd8 Render the main overlay child only once
Use a separate snapshot to capture the main child render node
and reuse it multiple times, instead of generating multiple
nodes for the same content.
2017-09-04 14:28:16 -04:00
Matthias Clasen
31349e71d3 Add a blur child property to GtkOverlay
When set, it blurs the content behind the child.
2017-09-04 14:28:16 -04:00
Matthias Clasen
d6be42203b Add gtk_snapshot_push_blur()
This function is similar to the other push functions.
This one uses the newly created blur node.
2017-09-04 14:28:16 -04:00
Matthias Clasen
e2869853dc gsk: Add a blur node
For now, this has just a fallback implementation using
the typical box filter approximation.
2017-09-04 14:28:16 -04:00
Julius Härtl
a1635b6188 gtkplacessidebar: implement libcloudproviders support
Add integration of the libcloudproviders DBus API to the
GtkPlacesSidebar by showing name and sync status of the cloud providers.
The exported menu is rendered as a GtkPopover.

The sidebar will be updated if the list of cloudproviders changes e.g.
by adding or removing an account. If any cloud provider changes detailed
information like sync status only the individual sidebar row gets
updated.

Co-authored-by: Carlos Soriano <csoriano@gnome.org>
Co-authored-by: Daniel Boles <dboles@src.gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-09-04 11:32:03 -04:00
Daniel Boles
9514ef0d03 HighContrast: basic port of emoji CSS from Adwaita
This is better than nothing: without specific CSS, the Chooser was too
large, the emoji were too small, and the buttons were generally ugly.

https://bugzilla.gnome.org/show_bug.cgi?id=786956
2017-09-04 11:03:35 -04:00
Daniel Boles
99b314084b Adwaita: proper colours for inactive emoji buttons
Use opacity to differentiate unselected/hovered/selected buttons. It had
assumed bg < border < fg colours, which may be false, as in Adwaita:dark

This also means we do not need to special-case for the backdrop state.

https://bugzilla.gnome.org/show_bug.cgi?id=786956
2017-09-04 11:03:16 -04:00
Daniel Boles
8a8a643b03 Adwaita: Make use of SASS syntax for emoji stuff
This makes the theme easier to maintain.

https://bugzilla.gnome.org/show_bug.cgi?id=786956
2017-09-04 11:03:02 -04:00
Matthias Clasen
d281cd7498 Fix a compiler warning 2017-09-03 19:53:29 -04:00
Matthias Clasen
59b1206468 Avoid empty nodes another way
Make gsk_text_node_new return NULL if the extents are empty.
2017-09-03 19:35:02 -04:00
Matthias Clasen
7bb202e4a2 Add a workaround for vulkan crashes
I see 'out of memory' errors and crashes inside libvulkan when
creating nodes that have empty bounds and end up in the fallback
paths, like a shadow around an empty text node. Prevent this
by not creating text nodes in that case.
2017-09-03 11:57:21 -04:00
Matthias Clasen
a05895e029 Record node names for debug output
This is useful for GSK_NOTE output as well.
2017-09-03 11:32:09 -04:00
Matthias Clasen
eab50246e1 Only record node names when we should
This is the same thing we do for render nodes elsewhere.
2017-09-03 10:30:32 -04:00
Daniel Boles
68631d6dbd Adwaita: Fix ineffective theming of switch slider
in a specific case, which was applying .slider as a class on the parent
switch, instead of correctly selecting on its child node named slider.

This makes the border on the outside of a switch in a selected listbox
row look better in the light variant. Since the code was never removed,
it was clearly meant to work, and making it work is a clear improvement.
2017-09-03 14:02:23 +01:00
Daniel Boles
8cd37ff0df HighContrast: Fix outdated name for headerbar box 2017-09-03 13:36:43 +01:00
Daniel Boles
48055f99e7 Toolbar: Clarify set_show_arrow() a bit more 2017-09-03 11:04:59 +01:00
Daniel Boles
1b38944203 Toolbar: Clarify how the arrow overflow menu works
The fact it affects the preferred size, and only works with ToolItems
that return a menu proxy item, was unclear unless deduced from other
sources, and this led to users thinking it was broken, for example:

https://stackoverflow.com/q/44644642/2757035

https://bugzilla.gnome.org/show_bug.cgi?id=787158
https://bugzilla.gnome.org/show_bug.cgi?id=787195
2017-09-03 10:59:34 +01:00
Daniel Boles
5095ca6ed7 ToolItem: Add see-also from proxy setter to signal 2017-09-03 10:59:34 +01:00
Daniel Boles
7ed0d9344e ToolItem: Annotate menu proxy item as nullable
It can be NULL. ::create-menu-proxy gave an example of when a NULL proxy
menu item could be useful, but the accessors did not annotate it as such.
2017-09-03 10:59:33 +01:00
Timm Bäder
7481affb82 container: Drop priv pointer 2017-09-03 09:17:35 +02:00
Daniel Boles
18adda6eb0 Adwaita: Fix colour mixing of emoji section button
when hovered, by using %, since SASS does not handle decimal mixes.
2017-09-02 16:02:59 +01:00
Matthias Clasen
d27c552630 emoji chooser: No emoji in the search entry
Recursion is fun, but better avoided in the ui.

https://bugzilla.gnome.org/show_bug.cgi?id=786960
2017-09-02 08:47:17 -04:00
Matthias Clasen
3694104f67 entry: Consider input hints for Emoji support
Don't show "insert emoji" in the context menu if input
hints indicate that Emoji input is not useful.
2017-09-02 08:47:17 -04:00
Matthias Clasen
774499e10e Add input hints for Emoji input
Allow hinting input methods about whether Emoji support is
useful or not.
2017-09-02 08:47:17 -04:00
Emmanuele Bassi
3a0eab776e build: Add option to enable/disable GIR generation
And drop the unnecessary is_cross_build() check: it's entirely possible
to generate introspection data when cross-compiling.
2017-09-02 12:00:57 +01:00
Matthias Clasen
f414e1b15f emoji chooser: Avoid a crash
The emoji chooser gets disposed already, because it is attached
to the toplevel as a popover. Doing it again when the object data
is cleared is leading to a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=787103
2017-09-01 19:55:21 -04:00
Mohammed Sadiq
18adee6e1b emoji-chooser: fix subsequent scroll
Event handlers on scroll window should only be run once the widget
is shown.

https://bugzilla.gnome.org/show_bug.cgi?id=786964
2017-09-01 19:36:59 -04:00
Daniel Boles
7a3548e10c Entry: Set tooltip text on icon for emoji chooser
https://bugzilla.gnome.org/show_bug.cgi?id=786885
2017-09-01 17:28:31 -04:00
Matthias Clasen
7da4d8af2f Use gsk for text shadows
We don't need to render these manually using cairo anymore.
2017-09-01 15:34:13 -04:00
Matthias Clasen
6bdebd1570 label: Don't leak clip regions
This was introduced in the conversion to gsk.
2017-09-01 15:34:13 -04:00
Daniel Boles
e6bbc10bd5 ComboBox: Dodge possible surplus disconnects
in case anyone connected any other signal on the model to this ComboBox.
2017-09-01 20:20:17 +01:00
Matthias Clasen
8de8525b44 entry: Convert to gsk
This introduces a new css node for block cursor styling.
2017-09-01 14:42:29 -04:00
Matthias Clasen
1440bb25de Fix text colors
This was lost in some reshuffling of the gskpango branch.
2017-09-01 14:12:20 -04:00
Matthias Clasen
f199f7b87b Fix the build 2017-09-01 13:42:43 -04:00
Matthias Clasen
a367d34949 Use a text render node in GskPangoRenderer
This pushes the rendering closer to the place where we can
insert a texture atlas for glyph caching.
2017-09-01 13:30:03 -04:00
Matthias Clasen
4975aa7920 Add a render node for text
This is just a wrapper around a PangoGlyphString + PangoFont.
Basically, the arguments that are passed to pango_renderer_draw_glyphs.
2017-09-01 13:30:03 -04:00
Matthias Clasen
82538f935b Use GskPangoRenderer to render text
This just replaces the wrapper call.
2017-09-01 13:30:03 -04:00
Matthias Clasen
82e8f3a542 Add a Pango renderer
Copy the PangoCairoRenderer into GTK+, rename it to GskPangoRenderer,
and strip it down far enough to build without private pango apis.
This means we currently don't support hexboxes or shapes.

Currently, this lives in gtk, but it might be nicer to put it
in gsk eventually.
2017-09-01 13:30:03 -04:00
Timm Bäder
3fc1cafec0 centerbox: Unparent widgets in dispose 2017-09-01 19:05:30 +02:00
Timm Bäder
2cd9f43d2f menuitem: Fix small memory leak in get_label
g_object_get returs a newly allocated string so we can't use it here.
2017-09-01 19:05:30 +02:00
Matthias Clasen
745a9426b0 Remove an unused variable 2017-09-01 12:56:22 -04:00
Matthias Clasen
10ddd3112a label: Port active link drawing to gsk
We don't need to fall back to cairo fro this anymore.
2017-09-01 12:29:11 -04:00
Matthias Clasen
75115b122b inspector: Add some tooltips
These buttons are not 100% obvious.
2017-09-01 12:04:40 -04:00
Matthias Clasen
c17f76cd54 inspector: Remove debug nodes setting from visual tab
No need to have the same setting in two places.
2017-09-01 12:04:33 -04:00
Matthias Clasen
04f1e19e00 inspector: Move debug nodes option
Put this option on the recorder page where it makes more sense.
2017-09-01 12:04:27 -04:00
Matthias Clasen
47f717d4ae label: Port selection drawing to gsk
We don't need to fall back to cairo for this anymore.
2017-09-01 12:04:20 -04:00
Daniel Boles
021e0d5e3d ScrolledWindow: Dodge possible surplus disconnects
In case the outgoing Adjustment for whatever reason has other handlers
referring to this SW, be sure to avoid disconnecting any but our own.
2017-09-01 16:28:57 +01:00
Daniel Boles
9a6adcbce4 ComboBox: Remove pointless signal ID member fields
We don’t need to store these for disconnection, as we can just use
g_signal_handlers_disconnect_by_data().
2017-09-01 16:28:56 +01:00
Daniel Boles
ceb09e4c8d ScrolledWindow: Fix non-disconnection of handlers
• Use disconnect_by_data() to catch both _adjustment_changed() and now
  _adjustment_value_changed(), as the latter had been missed until now.

• Also disconnect from indicator_value_changed(), which was not done in
  destroy() due to indicator_reset() and remove_indicator() disagreeing.

https://bugzilla.gnome.org/show_bug.cgi?id=775074
2017-08-31 23:18:46 +01:00
Daniel Boles
6984d0847b Window: Do not connect to NULL screen in init()
Do not connect to get_settings_for_screen() if we have no screen…

Use g_signal_connect(), not connect_object(), to match how set_screen()
makes this same connection, and how finalize() already disconnects it.

https://bugzilla.gnome.org/show_bug.cgi?id=705640
2017-08-31 20:26:44 +01:00
Daniel Boles
6609173779 FileChooserWidget: Remove an unused #include 2017-08-31 19:59:25 +01:00
Matthias Clasen
767bf1b3fd Avoid computing the same thing twice
Trivial cleanup.
2017-08-30 23:30:10 -04:00
Daniel Boles
552998868d Entry: Rename int helper to gtk_entry_clear_icon()
It was called gtk_entry_clear(), which was unnecessarily vague.
2017-08-30 21:16:00 +01:00
Daniel Boles
6e414d42d7 Entry: Fix Shift-click → extend/truncate selection
Since the move from button-press to gesture events, Shift-clicking did
not work to start a selection (from none) or truncate an existing one.

This was due to the code being copy-pasted around and some logic being
broken in the process. This makes both of those work as they should, by
shuffling it again so the end result is the same as before. Highlights:

(1) ::button-press if extending due to a single press would call
set_positions(tmp_pos, tmp_pos), which is what made the Shift+click to
create a selection work. That was lost. Add it back to make that work.

(2) ::button-press in the “Truncate current selection” branch would not
execute all the stuff around “extend_to_left”, as that was the else
case. So, set extend_selection = FALSE so we skip over that later on.

(3) BUT! This Truncate case never fired because it was in the else
branch of if (in_selection())! Of course, it must be in the true branch.

(4) The IM context was not reset if the Shift-click occurred within an
existing selection, only if it did not. In ::button-press this was the
first thing done if extending a selection, regardless. Make it so again.

https://bugzilla.gnome.org/show_bug.cgi?id=780750
2017-08-30 18:26:04 +01:00
Matthias Clasen
d2087f1943 Avoid empty space in the emoji chooser
We need to hide the empty flow boxes as well, to avoid
spacing between them.

https://bugzilla.gnome.org/show_bug.cgi?id=786966
2017-08-30 08:36:56 -04:00
Nelson Benítez León
c3c10edd09 textview: fix bug on DnD displaced limits of selection
The fix of commit f2fd655754
should be confined to DnD coords only, because otherwise
it causes the start and end of the selection to be displaced.

https://bugzilla.gnome.org/show_bug.cgi?id=785736
2017-08-29 19:26:07 +01:00
Debarshi Ray
fd9aec27fc GtkBuilder: Prefer "type-func" over "class" when looking for the GType
https://bugzilla.gnome.org/show_bug.cgi?id=786932
2017-08-29 15:41:01 +02:00
Daniel Boles
87c67e6ed3 LevelBar: Really fix underallocation of blocks
Themes should not enforce min sizes on blocks in continuous mode; in
this case, the filled block should be as large as it needs to be to
reflect the current value, and no larger or smaller than that. So, the
fact that the minimal size was selected on just levelbar block is wrong:
we should also require the levelbar.discrete class to apply min sizes.

The widget should enforce whatever correct minimum size results from the
above fix, by reapplying commit 78b4885fe8

Except: we should not allocate/draw the filled block if the value is 0,
as in this case, the LevelBar should be empty, not have a min-size fill.

This partially reverts commit 96062ffeae,
as it makes sense to set min sizes for discrete blocks, so keep that in.

https://bugzilla.gnome.org/show_bug.cgi?id=783649
2017-08-29 00:34:02 +01:00
Javier Jardón
bc3968d2ff gtk/gtkshow: Remove deprected gtk_show_uri() 2017-08-28 23:47:36 +01:00
Javier Jardón
d3954f614c Use gtk_show_uri_on_window() instead gtk_show_uri() 2017-08-28 23:47:36 +01:00
Daniel Boles
896f7c8ac0 Entry: Handle :show-emoji-icon becoming false
Disconnect the now-unwanted signal handler, and hide the icon.

https://bugzilla.gnome.org/show_bug.cgi?id=786940
2017-08-28 20:52:06 +01:00
Daniel Boles
cb219473ee Entry: Drop redundant typecasts
https://bugzilla.gnome.org/show_bug.cgi?id=786940
2017-08-28 20:52:06 +01:00
Daniel Boles
477fc95655 Entry: Only open emoji picker on 2ndary icon click
We hijack the secondary icon for the emoji picker, but the handler for
::icon-press did not check the pressed icon and opened it for either.

https://bugzilla.gnome.org/show_bug.cgi?id=786938
2017-08-28 20:52:01 +01:00