Commit Graph

27870 Commits

Author SHA1 Message Date
Adrien Plazas
43c458f45f 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-07 15:27:22 +02:00
Adrien Plazas
f0696dfae0 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-07 13:07:46 +02:00
Adrien Plazas
f9ba306116 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.

This is convenient when building a custom sidebar using a GtkSeparator
and to extend a sidebar to the title bar.
2018-09-07 12:42:26 +02:00
Matthias Clasen
47122288b8 Fix portal path handling
This was broken when I recently introduced this helper
function.
2018-09-05 19:58:03 -04:00
Jan Alexander Steffens (heftig)
3c7d5e749c
GtkApplication: Fix CRITICAL on shutdown when register_session=FALSE 2018-09-05 21:46:28 +02:00
Alex Monday
e33b93a97e themes: Fix linked elements in error state
Add instructions for color of linked elements border which ajoints
entry, when parent linked entry is in error state.
2018-09-02 14:43:13 +05:00
Matthias Clasen
813c7b19ea GtkApplication: track screensaver state
A number of applications want to track the state of the screensaver.
Make this information available as a boolean property. We only listen
for state changes when ::register-session is set to TRUE.

This is implemented for unsandboxed D-Bus access by talking
directly to org.gnome.ScreenSaver or org.freedesktop.ScreenSaver,
and for sandboxed D-Bus by using a (new) portal API.
A Quartz implementation is missing.
2018-08-30 23:17:37 -04:00
Matthias Clasen
3fc319ff1b GtkApplication: Respect GTK_USE_PORTAL
When the environment variable is set, don't connect
to the session manager, but instead rely on the
inhibit portal.
2018-08-30 23:17:37 -04:00
Matthias Clasen
f734c3d3b0 file chooser portal: use request path utilities
Less code duplication, more sticky toffee!
2018-08-30 23:10:13 -04:00
Matthias Clasen
c3077467d0 print portal: use request path utilities
Less code duplication, more cookies!
2018-08-30 23:10:13 -04:00
Matthias Clasen
e2d066a2ec color picker portal: Add request path utility
Less code duplication, more cake!
2018-08-30 23:10:13 -04:00
Matthias Clasen
6829719d6d Add utility functions for portal paths
The paths that we create for requests and sessions
need some icky code to create. Keep it in one place.
2018-08-30 23:10:13 -04:00
Kai Willadsen
5111f7af99 FileChooserWidget: Don't show recent items with private hint set 2018-08-28 20:14:16 +00:00
Matthias Clasen
aa69b3af5a Merge branch 'gtk-3-24.win.updated' into 'gtk-3-24'
Fix pre-C99 builds of the gtk-3-24 branch

See merge request GNOME/gtk!310
2018-08-28 20:10:04 +00:00
Matthias Clasen
2307f8ec67 Merge branch 'fix-warning-combobox-destroy' into 'gtk-3-24'
Fix warning on GtkComboBox destroy

See merge request GNOME/gtk!311
2018-08-28 19:27:24 +00:00
Luca Bacci
aa5d926c84 Check for NULL priv->popup_window in gtk_combo_box_popdown()
Fixes issue #125
2018-08-28 18:39:05 +02:00
Matthias Clasen
61921eba57 Fix a typo
Its Hieroglyphs!

Closes: #1292
2018-08-28 12:26:49 -04:00
Chun-wei Fan
6cf7297653 gtk/gtkeventcontrollerscroll.c: Include fallback-c89.c
... instead of just math.h, as it uses the C99 function trunc().  This
is so that the code builds on pre-C99 compilers.
2018-08-28 17:43:11 +08:00
Chun-wei Fan
723e50990f gtk/fallback-c89.c: Add C89 fallback for trunc()
Check for trunc() during configure and provide a fallback implementation
for it if it is not found.
2018-08-28 17:43:04 +08:00
Matthias Clasen
ac654740f3 Deprecate GtkRange::upper/lower-stepper-sensitivity
These properties have been removed in GTK+ 4.
Deprecate them here.
2018-08-26 18:58:59 -04:00
Benjamin Otte
da8994f941 Don't deprecate gtk_widget_show_all()
After discussions on IRC, the conclusion was reached that deprecations
only make sense if an action can be taken to not use the deprecated code
that makes the code more current and simplifies a later port to a newer
GTK version.

In this particular case, the suitable action would be adding
gtk_widget_show() calls whenever a widget is created, so that a call to
show_all() is not necessary.
However, in GTK4 these calls would not be necessary and end up just
bloating the codebase unnecessarily.

So it was decided the better solution would be to not deprecate the API
and instead leave this work to be done during potential GTK4 ports of
applications.

This reverts commit 4d71d2303d.

