Commit Graph

173 Commits

Author SHA1 Message Date
Matthias Clasen
d3c45cb979 docs: Miscellaneous doc fixes
Additions and correction all over the place,
in GDK and GTK docs.
2019-02-24 16:53:12 -05:00
Timm Bäder
359d874ddb Use g_clear_pointer to unparent widgets 2018-11-13 20:53:14 +01:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Timm Bäder
96e465b6d9 checkbutton: Remove snapshot implementation
It just does when the default GtkWidget implementation does anyway:
snapshot all child widgets
2018-08-25 08:05:52 +02:00
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Timm Bäder
67258c69f0 checkbutton: Don't reorder non-existent indicator widget 2018-02-26 18:23:20 +01:00
Matthias Clasen
b379ca3e02 check button: Fix inconsistent state
This has been broken since the inconsistent state
was moved here in 2aea8dfee9.
2017-12-25 11:36:39 -05:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Timm Bäder
8b0f60bb6f checkbutton: Destroy indicator widget when draw-indicator is FALSE 2017-10-29 13:27:03 +01:00
Matthias Clasen
fb8589671d Drop unused includes of gtkrender.h
We don't use the gtk_render apis internally anymore.
Drop these includes so it is clear where the remaining
uses are.
2017-10-25 21:46:46 -04:00
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
4f0140fa6c Remove GtkBuiltinIcon
Now unused.
2017-07-19 21:27:13 -04:00
Timm Bäder
efd7b38abc checkbutton: stop using gadgets 2017-07-19 21:27:13 -04:00
Timm Bäder
720bb9eede checkbutton: Don't draw a focus ring
GtkWidget does it for us now.
2017-07-19 21:27:12 -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
b4e26e686d checkbutton: Don't use parent button's gadget
check buttons showing their indicator still use the internal boxgadget
and have therefore the wrong size, but this gets us closer.
2017-07-19 21:27:11 -04:00
Carlos Garnacho
eaa17b2548 gtkbutton: Make windowless
It is no longer necessary to receive events, so it's relatively straightforward
now to drop.
2017-05-25 16:25:59 +02:00
Timm Bäder
91932ffbc7 button: Remove baseline_align value
It's unused.
2017-05-05 11:18:05 +02:00
Timm Bäder
2aea8dfee9 togglebutton: Move :inconsistent to GtkCheckButton 2017-01-30 18:11:00 +01:00
Timm Bäder
66d584ce6e togglebutton: Move :draw-indicator property to GtkCheckButton
It's not used in GtkToggleButton at all, only in GtkCheckButton and
GtkRadioButton.
2017-01-30 18:11:00 +01:00
Benjamin Otte
ab47479045 snapshot: Convert GtkButton and subclasses 2016-11-15 17:48:45 +01:00
Matthias Clasen
793f843b08 check button: Update for new box gadget functionality
The box gadget now does the render node conversion for
all its children, so we have less work to do.
2016-11-01 14:29:25 -04: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
Timm Bäder
2e32655ccd checkbutton: Remove unused constants 2016-10-20 20:12:05 +02:00
Matthias Clasen
6a1edb0960 GtkCheckButton: Convert to indirect rendering
This is another example of indirect rendering with a box gadget.
There is currently still some positioning problem with the
checkmark.
2016-10-18 11:49:13 +01:00
Emmanuele Bassi
9bb816f8ee gtk: Include the appropriate headers 2016-10-17 11:10:14 +01:00
Timm Bäder
999d45b4e8 Remove various unused style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
601839c825 Remove various sizing related style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
485d1b9835 Button: Remove alignment API 2016-10-16 18:17:21 +02:00
Benjamin Otte
a72c4576b2 cssimagebuiltin: Remove icons that don't draw anything anymore 2016-05-03 12:59:13 +02:00
Matthias Clasen
2148708917 box gadget: Redo expand flag handling
We only keep one align flag per child, so it seems odd to
keep separate h/v expand flags. Just keep one expand flag
and interpret it according to orientation. Allow setting
the expand flag for child widgets too, though, so we can
make widget expand without interfering with the recursive
widget expand flag.

