Commit Graph

54401 Commits

Author SHA1 Message Date
Timm Bäder
1eb22e7927 radibutton: Use focusing facilities from GtkWidget
Instead of the ones from GtkContainer which will hopefully soon go away.
2018-03-17 12:09:30 +01:00
Timm Bäder
fd28bddde1 container: Only do custom focus management if a focus chain is set
Otherwise, the process should be the same one we use in GtkWidget.
2018-03-17 12:09:30 +01:00
Timm Bäder
ca4f08136a container: Rename parent_class to gtk_container_parent_class
To match the name we have everywhere else.
2018-03-17 12:09:30 +01:00
Timm Bäder
16689a1e81 widget: Fix a few typos in cursor documentation 2018-03-17 12:09:30 +01:00
Timm Bäder
24e708a770 popover: Remove an unneeded local variable 2018-03-17 12:09:30 +01:00
Timm Bäder
64e128629f magnifier: Clip child node to magnifier size
It's still broken in several other ways, but now one less.
2018-03-17 12:09:30 +01:00
Timm Bäder
6cfb720ab7 Fix a few get_allocated_width/height usages 2018-03-17 12:09:30 +01:00
Timm Bäder
3e6fea0550 widgetbowl: Add a proper description
Instead of the copy/pasted one from the fishbowl demo.
2018-03-17 12:09:30 +01:00
Daniel Boles
146082d464 Notebook: Don’t show raw underline/markup in popup
If @menu_label == NULL, we create a default page->menu_label. This took
@tab_label.get_label() and passed that to page->menu_label.set_text().
This is wrong because we set the plain text of the menu_label from the
rich text of @tab_label. So, if @tab_label used mnemonics or markup, our
menu_label got the raw underline or markup tags shown in it as raw text.

As we call set_text() on the menu Label, the fix is to be symmetric: use
@tab_label’s get_text() as source, as that strips underlines and markup.

It’s not worth making the default Label ‘inherit’ :use-underline/markup;
that’s a slippery slope, and users wanting such things can just create a
fully fledged GtkLabel to pass as @menu_label to suppress the default.

https://bugzilla.gnome.org/show_bug.cgi?id=705509
2018-03-16 22:34:05 +00:00
Benjamin Otte
b64a403100 selection: Remove surface APIs 2018-03-16 06:04:45 +01:00
Benjamin Otte
12409ee075 cellrendererpixbuf: Store the texture in the iconhelper paintable
That's kinda weird but allows us to delete the texture case from
GtkIconHelper and GTK_IMAGE_TEXTURE from the GtkImageType enum.

And it doesn't cause any other problems because the cell renderer
can't deal with paintables - otherwise it would mirror GtkImage and have
a "paintable" property instead.
2018-03-16 06:04:45 +01:00
Benjamin Otte
cbe40f5f46 image: Remove gtk_image_set_texture()
gtk_image_get_paintable() is a perfect replacement, so use that one.
2018-03-16 06:04:45 +01:00
Benjamin Otte
2935ef8128 image: Add gtk_image_set_can_shrink()
Images with that value set will request a 0x0 minimum size and scale
down their contents.
2018-03-16 06:04:45 +01:00
Benjamin Otte
c6541853ab image: Add gtk_image_set_keep_aspect_ratio()
If set, the image will draw its contents while keeping their aspect
ratio. That means empty areas show up on the top/bottom or left/right.

Also move the special-case snapshotting code for icons to
GtkIconHelper. That's where it belongs.
2018-03-16 06:04:45 +01:00
Benjamin Otte
0a08c03885 iconhelper: Implement GdkPaintable
This only implements the vfuncs, but does not actually emit signals
yet.

It's also not useed for anything other than snapshot() so far, this
will come in later commits.
2018-03-16 06:04:45 +01:00
Benjamin Otte
af18796312 icontheme: Remove surface support
It's not used anymore.
2018-03-16 06:04:45 +01:00
Benjamin Otte
9e54c22c49 image: Don't handle surfaces anymore
Lots of special cases that are no longer needed because no code uses
surfaces.

Also remove the GdkCellRendererPixbuf:surface property.
2018-03-16 06:04:45 +01:00
Benjamin Otte
01f996447e tests: Port from surface to texture 2018-03-16 06:04:45 +01:00
Benjamin Otte
a8608618a9 dragsource: Replace gtk_drag_source_set_icon_surface()
... with gtk_drag_source_set_icon_paintable().
2018-03-16 06:04:45 +01:00
Benjamin Otte
1f4839d4c8 inspector: Use Textures for images in the property view 2018-03-16 06:04:44 +01:00
Benjamin Otte
3c7ee010f5 cellrendererpixbuf: Put pixbufs into textures
... instead of going via surfaces.

A side effect is that the pixbuf property is no longer readable because
we have no good way to get the pixbuf back out of the texture, but I
don't think this matters a lot.

If people want to read the pixbuf property, we need to add some code to
make that work.
2018-03-16 06:04:44 +01:00
Benjamin Otte
7844320f10 image: Load resources and files into textures
Instead of loading them into surfaces (which we want to get rid of), we
load into textures.
In fact, we introduce a new paintable subclass called a GtkScaler that
takes care of tracking scaling.

This also ideally gets rid of an extra conversion once renderers learn
to render textures directly.
2018-03-16 06:04:44 +01:00
Benjamin Otte
c9557c207f iconhelper: Handle texture scale again
We will need that in the next commits.
2018-03-16 06:04:44 +01:00
Benjamin Otte
2016f56176 iconhelper: Turn into a GObject 2018-03-16 06:04:44 +01:00
Benjamin Otte
3427639b08 iconhelper: Rework to allow resizing of paintables
GtkImage will now allow paintables to be rendered to the full image and
the image will be sized according to CSS rules for image sizing.
2018-03-16 06:04:44 +01:00
Benjamin Otte
3e50092869 iconhelper: Rename function
There are no more icon sizes, this is now the default size we render at.