Fixes !1282
2018-08-22 19:48:20 +02:00
Rico Tzschichholz
2306c82df7 gesturestylus: Add missing array g-i annotation for *_get_axes params 2018-08-20 17:01:59 +02:00
Iain Lane
dce33fa830 colorpickershell: Unpack the tuple returned from PickColor()
When calling PickColor on org.gnome.Shell, we get back an "a{sv}", which
GDBus provides to us as "(a{sv})".

At the minute we're not unpacking this tuple, and so picking fails with
messages like:

  GLib-CRITICAL **: 13:38:19.439: g_variant_lookup_value: assertion 'g_variant_is_of_type (dictionary, G_VARIANT_TYPE ("a{s*}")) || g_variant_is_of_type (dictionary, G_VARIANT_TYPE ("a{o*}"))' failed

  Gtk-WARNING **: 13:38:19.439: Picking color failed: No color received

Let's unpack it.
2018-08-17 09:10:59 -04:00
Matthias Clasen
c9f875bd77 Merge branch 'fix-shifted-scrolling-gtk3' into 'gtk-3-24'
gtkscrolledwindow: Consider shift key presses when decelerating [gtk3]

See merge request GNOME/gtk!287
2018-08-15 22:02:45 +00:00
Jonas Ådahl
14d22cb323 tooltip: Implement positioning using gdk_window_move_to_rect()
In order to make tooltip positioning portable, make use of the
move_to_rect API. Some semantical changes are made, as identical
semantics cannot be implemented using the move-to-rect API.

Primarily the implemented semantics are:

Position the tooltip in the center pixels slightly below (defaults to 4
units below) the tooltipped widget. This is always the case for keyboard
driven tooltips; the case where it tries to avoid the pointer cursor is
not implemented.

For pointer position triggered tooltips, implement the following
additional semantics:

Use the current cursor size to determine the padding used to enlarge the
anchor rectangle. This is to try to avoid the cursor overlapping the
tooltip.

If the anchor rectangle is too tall (meaning if we'd be constrained
and flip on the Y axis, it'd flip too far away from the originally
intended position), rely only on the pointer position to position the
tooltip. The approximate pointer cursor rectangle is used as a anchor
rectangle. Ideally we should use the actual pointer cursor rectangle
(image used as well as hotspot coordinate), but we don't have API to
get that information.

If the anchor rectangle isn't to tall, just make sure the tooltip isn't
too far away from the pointer position on the X axis.

Closes: #134
Closes: #432
Closes: #574
Closes: #579
Closes: #878
2018-08-10 18:32:54 +02:00
Matthias Clasen
2dde4e2ff8 Merge branch 'gtk-3-24-improve-error-message' into 'gtk-3-24'
gtkplacessidebar: Improve error message when unlocking volume fails

See merge request GNOME/gtk!266
2018-08-08 09:18:32 +00:00
Matthias Clasen
6b6e53fd23 Make color picker circular
The need for center alignment was pointed out by Timm Baeder.
2018-08-05 01:50:01 +00:00
Matthias Clasen
926f25aaec color picker: Also try kwin
use a kwin color picker when we run under kwin.
2018-08-05 01:48:29 +00:00
Matthias Clasen
7e74beec5b Only use the portal color picker when appropriate
This is just moving this check around.
2018-08-05 01:47:35 +00:00
Matthias Clasen
fc44f9755a Add a kwin color picker
This uses the org.kde.kwin.ColorPicker interface.
2018-08-05 01:47:04 +00:00
Sebastian Keller
5c6596ad99 gtkscrolledwindow: Consider shift key presses when decelerating
Otherwise horizontal scrolling using the shift key would decelerate
vertically.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/770
2018-08-04 16:36:47 +02:00
Benjamin Otte
6e4da8fbdb container: Deprecate focus chains 2018-07-31 22:46:15 +02:00
Matthias Clasen
4d71d2303d Deprecate show_all apis
These functions are gone in GTK+ 4, so deprecate them here.
2018-07-31 13:32:55 -04:00
Andrea Azzarone
06800b22ff window: Fallback to CSD titlebar in focus-chain
CSD titlebar are included in the focus-chain. The logic used makes sure that the
initial focus avoids the titlebar, but tabbing around will eventually get there.
This logic fails in case the window has no other focusable widgets apart from
the ones in the header-bar. If this happens keynav focus will be lost. To handle
the above scenario, we need to fallback to focus the header-bar (if any).

Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/404
2018-07-31 02:37:12 +00:00
Matthias Clasen
9bae0758eb color picker: Better debug spew
This will help in debugging issues.
2018-07-30 18:10:27 -04:00
Matthias Clasen
7f290426dc Add a color picker implementation for gnome-shell
This adds a GtkColorPicker implementation that talks
to gnome-shell to get a color.
2018-07-30 18:10:17 -04:00
Matthias Clasen
740fc3eeff Add a color picker implementation for portals
This adds a GtkColorPicker implementation that talks
to the screnshot portal to get a color.
2018-07-30 18:10:17 -04:00
Matthias Clasen
6b3272e4b0 color editor: Add a color picker button
The button is shown if we have a GtkColorPicker implementation.
Currently, there are none, so the button is never shown.
2018-07-30 18:10:17 -04:00
Matthias Clasen
543fb6d7b6 Add a color picker interface
This will be used in the color chooser, in subsequent commits.
2018-07-30 17:33:52 -04:00
Matthias Clasen
77b4c4432e Merge branch 'wl_text_input_clean' into 'gtk-3-24'
Replace gtk_text_input with text_input_unstable_v3 support