Update all callers.

Use the new possibility of expanding child widgets to make
the label of check and radio buttons expand. This fixes
unexpected behavior of these widgets in RTL in some places.

https://bugzilla.gnome.org/show_bug.cgi?id=765742
2016-04-28 21:59:34 -04:00
Matthias Clasen
8bf148b006 check button: Reverse alignments in RTL
Flip alignments for the box gadget children.
2016-04-28 21:59:34 -04:00
Matthias Clasen
c48f0d6f8b check button: Reinstate rtl allocation behavior
In rtl mode, we must not just reverse the children,
but also allocate from the right. Use the newly introduced
box gadget api to achieve this.

https://bugzilla.gnome.org/show_bug.cgi?id=762945
2016-03-03 21:28:51 -05:00
Matthias Clasen
7ed1225296 check button: Draw focus again
The box gadget now has API for this; use it.
2016-02-20 10:54:48 -05:00
Matthias Clasen
a32b39c60f checkbutton: Handle rtl changes again
Now that the box gadget has api for it, use it here to
change the order of the gadgets for right-to-left.
2016-01-18 00:11:50 -05:00
Matthias Clasen
7859f8ee91 checkbutton: Use a box gadget
Now that builtin icons have a baseline, we can just use
a box gadget with baseline alignment for the indicator
and the label.
2016-01-17 21:16:33 -05:00
Matthias Clasen
ea4cff1ea4 Use convenience API that was introduced recently
Use gtk_css_gadget_set_state in all the places where we previously
were getting a node from a gadget, just to call gtk_css_node_set_state.
2016-01-13 00:19:31 -05:00
Timm Bäder
788ee466b8 button: Don't include margins in input window size
And do the same thing for GtkCheckButton

https://bugzilla.gnome.org/show_bug.cgi?id=760509
2016-01-12 21:56:44 +01:00
Matthias Clasen
e8ba058396 checkbutton: Update state initially
Without this, the check node starts out without the :dir(ltr)
state, at least.
2015-12-28 10:24:02 -05:00
Matthias Clasen
9ac80c2510 checkbutton: stop saving cairo state
GtkBuiltinIcon now does this on its own.
2015-12-20 01:04:13 -05:00
Matthias Clasen
c0683d9267 checkbutton: Fix regression from builtin icon
The leaking of cairo transforms from builtin icon drawing
was causing the label to be drawn at the wrong position.
2015-12-19 23:23:09 -05:00
Benjamin Otte
36653bea41 checkbutton: Use a builtin icon
Also, add support to uiltin icons to look up the default size from a
style property.
2015-12-16 19:55:50 +01:00
Matthias Clasen
0291978acc check button: Deprecate indicator-size
CSS min-width/min-height can do just the same. We still fall
back to the indicator-size style property if the CSS properties
are not set.
2015-12-16 13:11:24 -05:00
Matthias Clasen
bb67a06bd6 check button: Deprecate and ignore ::indicator-spacing
This can be done just as well with CSS margins, so
do that instead for Adwaita.
2015-12-16 12:27:53 -05: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
d891bb815b checkbutton: Remove dead code 2015-12-15 08:41:16 -05:00
Matthias Clasen
a52c3a3db9 radiobutton: Port radio buttons to gadgets
This was already mostly done by inheritance from GtkCheckButton.
To complete it, stop using the draw_indicator vfunc for radio
buttons, and instead make the indicator gadget draw either a
check or radio.
2015-12-15 08:41:16 -05:00
Matthias Clasen
233179d374 check button: Convert to gadgets
Use a gadget for the button, and for the indicator.
A complication here is that GtkCheckButton (and
GtkRadioButton) have a totally different appearance
depending on the ::draw-indicator property. If an
indicator is not required, we just reuse the
GtkButton gadget.
This mostly works; some minor sizing issues left, e.g. cranking
up the indicator-size causes the checkbutton grid in testgtk
to overlap.
2015-12-15 08:41:16 -05: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
Timm Bäder
2182fe7d9d Don't pass widget state flags to GtkStyleContext API 2015-11-22 17:11:35 +01:00