Commit Graph

51673 Commits

Author SHA1 Message Date
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
Debarshi Ray
edaaefcb74 build: Bump minimum Meson version to 0.42.1
Otherwise it fails to build with:

  FAILED: gtk/im-ipa@sha/imipa.c.o
  ...
  In file included from ../gtk/gtkintl.h:4:0,
                   from ../modules/input/imipa.c:28:
  /opt/include/glib-2.0/glib/gi18n-lib.h:27:2: error: #error You must
          define GETTEXT_PACKAGE before including gi18n-lib.h. Did you
          forget to include config.h?
   #error You must define GETTEXT_PACKAGE before
           including gi18n-lib.h.  Did you forget to include config.h?
    ^~~~~
  ../modules/input/imipa.c:144:3: error: ‘GETTEXT_PACKAGE’ undeclared
          here (not in a function)
     GETTEXT_PACKAGE,     /* Translation domain */
     ^~~~~~~~~~~~~~~
  ../modules/input/imipa.c:145:4: error: ‘GTK_LOCALEDIR’ undeclared
          here (not in a function)
      GTK_LOCALEDIR,     /* Dir for bindtextdomain (not strictly
              needed for "gtk+") */
      ^~~~~~~~~~~~~
2017-09-18 18:04:34 +02:00
Anders Jonsson
0b54b415ab Update Swedish translation 2017-09-18 11:22:25 +00:00
Anders Jonsson
44993e4393 Update Swedish translation 2017-09-18 11:20:48 +00: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
03204f8cdb x11: Add support for _GTK_EDGE_CONSTRAINTS atom
Following the previous patch, where edge constraints support
was added to the Wayland backend, this patch introduces the
necessary code to handle the _GTK_EDGE_CONSTRAINTS atom from
X11 backend.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Georges Basile Stavracas Neto
e9cc77ecc8 wayland: consider edge constraints in surface configuration
Now that GTK windows have the ability to properly handle
per-edge tiling constraints, this patch extends GTK's
internal Wayland protocol to have a proper enum with the
relevant edge data.

Once this approach is validated, we can think of upstreaming
this work as an official Wayland protocol extension.

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
Georges Basile Stavracas Neto
019f0af0eb gdk: introduce edge constraint states
These states will be consumed by GtkWindow in order to
have better edge management on tiling situations. Their
values are supplied by the compositor, and will be send
through and X11 Atom or a Wayland protocol extension.

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
Carlos Garnacho
8a26fd3308 tests: Update testoverlay "Chase" testcase to gtk4 crossing events
The intent is detecting enter events into the overlayed label, so just
connect to ::enter-notify-event on the label with no GdkWindow checks.
2017-09-15 21:11:22 +02: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
Emmanuele Bassi
67d9cefb72 build: Declare cairo_libs outside MSVC check block
Otherwise there won't be a reference to it on non-MSVC builds.
2017-09-15 15:57:34 +01:00
Chun-wei Fan
84ff9e93d5 build: Add fallback dependency discovery for MSVC
For dependencies that do not generate pkg-config files for their Visual
Studio build systems, we need to look for them using cc.has_header() and
cc.find_library(), namely for Cairo and HarfBuzz, if one does not have
crafted pkg-config files for them (which, by themselves may be
error-prone).

As a result, we will still try to look for Cairo and HarfBuzz using
pkg-config, but will give another shot at them on Visual Studio using
cc.has_header() and cc.find_library() if they couldn't be found via
pkg-config.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-09-15 21:41:16 +08:00
Chun-wei Fan
fc5f391110 build: Correct PangoCairo required version
We ought to use pango_req instead of cairo_req for the version required
for PangoCairo.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-09-15 21:41:15 +08:00
Chun-wei Fan
0b783f6750 meson.build: Fix Vulkan library detection on Visual Studio
The Vulkan .lib file that is supplied by the LunarG Vulkan SDK is
vulkan-1.lib, not vulkan.lib, so make sure we look for the right
libraries when building on Visual Studio (I am not sure whether the
LunarG SDK will work for MinGW/mingw-w64 builds, as only Visual Studio
.lib files are provided).

Note that this will require one to set LIB and INCLUDE appropriately to
find the Vulkan .lib and header files, and possibly PATH if one's video
drivers do not contain the Vulkan runtime DLL.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-09-15 21:41:15 +08:00
Chun-wei Fan
60297b9fc7 testsuite: Fix builder test on Windows/MSVC
Visual Studio does not support things like -Wl,export-dynamic, so we
need to export those symbols by using __declspec(dllexport).  So, we
decorate these with macros which we define accordingly for this purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-09-15 21:41:15 +08: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
Chun-wei Fan
e5a1de1c19 gdk/gdkconfig.h.meson: Add GDK_WINDOWING_WIN32
This is so that Meson can add this define once it is determined that we
are building for Windows.

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
4cb00d9546 gtk-demo/theming: Don’t mislead about raised class
This class is not added by any widgets nor themed by Adwaita/HC.
However, it is presented here as if it does something. It doesn’t.

But we changed the 2 buttons with the .raised class to use symbolic
icons, unlike their ‘unraised’ counterparts, which is unnecessarily
confusing and might make people think .raised affects icons somehow.

So, make them use the same icons in all cases; that way, if .raised is
ever made to do anything, 6 years later, what it does will be clear.

https://bugzilla.gnome.org/show_bug.cgi?id=644248
2017-09-14 18:35:18 +01:00
Daniel Boles
6ee2bf6286 widget-factory: Usefully demo Frame shadow types
Instead of showing the 4 types except for GTK_SHADOW_NONE, which are all
treated identically and provide no way for themes to differentiate, just
keep 2 Frames, and make one of them GTK_SHADOW_NONE to demo a flat Frame
2017-09-14 18:35:08 +01:00
Daniel Boles
ac4faad8a2 Frame: Add missing fixed-width format to enums 2017-09-14 18:29:08 +01:00
Timm Bäder
c3a191abe2 build: Add directories to the summary 2017-09-14 18:22:36 +02: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
Stas Solovey
c2739ba1e7 Update Russian translation
(cherry picked from commit eeeb8f21e2)
2017-09-12 19:15:39 +00: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
ff45a86a1c Fix rendering glyphs from the cache
We were not quite using all the right dimensions.
2017-09-11 14:45:36 -04:00