See merge request GNOME/gtk!272
2018-07-30 19:31:37 +00:00
Dorota Czaplejewicz
8d77256d53 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-07-30 20:27:22 +02:00
Matthias Clasen
7fa5c361be Include Emoji category icons as resources too
These icons are very new in the Adwaita icon theme, so we can't
rely on them being widely available, and will just include them
for now.
2018-07-29 09:02:23 -04:00
Matthias Clasen
ff24c82dd4 Emoji chooser: Use icons for sections
This is more reliable than using text-style Emoji
which may not be present.

Based on work by Julian Sparber.
2018-07-29 09:02:07 -04:00
Benjamin Otte
e0807fcf54 gtk; Deprecate gtk_render_frame_gap()
Use gtk_render_frame() instead.
2018-07-24 20:32:26 +02:00
segfault
138c196e53 gtkplacessidebar: Improve error message when unlocking volume fails 2018-07-23 23:38:06 +02:00
segfault
0e7228b267 gtkplacessidebar: Show busy spinner in sidebar row during mount ops 2018-07-22 17:04:05 +02:00
Carlos Garnacho
eb3fd5e941 gtksettings: Remove leftover code
The immodule variable is unused
2018-07-21 14:55:01 +02:00
Alberts Muktupāvels
cb39169ba7 gtkcssprovider: deprecate gtk_css_provider_get_default
This function is unused since cdc6e82720 commit and does not
contain fallback style.

https://gitlab.gnome.org/GNOME/gtk/issues/1226
2018-07-20 14:55:27 +03:00
Timm Bäder
2c3a7c63ef Merge branch '628-text-view-width' into 'gtk-3-24'
Resolve #628: "TextView: spaces acting as non-breaking whitespace if :left- or :right-margin is set"

See merge request GNOME/gtk!236
2018-07-20 06:24:14 +00:00
Matthias Clasen
078870f604 Emoji chooser: Also check for hex boxes
We don't want to see those either.
2018-07-19 20:51:22 -04:00
Matthias Clasen
c52d9cfc14 moji chooser: Try harder to avoid fallback
We don't want to see any fallback rendering.
The current check was still letting some fallback
combinations through.

Based on work by Julian Sparber.
2018-07-19 20:51:07 -04:00
Timm Bäder
56033a8d27 gesturestylus: Clarify a documentation comment
Use the proper gtkdoc syntax for signals.
2018-07-18 23:05:06 +01:00
Matthias Clasen
affb4ff5f4 Fix up version annotations
The new api here was introduced in 3.24.
2018-07-18 07:18:21 -04:00
Carlos Garnacho
9ee60777e7 sm scroll 2018-07-16 15:44:35 +02:00
Carlos Garnacho
a8463953a4 gtk: Add GtkGestureStylus
This is a GtkGesture done to deal with stylus events from drawing tablets.
Those have a special number of characteristics that extend a regular
pointer, so it makes sense to wrap that.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
7793aab5f0 gtkeventcontrollerkey: Add ::focus-in/out signals
And handle GDK_FOCUS_CHANGE events in order to emit those.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
ecf9fa65b8 gtkeventcontrollerkey: Add get_group() call
Callers can use this function on a key-pressed/released signal
to find out the key event group, useful in a few places.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
a32933b056 eventcontrollerkey: Add function to forward stuff elsewhere 2018-07-16 15:43:43 +02:00
Carlos Garnacho
e0f3e8a7e5 gtk: Add GtkEventControllerKey
This event controller is meant to replace usage from key-press/release-event
handlers all through. Optionally it can be set a GtkIMContext, so interaction
is carried by the controller.
2018-07-16 15:43:43 +02:00
Matthias Clasen
1f9de707f7 Add x/y to GtkEventControllerMotion::enter
We have this information available in enter events,
and having it in the controller signal as well makes
porting easier.

