Commit Graph

96 Commits

Author SHA1 Message Date
Timm Bäder
5e3b866370 flowbox: Remove gadgets 2017-07-19 21:27:11 -04:00
Timm Bäder
c268ed832d flowbox: Initialize allocation 2017-07-19 21:27:11 -04:00
Timm Bäder
72c611f7b1 flowbox: Remove css box drawing 2017-07-19 21:27:11 -04:00
Timm Bäder
19174d8d94 flowbox: Fix motion notify handler
Same story as in GtkListBox.
2017-05-25 16:25:59 +02:00
Timm Bäder
2ad2ecad44 flowbox: Fix child item selection 2017-05-25 16:25:59 +02:00
Timm Bäder
dd836fff35 flowbox: Fix child item allocation 2017-05-25 16:25:59 +02:00
Carlos Garnacho
57d7c34d03 gtkflowbox: Remove child window
This widget correctly sets up a clip, so it is not necessary neither
for rendering nor for receiving input events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
a72404dd5a gtk: Mass delete all GtkWidget event mask API
We now rely on toplevels receiving and forwarding all the events
the windowing should be able to handle. Event masks are no longer a
way to determine whether an event is deliverable ot a widget.

Events will always be delivered in the three captured/target/bubbled
phases, widgets can now just attach GtkEventControllers and let those
handle the events.
2017-05-25 16:25:58 +02:00
Timm Bäder
f053a63d74 container: Remove include_internals parameter from forall
with include_internals=TRUE, this is the same as the (still private)
gtk_widget_forall, or just using the children/sibling accessors in a
loop.
2017-04-25 20:30:37 +02:00
Matthias Clasen
7860e2d5cd flowbox: don’t try to focus or draw NULL widgets
Rubberbanding over an empty area results in warnings, due to the code
trying to focus and queue a null pointer for drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=780734
2017-04-05 20:15:32 -04:00
Timm Bäder
43cdeee3c4 widget: Save pointer to focus child
Do the same thing GtkContainer does.
2017-03-31 09:50:39 +02:00
Ernestas Kulik
fe1e53ad87 flowbox: don’t select when rubberbanding over nothing
When rubberbanding over an empty area, everything is selected on gesture
end, which is a bit counter-intuitive.

https://bugzilla.gnome.org/show_bug.cgi?id=780735
2017-03-31 07:24:15 +03:00
Timm Bäder
0675fce506 flowboxchild: Use gtk_widget_measure to measure widget sizes
GtkFlowBoxChild is a simple GtkBin, so measure the child widget size in
a simple way.
2017-02-17 18:23:10 +01:00
Timm Bäder
82e49952e5 flowbox: Measure child widget sizes using gtk_widget_measure 2017-01-22 15:01:40 +01:00
Benjamin Otte
6055028c96 snapshot: Rename append APIs
Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
2017-01-13 04:46:09 +01:00
Benjamin Otte
c1f1dae997 viewport: Remove API to query GdkWindows 2017-01-08 00:48:13 +01:00
Debarshi Ray
2cbe057351 flowbox: Don't emit child-activated while dragging the pointer
https://bugzilla.gnome.org/show_bug.cgi?id=776306
2016-12-20 18:48:03 +01:00
Benjamin Otte
0dbdf0c428 gadget: Remove gtk_css_gadget_draw()
And with it, remove the draw func from custom gadgets, that has been
NULL everywhere.

All gadgets are snapshot now.
2016-12-20 18:01:12 +01:00
Debarshi Ray
7ea199c831 flowbox: Export gtk_flow_box_get_child_at_pos as public API
https://bugzilla.gnome.org/show_bug.cgi?id=776187
2016-12-20 00:35:17 +01:00
Debarshi Ray
7331735499 flowbox: Don't emit selected-children-changed during destruction
https://bugzilla.gnome.org/show_bug.cgi?id=776012
2016-12-19 18:05:59 +01:00
Debarshi Ray
9791641d43 flowbox: Rename gtk_flow_box_find_child_at_pos for consistency
... with gtk_list_box_get_row_at_y. It would be nice to avoid the
'find' versus 'get' discrepancy since we are planning to expose it as
public API.

