Commit Graph

43 Commits

Author SHA1 Message Date
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Timm Bäder
ede6f2ab59 Slightly rework clip handling
always initialize clips to the (content) allocation, don't walk up the
widget hierarchy in gtk_widget_set_clip, implement
gtk_widget_size_allocate in GtkSeparator. This way we don't end up using
uninitialized clip values.

The entire clip handling is up for major rework since we can't and don't
want to force every single widget to call _set_clip in size-allocate
implementations.
2017-07-19 21:27:12 -04:00
Timm Bäder
23ef6e4a3b actionbar: Remove gadget 2017-07-19 21:27:11 -04:00
Timm Bäder
2b0bfa5909 actionbar: Remove css box drawing 2017-07-19 21:27:11 -04:00
Matthias Clasen
e936a35d66 Make GtkCenterBox public
It provides functionality that GtkBox used to have,
and is generally useful.
2017-06-04 21:20:27 -04: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
Timm Bäder
066c1983ba actionbar: Add explicit center widget
The center widget in GtkBox was only introduced to use it in
GtkActionBar. However, the implementation there is much more complex
than it needs to be, so move the center widget into GtkActionBar instead
and later remove it from GtkBox.
2017-04-25 20:30:37 +02:00
Timm Bäder
c92b7d4224 box: Remove fill child property
GtkWidget:halign and GtkWidget:valign are sufficient
2017-04-25 20:30:37 +02:00
Timm Bäder
5729ea7744 box: Remove expand child property
GtkWidget already has hexpand/vexpand properties.
2017-04-25 20:30:37 +02:00
Timm Bäder
56a58655fe Remove unnecessary gtk_widget_show calls 2017-01-22 14:38:21 +01:00
Timm Bäder
e08918cce0 actionbar: Notify when :revealed changes 2017-01-12 15:14:25 +01:00
Timm Bäder
3d5a62a0c9 actionbar: Add revealed property
So we can show and hide it with a transition as well as bind another
property to it.
2017-01-08 14:57:11 +01:00
Timm Bäder
48d5f7843b actionbar: Add revealer as internal child 2017-01-08 10:49:06 +01:00
Timm Bäder
12c2274750 actionbar: Remove show() and hide() implementations
They only show/hide the widget in a delayed fashion which doesn't
work, just like it doesn't work with infobars and popovers.
2017-01-08 10:46:26 +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
Benjamin Otte
4c9033b62d snapshot: Port GtkActionBar 2016-11-15 17:48:45 +01:00
Benjamin Otte
da207c9fdd snapshot: Add a snapshot function to GtkCssCustomGadget 2016-11-15 17:48:45 +01: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
Emmanuele Bassi
2e0d3ef866 gtk: Port GtkActionBar to render nodes 2016-10-18 11:49:12 +01:00
Timm Bäder
f45dadadd0 box: Remove 'padding' child property 2016-10-16 18:17:21 +02:00
Timm Bäder
6bc096d748 actionbar: Remove unnecessary map/unmap implementations
These just do what the default implementations do anyway.
2016-02-04 13:32:34 +01:00
Matthias Clasen
0bf987c611 actionbar: Don't expose implementation details
The box and revealer here should not be exposed as internal
children for subclasses to use in their .ui files.
2016-01-28 22:39:31 -05:00
Benjamin Otte
402cecf9a2 actionbar: Don't forall() widgets twice
When using forall(), only list the revealer, which lists the box
containing all the children. When using foreach(), bypass revealer and
box and list all children added to the box.
2016-01-19 03:45:26 +01:00
Matthias Clasen
a3fd5a010b Simplify actionbar
We don't need a frame widget here, just render a top border on the
box.
2015-12-18 22:57:16 -05:00
Matthias Clasen
90109cfe4c actionbar: Convert to gadgets
This is a nice example of a trivial container conversion.
2015-12-15 08:41:16 -05:00
Timm Bäder
88b4955fd9 GtkBox: The center widget can be NULL
Propagates to GtkActionBar.
2015-12-01 13:41:35 +01:00
Matthias Clasen
d634403d91 actionbar: Add an element name to the css node
This lets us avoid hardcoding the type in CSS.
2015-10-29 07:08:15 -04:00
Benjamin Otte
6379a425b0 actionbar: Remove get_path_for_child implementation
It wasn't used because CSS walks the widget->parent chain, so it'd only
ever call this func for priv->revealer.
2015-07-08 05:48:59 +02:00
Matthias Clasen
fc855eea7a GtkActionBar: Make ::position writable 2014-11-11 23:02:11 -05:00
Matthias Clasen
047bb15cd7 GtkActionBar: Rename center_box to box 2014-11-11 23:01:16 -05:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
215c55f2b9 GtkActionBar: Implement destroy
Similar to map/unmap, this needs to follow the actual
widget tree. Without this, several test cases in
the templates test fail.
2014-02-19 01:34:19 -05:00
Matthias Clasen
5eaebde394 Add map/unmap to GtkActionBar
The recursion in map needs to follow the actual physical
widget tree, otherwise we violate invariants. The generic
container map implementation uses gtk_container_forall to
operate on the children, and thus is not suitable for
containers where the children are inside some internal
container.
2014-02-18 22:50:37 -05:00
Matthias Clasen
3f0e28133d Fix up gtk_action_bar_forall
We need to always iterate over non-internal children.
2014-02-18 22:50:37 -05:00
Matthias Clasen
53f6b8582a Revert "action bar: remove the forall implementation"
This reverts commit 0ff0fdfefb.
2014-02-18 22:50:37 -05:00
Matthias Clasen
0ff0fdfefb action bar: remove the forall implementation
With nested internal children, this interferes with proper
cleanup, and makes the templates test fail.
2014-02-17 21:39:44 -05:00
Matthias Clasen
ef565e2713 action bar: Use a regular box instead of GtkCenterBox
GtkBox now supports a centered child, so GtkCenterBox is
no longer needed here.
2014-02-16 23:02:54 -05:00
William Jon McCann
d0a654e4b9 Add new ActionBar
https://bugzilla.gnome.org/show_bug.cgi?id=723929
2014-02-12 08:08:03 -05:00
William Jon McCann
c86ee0558c Rename GtkActionBar to GtkCenterBox
https://bugzilla.gnome.org/show_bug.cgi?id=723929
2014-02-12 08:08:03 -05:00
Matthias Clasen
11f0813e40 GtkActionBar: Fix center widget visibility handling
This is the same fix that was applied to GtkHeaderBar
recently. Adding a child widget should not make it
visible as a side-effect.
2014-01-21 20:22:14 -05:00
Matthias Clasen
3efd0b2874 GtkActionBar: Just leave the center widget as NULL, initially
No need to construct a box that gets thrown away later.
Plus, this fixes the defaultvalue test for GtkActionBar.
2014-01-07 16:16:52 -05:00
Matthias Clasen
b39f094b21 Fix order of pack-end widgets
https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00
William Jon McCann
e72aca055d Add GtkActionBar
A widget intended to offer contextual actions for a given view.
It allows packing children into the start or end as well as offering
a single centered child box.

https://bugzilla.gnome.org/show_bug.cgi?id=721665
2014-01-07 08:46:37 -05:00