Update existing users.
2018-07-16 15:43:43 +02:00
Matthias Clasen
8b2c3a8c1a Add a simple motion eventcontroller
This can serve as a replacement for the legacy
event signals for enter/leave/motion notify.
2018-07-16 15:43:43 +02:00
Matthias Clasen
e7af3410cf Avoid excess notification for GdkEventControllerScroll::flags
We have a test that checks this, and it is the right thing to do.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
84d3bfb6fd gtk: Remove CONSTRUCT_ONLY flag from GtkEventControllerScroll::flags
There is a gtk_event_controller_scroll_set_flags() call that's meant
to be called after construction (eg. due to scrolledwindow relayouts
hiding/showing scrollbars). The property shouldn't be construct-only
for consistence.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
448551f31c gtkeventcontrollerscroll: Add some docs 2018-07-16 15:43:43 +02:00
Timm Bäder
7b8c036f8f eventcontrollerscroll: Emit ::scroll for -1/+1 discrete steps
The > 1 meant it only emits the signal for -2/+2 steps.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
747be0f499 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.
2018-07-16 15:43:43 +02:00
Benjamin Otte
9008f7702d window: Update opaque region if background-color changes
The opaque region is only set when the background color is opaque. So
we need to do something about it when the background color changes.

However, in the case where a size allocation is going to happen, we
already do this update in size_allocate(), so in that case avoid doing
it twice.
2018-07-13 15:02:47 +02:00
Jakub Steiner
8373b906d4 Merge branch 'expander-size-3' into 'gtk-3-24'
HighContrast: Restore expander size

See merge request GNOME/gtk!210
2018-07-09 15:27:51 +00:00
Peter Bloomfield
4b4ae4464c text-view: Do not double-allocate borders
Reverts part of Commit 25b67af3

The 'width' part of the commit is the cause of #628: requisition->width
is first set to priv->layout->width, which already includes
priv->left_border + priv->right_border. It's a bit labyrinthine, but
essentially:

*  layout->width is set in update_layout_size() (gtktextlayout.c line 992)
   as the maximum line width, and
*  the line width is set to display->width in gtk_text_layout_real_wrap()
   (gtktextlayout.c line 1183), and
*  display->width is set to text_pixel_width + h_margin + h_padding in
   gtk_text_layout_get_line_display() (gtktextlayout.c line 2584), and
*  h_margin + h_padding is the same as priv->left_border +
   priv->right_border.

Adding it again leads to an increase in the size-request, which
results in wider lines; rinse and repeat.
2018-07-08 17:24:07 -04:00
Samuel Thibault
660087db42 HighContrast: Restore expander size
Expanders used to be 16px high. With the move from the gtk2 rendering
to gtk3 rendering they shrunk to 12px, making them hard to see, because
it's now the icon which is 16px high and the icon contains transparent
borders.

This makes the HighContrast theme use 24px icons instead, to restore
16px expanders. This may expander some containers a bit.

Closes #1046
2018-07-03 19:27:15 +02:00
Jonas Ådahl
927004178f Merge branch 'fix_wayland_csd_announce' into 'gtk-3-24'
Fix gdk_wayland_window_announce_csd

See merge request GNOME/gtk!221
2018-07-03 10:14:57 +00:00
Daniel Boles
1b8de2d5fa Adwaita: Drop some unneeded overrides
The pseudoclasses work fine on the subnodes without having to also apply
`parent:class subnode`.
2018-07-02 21:45:06 +01:00
Daniel Boles
483d25f418 ModelButton: Add Since annotation on new prop 2018-07-02 20:31:45 +01:00
Daniel Boles
1d30ada735 ScrolledWindow: a couple of spelling/grammar fixes
(A) Put a space in "scrolled window" like the other doc comments
(B) Say "i.e." rather than "ie."
(C) Fix grammar from "makes [...] exactly reaches" to "exactly reach"
2018-07-02 20:11:12 +01:00
Daniel Boles
8a00551871 ScrolledWindow: Fix/improve doc of key bindings
Saying 'key + modifiers' is really weird, so reverse that, and explain
why there are 2 cited and what the difference between them is.
2018-07-02 20:09:37 +01:00
Daniel Boles
0ed3a77d29 ScrolledWindow: Add missing apostrophes 2018-07-02 20:07:23 +01:00
Matthias Clasen
174c4fa7ee Merge branch 'wip/aplazas/modelbutton-markup' into 'gtk-3-24'
ModelButton: Add 'use-markup' property

See merge request GNOME/gtk!219
2018-07-02 17:16:59 +00:00
Daniel Boles
08adcb6318 PlacesSidebar: Fix warning about signal parameters
@open_flags was not documented, and so:

jhbuild/checkout/gnome/gtk+-3/gtk/gtkplacessidebar.c:4743: Warning: Gtk:
incorrect number of parameters in comment block, parameter annotations
will be ignored.
2018-07-01 16:08:06 +01:00
Adrien Plazas
504eb89155 ModelButton: Add 'use-markup' property
Binds this property to the button's label, allowing a model button to
have text with markup.

This will be convenient for buttons like 'Online Accounts <sup>↗</sup>'.
2018-06-29 23:02:21 +02:00
Daniel Boles
b75b5e900a themes: Remove Raleigh
It has been extremely broken since the move to CSS gadgets/nodes, so
clearly no one is depending on it; nor does anyone seem to want to
resurrect it, and writing a Raleigh-inspired theme from scratch would be
faster if they did. So let's drop the dead weight from the build and lib

