Commit Graph

25066 Commits

Author SHA1 Message Date
Matthias Clasen
c376e82702 colorswatch: Convert to gadgets
Use gadgets for the widget and the overlay.
2015-12-15 08:41:16 -05:00
Matthias Clasen
fcca496734 widget: Deprecate some style properties
Deprecate the ::wide-separators and ::separator-width/height
style properties.
2015-12-15 08:41:16 -05:00
Matthias Clasen
20e1ff44e8 Adwaita: Update separator styling
Separators no longer draw a line with the foreground color,
but instead just draw background.
2015-12-15 08:41:16 -05:00
Matthias Clasen
17be791b0b separator: port to gadgets
As part of this, stop using custom rendering code for wide
and non-wide separators.
2015-12-15 08:41:16 -05:00
Matthias Clasen
9e278293ca spinner: Use a gadget
This gives us min-width/height support. Currently, the spinner
still has a hardcoded minimum size of 16 and doesn't grow beyond
32. We may want to revisit that at some point.
2015-12-15 08:41:16 -05:00
Matthias Clasen
fffa84b843 progressbar: Convert to gadgets
Use gadgets for the text, the trough and the progress.
2015-12-15 08:41:16 -05:00
Benjamin Otte
1f6efbf669 iconhelper: Queue resize on invalidation
When things change in the iconhelper, queue a resize on the owner widget
so that it automatically resizes.

Only do this for iconhelpers that are used as gadgets though, not for
temporary helpers - and to check this, check if the node is transient.
2015-12-15 08:41:16 -05:00
Benjamin Otte
3a77da9df2 entry: Turn icons into gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
4dee06e04f spinbutton: Port the buttons to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
4586503e93 iconhelper: Finish gadget conversion
Implement missing vfuncs
2015-12-15 08:41:16 -05:00
Benjamin Otte
e723fccaa9 rendericon: Restore cairo matrix after rendering 2015-12-15 08:41:16 -05:00
Benjamin Otte
b79a187d47 iconhelper: Handle invalidation
When CSS, direction or scale factor change, handle the invalidation
inside the iconhelper.
This way the widgets using them don't have to.
2015-12-15 08:41:16 -05:00
Benjamin Otte
de6dca4f81 iconhelper: Use the gadget's node
... instead of looking at the widget's style context.

This removes all calls to the style context.
2015-12-15 08:41:16 -05:00
Benjamin Otte
ad22612ab2 iconhelper: Require passing a cssnode to the constructor
Note that we don't use it yet.
2015-12-15 08:41:16 -05:00
Benjamin Otte
7075d00958 iconhelper: Use the gadget's owner property
Don't keep the owner widget ourselves.
2015-12-15 08:41:16 -05:00
Benjamin Otte
25ecd8cd37 iconhelper: Turn into gadget
This is just the basic conversion to inheriting from
GTK_TYPE_CSS_GADGET.
2015-12-15 08:41:16 -05:00
Matthias Clasen
c0fd106019 image: Port to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
49fea0b0f5 box: Port to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
7a05016d93 container: Split out a function
Computing the clip for all children is something I want to do in other
places.
2015-12-15 08:41:16 -05:00
Benjamin Otte
0f8233bd7b switch: Port to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
e09eb4fc9f gadget: Add GtkCssCustomGadget
The thing you use when you want to custom-do everything.
2015-12-15 08:41:16 -05:00
Benjamin Otte
6eafe00d8f gadget: Add the concept of a "gadget"
A gadget is halfway between a widget and a CSS node. It's supposed to
provide the minimum convenicence around CSS nodes until we've figured
out how to integrate them with widgets.
2015-12-15 08:41:16 -05:00
Benjamin Otte
0fb01decba css: Add min-width/height CSS properties 2015-12-15 08:41:16 -05:00
Benjamin Otte
a920f7260c treeview: Reposition dnd button css node properly
After the drag ends, the button node went to the wrong place and then
looked like a regular button. Fix that.
2015-12-15 08:41:16 -05:00
Benjamin Otte
26d536a69b inspector: Fix quick-fix
Constructing GtkCssStyleChange objects without styles is forbidden, so
don't do it. Instead untangle the callback from the actual update
function and call that untangled function directly.
2015-12-15 01:15:51 +01:00
Benjamin Otte
f6606c4f6f cssnode: Clear cache if reusing style
When we reuse styles that didn't change across changes to the source
CSS, make sure we clear the caches. Otherwise child nodes will pick up
styles from the old source CSS.
2015-12-15 01:15:51 +01:00
Carlos Garnacho
f663d17c14 GtkTreeView: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:56 +01:00
Carlos Garnacho
91b5497d69 GtkNotebook: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:56 +01:00
Carlos Garnacho
fad174b967 GtkEntryCompletion: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
534b0af512 GtkComboBox: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
d54f208d29 GtkMenu: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
5cbbb90e31 GtkCellRendererAccel: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
e4eeec2163 GtkButton: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Matthias Clasen
a22c1ec980 dnd: Cleanups
Remove some now unused includes and dead code, and rename
gtk_drag_set_icon_window to gtk_drag_set_icon_widget_internal,
since it is no longer restricted to toplevel windows.
2015-12-13 18:24:41 -05:00
Matthias Clasen
95f648147d dnd: Stop doing cancel animation in GTK+
Under Wayland, the compositor does it, so there is no need
for us to move the window ourselves. For X11, we are now
doing the animation from the X11 backend. Trigger that by
calling gdk_drag_drop_done().