This naming change is kinda relevant because of CSS terminology.
2018-03-16 06:04:44 +01:00
Benjamin Otte
536714a147 paintable: Add gdk_paintable_compute_concrete_size()
Do the CSS size computation routine. This will be used elsewhere soon.
2018-03-16 06:04:44 +01:00
Benjamin Otte
bcf1aa7cb2 tooltips: Make icon a paintable 2018-03-16 06:04:44 +01:00
Benjamin Otte
d1be2b29cf entry: Make icons a paintable 2018-03-16 06:04:44 +01:00
Benjamin Otte
89ee42db54 dnd: Make dnd icon API take a paintable
... instead of a texture.
2018-03-16 06:04:44 +01:00
Benjamin Otte
ccb6b8585c aboutdialog: Make logo a paintable
No reason to limit this to textures anymore.
2018-03-16 06:04:44 +01:00
Benjamin Otte
2b35332fd6 cssimage: Implement dynamicity for cross-fades 2018-03-16 06:04:44 +01:00
Benjamin Otte
7e39b12858 css: Implement dynamic values for array values
This makes animated background-images work.
2018-03-16 06:04:44 +01:00
Benjamin Otte
3faa7e04db cssimage: Add GtkCssImagePaintable
This type can hold any GdkPaintable.

Use it to replace GtkCssImageSurface, which used to hold a GdkTexture.
2018-03-16 06:04:44 +01:00
Benjamin Otte
4beeb6173b cssimage: Add gtk_css_image_is_invalid()
Use that instead of hacks to guess when an image is considered invalid
according to https://drafts.csswg.org/css-images-4/#invalid-image

Also add a GtkCssImageInvalid that implements the behavior of invalid
images according to the CSS spec so thjat image implementations can
refer to that image.
2018-03-16 06:04:44 +01:00
Benjamin Otte
5970dac167 build: Switch order of subdirectories
This makes demos be compiled/linked before tests. And that means that
while hacking, I can already run widget-factory when the tests are
still linking.
2018-03-16 06:04:44 +01:00
Benjamin Otte
9fa1e68151 image: Implement support for paintables
This includes adding support to GtkImageDefintion and GtkIconHelper.

Only GtkImage handles support for signals from the paintable.
2018-03-16 06:04:44 +01:00
Benjamin Otte
c59948169d iconhelper: transition to GdkPaintable
This is in preparation for accepting the image type paintable.

It's a bit incovenient because we need more code to track width/height
ourselves (as the paintable no longer does it for us), but it's not too
hard.

GtkIconHelper does not track invalidations on the paintable.
2018-03-16 06:04:44 +01:00
Benjamin Otte
a4e16ce3cc texture: Implement GdkPaintable
This is kind of evil because we need to link to GTK to be able to
snapshot, but I hope nobody notices.
2018-03-16 06:04:44 +01:00
Benjamin Otte
d4764cc89b snapshot: "Inherit" from GdkSnapshot
This is a neat trick to get around the circularity between GDK, GSK and
GTK that we inherit with the GdkPaintable interface.

GdkPaintable uses GtkSnapshot
GtkSnapshot creates GskRenderNodes
GskRenderNodes use GdkTextures
GdkTexture will soon implement GdkPaintable

This causes a loop that spans GDK, GSK and GTK and this is the easiest
way to resolve it without breaking bindings (at least that's the idea).
2018-03-16 06:04:44 +01:00
Benjamin Otte
8f43d7e188 gdk: Add GdkPaintable 2018-03-16 06:04:44 +01:00
Benjamin Otte
a721d8b78f css: Implement support for dynamic values
This adds a new GtkStyleAnimation called GtkCssDynamic (for lack of a
better name) that is spawned whenever at least one dynamic value is part
of the GtkCssStyle.
2018-03-16 06:04:43 +01:00
Benjamin Otte
d774406573 cssimage: Implement dynamic values
No image actually implements it yet, but this is the plumbing.
2018-03-16 06:04:43 +01:00
Benjamin Otte
3322599e99 css: Introduce the idea of dynamic values
Dynamic values are values that change their contents with the current
(monotonic) time.

This just introduces the GtkCssValue API for it.
2018-03-16 06:04:43 +01:00
Benjamin Otte
7f0ef81e11 vulkan: Our data is premultiplied, don't pretend it isn't
If the backend can't do premultiplied alpha, better make the backend treat
2018-03-16 06:04:43 +01:00
Benjamin Otte
927f48d289 css: Remove ability to query css images as cairo patterns
Nobody's doing that. And CSS Images are no longer using Cairo anyway.

If we wanted to support querying them (hint: we don't) we should be
using GdkPaintable.
2018-03-16 06:04:43 +01:00
Benjamin Otte
45072c3a64 aboutdialog: The default icons are textures these days 2018-03-16 06:04:43 +01:00
Benjamin Otte
a891a3ae26 demos: Unbreak icon for fishbowl demo
351559fcfa was to eager in simplifying
things.
2018-03-16 06:04:43 +01:00
Benjamin Otte
4bb8352ab5 css: Fix compiler warning
...
2018-03-16 06:04:43 +01:00
Matthias Clasen
62aa487500 Improve the scale handling
Always use the smallest scale that is larger than requested,
or, failing that, the largest available scale.
2018-03-15 20:28:12 -04:00