Now that we don't have Raleigh, the defaultvalue test has to be changed
to set Adwaita before checking the default values of style properties -
some of which Adwaita overrides in its CSS, meaning those would fail.
Not that it passed before anyway! But it does now after my other commit.

Note that I leave the last reference in gtk-zip.sh.in alone since that
hasn't been touched in 8 years and probably has plenty other problems...

Close https://gitlab.gnome.org/GNOME/gtk/issues/1187
2018-06-29 20:12:19 +01:00
David Edmundson
32ae97f13a wayland: Explicitly request mode for both CSD and SSD modes
According to the spec compositors were to assume surfaces are CSD until
told otherwise. This means we need to send
org_kde_kwin_server_decoration_request_mode in both cases.

This fixes libreoffice under kwin, which would remove it's own headers
as per the manager's request but not inform kwin leaving it in the even
more broken state of having none.
2018-06-28 18:50:50 +01:00
Chun-wei Fan
eebf151f2a gtk/: Fix build without PangoFT2 and HarfBuzz
On Windows HarfBuzz and PangoFT2 are optional, so we need to ensure that
we only build the bits that require HarfBuzz and PangoFT2 when needed.
We may need to see later whether we can get the needed functionality in
gtkfontchooserwidget.c with the Windows APIs without the need of
HarfBuzz nor PangoFT2 (and starting programs on Windows using FontConfig
is very slow).
2018-06-26 16:40:18 +08:00
Chun-wei Fan
e8d3899461 gtk/Makefile.am: Dist the newly-added private headers
We need to dist language-names.h and script-names.h so that we won't
be missing headers in a dist tarball.
2018-06-26 16:40:11 +08:00
Benjamin Otte
e7bb83988f progressbar: Never stop never stopping
Reinstate code that was accidentally deleted during the port to
GtkProgressTracker in commit d57ebe2de7.

Without that code, pulsing the progressbar will stop doing anything
after 3 iterations.
2018-06-26 04:14:25 +02:00
Matthias Clasen
b9b62fca0c Don't forget to dist open-type-layout.h
This is a private header, but it still needs to end up in the tarball.
2018-06-25 18:51:45 -04:00
Timm Bäder
69adcc46c9 Merge branch 'wip/chergert/no-compressed-ui' into 'gtk-3-24'
build: use xml-stripblanks with .ui resources

See merge request GNOME/gtk!216
2018-06-24 06:26:13 +00:00
Jehan
593edacb48 gtk: also recolor circle and ellipse in symbolic SVG icons. 2018-06-23 16:14:01 -04:00
Christian Hergert
f05865ad3a build: use xml-stripblanks with .ui resources
This adds a preprocess step to the .ui files to strip them of blank
characters. It also removes the compressed='true' from the .ui files since
that involves creating lots of decompressor objects when creating widgets.
Doing so has runtime overhead and slows down the creation of initial
application windows.

The .ui files are left compressed for the Inspector, since that is not in
the core performance path of application startup.
2018-06-23 12:42:25 -07:00
Daniel Boles
9156908a3a EmojiCompletion: Avoid un/signed compare warnings
(A) Use gsize to match the result of g_variant_n_children
(B) Use guint for n_matches, like the struct (and all other n_matches)
2018-06-20 20:36:19 +01:00
Daniel Boles
934b40f4f3 EmojiCompletion: Use Box:spacing instead of CSS
master uses CSS border-spacing, but that is not available in GTK+ 3.

Close https://gitlab.gnome.org/GNOME/gtk/issues/1166
2018-06-20 20:33:45 +01:00
Daniel Boles
7dbd3da2dd Adwaita: Don't use a property that GTK+ 3 lacks
border-spacing was not backported (yet?). If it won't be, then a
suitable replacement is needed. Until then, avoid the runtime error that
can result from using a nonexistent property in our theme.

https://gitlab.gnome.org/GNOME/gtk/issues/1166
2018-06-20 20:24:19 +01:00
Daniel Boles
848a524d95 Adwaita: Regenerate CSS for emoji completion popup
Commit 65bb238a3f forgot this bit.
2018-06-20 19:37:45 +01:00
Daniel Boles
7f91af2516 HC: Avoid excessive selectors from prev commit
The new rule does not need to affect all those other pseudoclasses. I
just put it in the wrong scope.
2018-06-20 19:26:29 +01:00
Daniel Boles
b1997c96ea InfoBar: Fix wrong type in copy-pasted param doc
https://gitlab.gnome.org/GNOME/gtk/issues/1165
2018-06-20 19:15:21 +01:00
Daniel Boles
4c61ff2a3a HC: Avoid same BG/FG colors in flat treeview entry
Selected rows in tree views in HighContrast have a background colour the
same or nearly as the normal text colour, so we cannot let entries in
such rows have transparent backgrounds, or the text inside the entry
becomes nearly or totally impossible to see.

