Commit Graph

56049 Commits

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

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

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

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

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

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

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

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

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

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

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

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

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

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

- add a global GtkToolButton_private_offset variable
- add a static inline gtk_tool_button_get_instance_private() that does return
(G_STRUCT_MEMBER_P (self, GtkToolButton_private_offset));
- call g_type_add_instance_private (g_define_type_id, sizeof (GtkToolButtonPrivate)) inside
gtk_tool_button_get_type() and store the result in GtkToolButton_private_offset
- replace g_type_class_add_private() inside gtk_tool_button_class_init() with
g_type_class_adjust_private_offset (klass, &GtkToolButton_private_offset)
"
2018-11-07 17:50:04 +00:00
Javier Jardón
c37c86a9bf gtk/gtktextview.c: Remove unused GTK_TEXT_VIEW_GET_PRIVATE() macro 2018-11-06 13:45:58 +00:00
Timm Bäder
b4b30b4951 Merge branch 'wip/3v1n0/recent-info-cleanup' into 'master'
gtk-autocleanups: add cleanup function for GtkRecentInfo

See merge request GNOME/gtk!409
2018-11-06 09:52:11 +00:00
Matthias Clasen
54830a2af3 wayland: Fix a thinko in settings portal support
When we decide to fall back because the settings portal
is not present, adhere to that decision elsewhere. And
treat the fontconfig-timestamp like the other special-cased
settings, with G_TYPE_NONE.
2018-11-05 18:34:13 -05:00
Marco Trevisan
9946dd2ab7 gtk-autocleanups: add cleanup function for GtkRecentInfo 2018-11-05 21:37:42 +00:00
Matthias Clasen
5028cb35bc Merge branch 'wip/settings-portal' into 'master'
settings portal

See merge request GNOME/gtk!403
2018-11-04 20:57:26 +00:00
Matthias Clasen
48b569eae0 wayland: Support the settings portal
Under Wayland, we are currently directly using GSettings
for desktop settings. But in a sandbox, we may not have
access to dconf, so this may fail. Use the new settings
portal instead.
2018-11-04 15:44:50 -05:00
Matthias Clasen
8099669466 Move the should_use_portal helper to gdk
We want to use it there too, in the future.
Update all callers.
2018-11-04 08:17:32 -05:00
Matthias Clasen
1c465604d5 Use a simpler sandbox check
No need to use the runtime dir and allocate a string.
We can just check in /.
2018-11-04 08:17:32 -05:00
Matthias Clasen
833442e1e2 Merge branch 'wip/fmuellner/deco-setting' into 'master'
wayland: Remove GNOME Classic-specific workaround

See merge request GNOME/gtk!400
2018-11-02 16:18:25 +00:00
Florian Müllner
1e39f999e3 wayland: Remove GNOME Classic-specific workaround
As GSettings now supports session-specific defaults, GNOME Classic
no longer uses a separate schema and the decoration layout is always
determined by the regular schema.

This essentially reverts commit add67b516c (although the code was
moved since then).

https://gitlab.gnome.org/GNOME/gtk/merge_requests/400
2018-11-02 16:44:33 +01:00
John Ralls
e31187e1cf GdkQuartz: Handle NULL from [NSGraphicsContext currentContext].
By returning a default surface. The situation where there's no
currentContext arises when GtkCSS is trying to determine the
layout sizes so no actual display is necessary.

Closes: #1411
2018-11-01 15:39:27 -07:00
John Ralls
e457a7823c Use [NSGraphicsContext CGContext] instead of graphicsPort after Yosemite. 2018-11-01 15:38:43 -07:00
John Ralls
88c77eb7be Update GDK_OSX versions to current MacOS release. 2018-11-01 15:38:29 -07:00
Piotr Drąg
f57d337fac Update POTFILES.in 2018-10-31 18:46:48 +01:00
Timm Bäder
60b0f48fbc Merge branch 'wip/carlosg/public-legacy-controller' into 'master'
Make legacy controller public

See merge request GNOME/gtk!388
2018-10-31 13:39:08 +00:00
Руслан Ижбулатов
4c6d60ce2b GDK W32: Be honest about supported clipboard formats
Do not lie to W32 about the formats that we provide or accept.

Originally the logic behind such lies was that GdkPixbuf allows us to
convert any supported image to BMP or PNG, and therefore we should
announce that we always provide/accept BMP and PNG along with other
formats.

But that's not how it works. GDK has built-in serializers and
deserializers for all pixbuf formats (where it just invokes GdkPixbuf
API) and will use them automatically to read or write GdkTexture
objects (internally wrapping GdkPixbuf objects where necessary). The
encoding and decoding of images is handled
by GdkContent(De)Serializers, backend has nothing to do with it.

Therefore W32 GDK backend should only offer formats that it can
actually do conversion for by itself (such as image/bmp <-> CF_DIB,
or text/uri-list <-> CFSTR_SHELLIDLIST).
2018-10-31 08:40:50 +00:00
Timm Bäder
b4acf81609 Merge branch '1422-gtkentry-s-minimum-width-is-hardcoded-to-150px-GTK4' into 'master'
gtkentry: set minimum-width to 0 instead of 150

Closes #1422 and evince#1002

See merge request GNOME/gtk!393
2018-10-26 09:25:36 +00:00
Matej Urbančič
62871400b1 Updated Slovenian translation 2018-10-25 22:06:19 +02:00
Matej Urbančič
c4b3337569 Added Slovenian translation 2018-10-25 22:03:51 +02:00
Nelson Benítez León
45e6e0cd04 gtkentry: set minimum-width to 0 instead of 150
and use 150 as natural-width.

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

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

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

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

[2] Fixes issue evince#1002
2018-10-24 23:02:31 +05:00
Timm Bäder
98dd53c2c3 Merge branch 'nirbheek/meson-fallback-dep-fixes' into 'master'
Misc meson fixes for using subproject dependencies

See merge request GNOME/gtk!232
2018-10-24 09:42:12 +00:00
Kristjan SCHMIDT
ad7eaf2bb8 Update Esperanto translation 2018-10-24 08:14:41 +00:00
Jakub Steiner
ef82f1799f Adwaita: prevent devel styling break selection mode
- Selection mode does not get the special devel styling.

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

https://source.puri.sm/Librem5/libhandy/issues/57
2018-10-22 10:31:20 +02:00
Ignacio Casal Quinteiro
1729da8a3e quartz: do not cache the screen in the gdkmonitor
Instead we just cache the monitor number and get
out of it the nsscreen when it is needed. This is
a requirement since it nsscreen it is not supposed
to be cached.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1312
2018-10-17 10:10:44 +02:00
Matthias Clasen
a3ac3b61ef Merge branch '1397-gtknotebook-built-in-popup-menu-listing-tabs-doesn-t-use-tab-label-text-for-the-last-tab-4' into 'master'
Notebook: Ensure menu label updates with tab_label

Closes #1397

See merge request GNOME/gtk!386
2018-10-16 20:49:42 +00:00