https://bugzilla.gnome.org/show_bug.cgi?id=776187
2016-12-19 15:07:53 +01:00
Debarshi Ray
1f7b03bb2b flowbox: Fix get_child_at_index crash with an invalid index
https://bugzilla.gnome.org/show_bug.cgi?id=775525
2016-12-02 19:17:40 +01:00
Benjamin Otte
d12c81f177 flowbox: Size gadget realtive to widget->window
This fixes a few clipping issues and syncs code with GtkListBox.
2016-11-30 15:15:08 +01:00
Emmanuele Bassi
4cbe079767 Use Graphene init macros for compound literals
The Graphene init macros can now be used for compound literals, which
means we need to update our mixed uses.
2016-11-21 16:21:38 +00:00
Benjamin Otte
150f75af66 snapshot: Convert GtkFlowBox 2016-11-15 17:49:19 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01:00
Benjamin Otte
9006e697fb flowbox: children per line may not be 0 2016-11-15 17:48:45 +01:00
Benjamin Otte
2f8df5237f flowbox: Turn into no-window widget 2016-11-06 14:41:07 +01:00
Benjamin Otte
a0e63b8a07 rendernode: Require passing a renderer to get_draw_context()
This is in preparation of making render nodes independent of the
renderer, so that they can be rendered multiple times with different
renderers.
2016-11-01 16:32:26 +01:00
Timm Bäder
5c99f7a670 Fix clip of more windowed widgets 2016-10-28 19:33:47 +02:00
Alexander Larsson
70935f0952 Drop support for offscreen GdkWindows
These complicate a lot of GdkWindow internals to implement features
that not a lot of apps use, and will be better achieved using gsk.
So, we just drop it all.
2016-10-25 09:54:37 +02:00
Timm Bäder
9992a616ef widget: Use ::measure vfunc to measure size
Add a new ::measure vfunc similar to GtkCssGadget's that widget
implementations have to override instead of the old get_preferred_width,
get_preferred_height, get_preferred_width_for_height,
get_preferred_height_for_width and
get_preferred_height_and_baseline_for_width.
2016-10-22 19:05:47 +02:00
Matthias Clasen
f101ef7cd1 Convert GtkFlowBox to indirect rendering 2016-10-18 11:49:15 +01:00
Benjamin Otte
1c6a879e1c flowbox: Use gdk_window_new_child() 2016-10-18 00:22:35 +02:00
Benjamin Otte
4df6ddad54 API: container: Remove gtk_container_set_border_width() 2016-10-16 18:18:58 +02:00
Benjamin Otte
1518fe0a8f API: stylecontext: Remove state argument from getters
The argument must always be the current state.
2016-10-16 18:18:58 +02:00
Matthias Clasen
bbd94b5a9f gtk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Timm Bäder
c360b5fb49 Remove more unnecessary redraws
The call to gtk_widget_set_state_flags immediately before these already
queues a redraw/allocate/resize in case they have to be queued.
2016-02-07 19:16:26 +01:00
Matt Watson
11ad60d386 flowbox: remove unused prelight code
It was causing needless redraws

https://bugzilla.gnome.org/show_bug.cgi?id=759757
2015-12-21 14:52:11 -08:00
Matthias Clasen
2f544655f9 Revise CSS node documentation
Clarify the use of brackets in the CSS node diagrams:
[] means optional nodes or classes, <> means child widgets.
2015-12-16 10:58:47 -05:00
Matthias Clasen
06b28a610b flowbox: Don't render focus erroneously
The gadget render function should only return TRUE if the
widget has the focus, and wants it rendered.
2015-12-15 15:10:08 -05:00
Matthias Clasen
49e24b05b5 flowbox: convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
3b264ea555 flowbox: Convert child to gadgets 2015-12-15 08:41:16 -05: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
Timm Bäder
2182fe7d9d Don't pass widget state flags to GtkStyleContext API 2015-11-22 17:11:35 +01:00
Matthias Clasen
afc09d924e flowbox: Add a diagram to CSS documentation 2015-11-10 07:39:40 -05:00
Matthias Clasen
6c7f4b78b5 flowbox: Use a CSS node for rubberband drawing
Use a CSS node with name rubberband to draw the rubberband
selection.
2015-11-10 00:51:48 -05:00
Matthias Clasen
ec60bd889c flowbox: Add element names
The names used here are flowbox and flowboxchild.
2015-11-05 15:23:44 -05:00
Rafal Luzynski
3c253c46a5 flowbox: correct the behavior with "can-focus"==FALSE
In fact there were two issues:

1. GtkFlowBoxChild with "can-focus"==FALSE should pass the focus
to its child immediately.
2. GtkFlowBox with "can-focus"==FALSE should cease its custom keynav
implementation and fall back to the default GtkContainer behavior
which is more natural.

Thanks to these changes the flow box can act as a better replacement
for GtkGrid and similar containers.

https://bugzilla.gnome.org/show_bug.cgi?id=753371
2015-10-03 22:48:15 -04:00