Dodge this by giving entry.flat inside treeview and with :focus the
$base_color, which is different from the text & so lets that be seen.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/125
2018-06-20 19:15:21 +01:00
Daniel Boles
3ebcc5a7d5 searchenginetracker: Don't leak the hits' GFiles 2018-06-20 10:04:13 +01:00
Daniel Boles
004b24a818 a11y/entry: Fix copy-pasteo re 2ndary icon tooltip
The else case was wrongly resetting the accessible description on the
primary icon, which might not exist and can therefore cause a crash.

https://gitlab.gnome.org/GNOME/gtk/issues/1160
2018-06-19 18:38:49 +01:00
Chun-wei Fan
defbbb95e9 gtk/gtkemojicompletion.c: Fix build on C89 and non-GCC
Declare variables at the top of the clock, and ensure that we don't try
to use g_autoptr(), which is a GCCism.
2018-06-19 18:30:22 +08:00
Chun-wei Fan
aa76abbbeb gtk/language-names.c: Fix build on non-GCC/CLang
Remove g_auto*() usage from these sources and use the traditional
g_free(), as g_auto*() are GCCisms (or CLangisms).

Also, don't include unistd.h unconditionally and stop including
langinfo.h and dirent.h, since they seem to be unused.

Partially cherry-picked from a4c0395343

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2018-06-19 18:23:22 +08:00
Mohammed Sadiq
61f37b2b0d search-bar: Fix link to search-bar example
The master branch is now Gtk4. We should be linking to
stable branch here.
2018-06-16 10:35:55 +05:30
Michael Natterer
c0ba041c73 gtk: fix wheel scrolling for very small adjustment page_size
For very small page sizes of < 1.0, the effect of pow() is the
opposite of what's intended and the scroll steps become unusably
large, make sure we never get a scroll_unit larger than page_size /
2.0, which used to be the default before the pow() magic was
introduced.
2018-06-12 18:53:12 +02:00
Matthias Clasen
81878617c7 Merge branch 'gtk-3-24' into 'gtk-3-24'
Fix reference to user styles in gtkstyleprovider.h

See merge request GNOME/gtk!183
2018-06-07 18:30:48 +00:00
Mohammed Sadiq
5591076361 font-button: Suggest non deprecated function in docs
gtk_font_button_get_font_name() has been deprecated in 3.22 and
its public API is removed from GTK4.
2018-06-07 15:49:28 +05:30
Matijs van Zuijlen
37ec227dc1 Fix reference to user styles in gtkstyleprovider.h 2018-06-07 08:49:59 +00:00
Daniel Boles
daecee75b4 CssGadget: Round px values up for min-width|height
Otherwise, requesting a min size in em where the equivalent in px had a
fractional part would lead to the gadget getting allocated 1 too few px.
You could see this in the CSS property vs. allocation in the Inspector.

Note that margin/border/padding are left alone: the rationale is that we
do as browsers do, and Benjamin said we already do that for those,
whereas his tests on min-(width|height) showed otherwise.  My subsequent
analysis indicated it to be far less clear-cut than that, but he remains
unconvinced that we should ceil() all the things! So just do these ones.

https://gitlab.gnome.org/GNOME/gtk/issues/1088
2018-06-05 18:42:45 +01:00
Matthias Clasen
f6a0dfeb4d Add new fontchooser api to the docs
We have docs.
2018-06-05 13:06:08 -04:00
Jonas Ådahl
9b3c745fc4 gdk: Make gdk_window_move_to_rect public
This is the API used by GtkMenu to properly position menus on the screen
without requiring GTK to query the menu window's position or the work
area of where the window is positioned. It makes it possible to position
popup windows properly when using Wayland.

Make this API available to external users so custom popup windows can be
positioned properly as well.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/997
2018-06-05 15:01:52 +02:00
Matthias Clasen
51aa16346e Miscellaneous font chooser fixes
Fix various oversights in the backports of the
font chooser features.
2018-06-04 18:58:08 -04:00
Matthias Clasen
dfe04d0c9a font chooser: Make the language property writable
This is meant as an input to the font chooser.
We don't want the user to select a language, but
rather have fonts presented as they would work for
the current language. Therefore, do away with the
lang/script combo on the tweak page.
2018-06-04 18:58:08 -04:00
Matthias Clasen
71acf23697 font chooser: Add examples for font features
For some font features, we can figure out affected
glyphs, and show before/after. For some others, we
hardcode typical sequences.