What changes here is that we have to keep the icon_window
alive for as long as the drag context exists. Use a weak
reference to do so.
2015-12-13 16:02:02 -05:00
Matthias Clasen
a24bbcbb8d dnd: Pass start coordinates when creating the drag context
This will be used in subsequent commits.
2015-12-13 10:39:43 -05:00
Benjamin Otte
eb97ef0514 cssnode: Set new style if it's animated
In commit 2c61316677 we avoided emitting
the style-changed signal if no CSS property changed.

Unfortunately, this also caused CSS styles to not be updated when
animations started if those animations did not change any CSS value
immediately. In those cases the animation would just never start.
The obvious example was the spinner.
2015-12-13 16:12:39 +01:00
Benjamin Otte
5cbbc62026 widget: Pass a GtkCssStyleChange instead of a bitmask 2015-12-13 04:11:58 +01:00
Timm Bäder
c219bdbecc Gestures: Add some nullable annotations 2015-12-12 09:29:08 +01:00
Timm Bäder
c3fd1b3b73 GtkFlowBox: Add missing nullable annotation 2015-12-12 09:29:08 +01:00
Timm Bäder
c02f68f0ba GtkFlowBox: Fix copy/paste mistake in docs 2015-12-12 09:29:08 +01:00
Benjamin Otte
776f034e2d cellrendererpixbuf: Don't set icon size for pixbufs
The code before the refactorings didn't set it, so we now don't set it
either.

Fixes images being way too smal inside iconviews.
2015-12-12 03:24:32 +01:00
Benjamin Otte
2c61316677 cssnode: Catch case where a style didn't change
Catch the case where a CSS style did not change and don't emit the
style-changed signal in that case.

This saves not only the emission of the signal, but also doesn't cause
invalidation in child nodes, which would previously get a PARENT_STYLE
2015-12-12 02:16:04 +01:00
Benjamin Otte
971a277419 cssnode: Change style-changed signal
Instead of having old and new style, now have a GtkCssStyleChange opaque
object that will compute the changes you are interested in for you.

This simplifies change signal handlers quite a bit and avoids lots of
repeated computation in every signal handler.
2015-12-12 02:16:04 +01:00
Matthias Clasen
0ad259a178 inspector: Hide request mode for non-widgets
Only widgets have a request mode.
2015-12-11 17:12:44 -05:00
Lapo Calamandrei
bb16ba7e31 Adwaita: menu color change on the dark variant only 2015-12-11 21:08:53 +01:00
Matthias Clasen
fb937984af file chooser: Also apply the settings
I forgot that the settings object we're dealing with here
is in delay mode, so settings won't apply immediately.
2015-12-11 12:25:31 -05:00
Matthias Clasen
d4654dd10b file chooser: Store size more frequently
We were only storing the dialog size on unmap, but resetting to the
stored default value more often, e.g. on focus-out. This was causing
the dialog to 'jump back' to its remembered size after the user
manually resized it, leading to frustration and bug reports.

Instead, save the dialog size on every ::size-allocate of the toplevel.
To avoid needlessly spamming dconf, only write the new value if it
changed.
2015-12-11 12:15:03 -05:00
Georges Basile Stavracas Neto
8884e82af8 placesviewrow: remove unneeded functions
These function declarations are not used nor implemented
anywhere, so remove them.
2015-12-11 02:28:39 -02:00
Matt Watson
ae487840f0 gtkstack: remove needless queue_resize
In gtk_stack_set_transition_position we should only need to
queue_resize if we are non-homogeneous, which is already done
earlier in the function.
2015-12-10 16:51:29 -08:00