Still to do: figure out how to find ligatures and
show them.
2018-06-04 18:58:08 -04:00
Christian Stadelmann
d4feb8929e
GtkWindow: Handle non-square icons with height > width correctly 2018-06-03 21:05:46 +02:00
Matthias Clasen
7951f0e9a9 menu: Remove unstable annotations
These apis are not going to change in GTK+ 3.x.
2018-06-03 09:48:40 -04:00
Matthias Clasen
1f37cbfbfd Drop Ctrl-Shift-e support
Now that we have Emoji completion, drop the rather limited
Ctrl-Shift-e support in GtkIMContextSimple, and leave this
sequence to input methods.
2018-06-03 09:43:28 -04:00
Matthias Clasen
09e3529d0e entry: Add emoji completion
Pop up completions when the text in the entry matches :word:
This functionality has to be enabled using the enable-emoji-completion
property.
2018-06-03 09:43:28 -04:00
Matthias Clasen
65bb238a3f Add an emoji completion popup
This widget provides entry completion-like functionality
for Emoji codes like 😁 or 💋.
2018-06-03 09:43:28 -04:00
Matthias Clasen
7e9ae85dd4 Export some entry functions privately
This will be used in the following commits.
2018-06-03 09:43:28 -04:00
Matthias Clasen
d0f7364260 emoji: Hide recent section when empty
This is part of https://gitlab.gnome.org/GNOME/gtk/merge_requests/143
by Julian Sperber.
2018-06-03 09:43:28 -04:00
Matthias Clasen
a628e03042 emoji: Improve section scrolling
Leave some space above the section heading when scrolling.

This is a part of https://gitlab.gnome.org/GNOME/gtk/merge_requests/143
by Julian Sperber.
2018-06-03 09:43:28 -04:00
Christian Hergert
d6a29e1b8c treeview: respect expander-size style property
Without enforcement to the expander-size, we can end up rendering icons
rather fuzzy. This uses the expander-size style property to determine
the square for the icon, centered on what was the calculated space for
the expander.
2018-06-01 11:04:45 -04:00
Mohammed Sadiq
1918fefbd4 widget: Fix example code in doc 2018-05-31 18:23:10 +05:30
Jason Zaman
866050d015 gtksocket: Adjust X sizes by scale-factor
X uses unscaled sizes, so they must be scaled properly. Otherwise
GtkSockets end up twice as big as they should be.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=765327
Signed-off-by: Jason Zaman <jason@perfinion.com>

Close !165
2018-05-30 11:37:12 +01:00
Matthias Clasen
7e0db63601 Merge branch 'gesture-docs' into 'master'
Gesture stuff

See merge request GNOME/gtk!169

(cherry picked from commit 8b24d59cde)

334c7911 gesture: Fix get_last_event() docs
e9765c04 gesture: Fix code snippet
4d2b39d9 gesturemultipress: Don’t fire ::released after ::cancel
2018-05-30 05:59:02 +00:00
Matthias Clasen
38b796d2c3 Merge branch 'gtk-3-24' into 'gtk-3-24'
icontheme: Keep dir_mtimes in order

See merge request GNOME/gtk!162
2018-05-27 15:50:45 +00:00
Daniel Boles
bd82962e21 SpinButton: Fix an obviously wrong arg description
:climb-rate is not about what you get when you single-click on a button,
as this implied: it's what happens if you hold down a button or a key.
Fix the description of @climb_rate to new(), and while here, mention the
key in the blurb of :climb-rate itself.
2018-05-26 01:07:19 +01:00
Daniel Boles
2d12660916 StyleContext: Add a missing apostrophe
(or rather, the right single quote dictated by the HIG, which is
semantically not an apostrophe at all! I will die on this hill.)
2018-05-25 21:10:58 +01:00
Jan Alexander Steffens (heftig)
3bb6670f9c
icontheme: Keep dir_mtimes in order
Don't reverse the order each time we insert a theme. Reverse it only
once, after all themes have been loaded.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1115
2018-05-23 20:09:42 +02:00
Daniel Boles
a7cd20823d StyleContext: Don't advise using invalidate()
It's deprecated. Also, set_screen() is not used/needed in the demo cited
2018-05-21 23:40:11 +01:00
Matthias Clasen
abcc477317 Remove the "without parent" warning
We've had it for a long time, and it hasn't really made
a difference. And I don't think we are prepared to turn
this into a hard error. So just drop it.
2018-05-21 17:17:21 -04:00
Daniel Boles
6b30de9487 Range: Up should only mean ++ if we are a GtkScale
The last round of patches to get the desired direction of value move in
response to scrolls/keypresses on scales had the inadvertent side effect
of giving the opposite direction on scrollbars. Seeing as gtkrange.c is
already a collection of hacks, add another so that fix only holds if the
instance is a GtkScale, since that is what those patches were aimed at.

Close https://gitlab.gnome.org/GNOME/gtk/issues/1065
2018-05-21 20:08:05 +01:00
Daniel Boles
f3fa34e850 ProgressBar: Fix typo in doc comment 2018-05-21 20:08:05 +01:00
Matthias Clasen
f30ecaa22f font chooser: Support font variations
Add sliders for the axes on the tweak page.
2018-05-18 09:31:15 +01:00
Matthias Clasen
6271326718 font chooser: Add properties for font features and language
These can't be returned as part of the font description,
so we need new api for them. For now, this is just readonly
properties. Maybe these should be writable too, eventually.
2018-05-18 09:31:15 +01:00
Matthias Clasen
d60cd1f49f font chooser: Add font features
Populate the tweak page with OpenType font features.
2018-05-18 09:31:15 +01:00
Matthias Clasen
b57e10ad60 font chooser: Add a tweak page 2018-05-18 09:31:15 +01:00
Matthias Clasen
cc35a35752 font chooser: introduce font chooser levels
This is a more systematic approach to reducing the
level of detail in the font chooser.
2018-05-18 09:31:15 +01:00
Matthias Clasen
08f31f8f4a Merge branch '1053-scroll-cursor-gets-left-behind-if-a-child-widget-steals-the-scroll' into 'gtk-3-22'
Resolve "Scroll cursor gets left behind if a child widget steals the scroll"

See merge request GNOME/gtk!134
2018-05-17 15:19:49 +00:00
Matthias Clasen
f2868f5cf3 textview: Don't scroll for pastes in another view
GtkTextView scrolls to the insertion point when the text
buffer signals a paste is done. This is wrong when there
are multiple views on the same buffer, and the paste
happened in another view.

To fix this, flip the handling of the scroll_after_paste
boolean to only be TRUE if we know that we want to scroll.
2018-05-17 11:06:46 +01:00
Benjamin Otte
0caa3dbccf Merge branch '1069-thread-1-glade-received-signal-sigfpe-arithmetic-exception' into 'gtk-3-22'
Resolve "Thread 1 "glade" received signal SIGFPE, Arithmetic exception."

See merge request GNOME/gtk!151
2018-05-16 12:48:46 +00:00
Mohammed Sadiq
d219596212 appchooserdialog: Fix memory leak 2018-05-13 14:51:00 +01:00
Mohammed Sadiq
26b6071db8 appchooserdialog: Don't fire notify::heading twice
The gtk_app_chooser_dialog_set_heading() function do emit
notify::heading. Since the setter simply calls the function,
the setter itself shouldn't emit a notify signal by itself.
2018-05-13 14:51:00 +01:00
Mohammed Sadiq
7886c645c4 textview: Always show select-all button in touch popup
"Select all" action is possible regardless of the text selection state
or if the text is editable or not.
2018-05-13 14:51:00 +01:00
Mohammed Sadiq
a8363a9887 textview: Simplify creating bubble action buttons
Buttons can be created simply with gtk_button_new_from_icon_name().
2018-05-13 14:51:00 +01:00
Juan Pablo Ugarte
87aed887be GtkBox: do not divide by zero on gtk_box_size_allocate_with_center()
https://gitlab.gnome.org/GNOME/gtk/issues/1069
2018-05-12 11:06:37 -03:00
Chun-wei Fan
95e6a0650b gtk/Makefile.am: Fix Visual Studio project generation
We now need the generated sources to be included explicitly in the list
so that they get listed in the project files to be built.
2018-05-11 18:05:46 +08:00
Benjamin Otte
85fa6ba631 gtk: Fix reserved pointers
So gcc stops complaining about unnecessary parenthesis.

Closes #1059
2018-05-07 22:02:56 +02:00
Björn Lindqvist
893fc1dec4 Range: Bin pointless check before emitting signal
In scroll_event(), there is no need to check whether we are realized
before emitting ::change-value, as we must be when receiving an event.

Git-formatted/rebased/cleaned up by Daniel Boles <dboles.src@gmail.com>

Close https://gitlab.gnome.org/GNOME/gtk/issues/292
2018-05-06 19:58:15 +01:00
Daniel Boles
96774e8b5c Menu: cleanups for previous commit and nearby
• #include <math.h> for the new uses of floor()
• Move the new ints and popdown_data into the scopes where they are used
• Don’t pointlessly init other ints to 0 as they always get reassigned
• Burninate gint
2018-05-06 11:49:11 +01:00
Sam Douglas
f443dbe8c1 Menu: Fix broken navigation triangle/hysteresis
This issue was caused when mouse coordinates were changed to floating
point values in commit e8b38fedbd.

This patch floors the event->x_root and event->y_root values when
setting the navigation region, so the previous behaviour is restored.

https://gitlab.gnome.org/GNOME/gtk/issues/450
2018-05-06 11:49:01 +01:00
Daniel Boles
133e8fc03f ScrolledWindow: Unset cursor if child takes scroll
https://gitlab.gnome.org/GNOME/gtk/issues/1053
2018-05-05 11:45:43 +01:00
Matthias Clasen
609cb85f3a emoji chooser: Match search terms better
Use g_str_match_string for better results.

cherry-pick of be2853e5de

https://gitlab.gnome.org/GNOME/gtk/issues/898
2018-05-04 09:45:44 +01:00