Matthias Clasen
b93631164f
Remove lots of focus vfuncs
...
In many cases, the default widget vfuncs work just fine,
combined with setting focusable.
2020-05-11 00:11:37 -04:00
Matthias Clasen
25826eafe3
frame: Derive from GtkWidget
...
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore. This requires
us to move get_request_mode and compute_expand down.
See #2681
2020-05-04 17:01:18 -04:00
Matthias Clasen
7f975472a7
frame: Add a child property
2020-05-04 17:01:18 -04:00
Matthias Clasen
130ae89e54
frame: Fix xalign handling
...
SEtting a nonzero xalign on frames had no
effect, since we were always using the full
allocation with here, instead of what the label
needs. Found by using testframe for a second.
2020-05-04 07:37:31 -04:00
Matthias Clasen
77cf6cd406
frame: Don't queue a resize if xalign changes
...
We only need to allocate children in this case.
While we touch it, rewrite the setter to modern
style.
2020-05-04 07:37:25 -04:00
Matthias Clasen
b55195fa2e
Move the idle sizer to GtkWindow
...
This was only living in gtkcontainer.c for historic
reasons. Move it closer to where it belongs, and
rename it from 'idle' to 'layout', since it is
really about the layout phase of the frame clock,
nowadays.
2020-04-20 16:30:45 -04:00
Matthias Clasen
edae2a8dc5
frame: Drop shadow-type
...
Frames that don't draw frames are not very useful,
so just drop the shadow-type property.
2020-04-17 10:57:36 -04:00
Timm Bäder
655711fef2
Rename gtk_widget{get,set,has}_style_class to _css_class
...
We want to use css instead of style everywhere now.
2020-02-07 13:16:45 -05:00
Timm Bäder
b7ee2cbc28
Start using GtkWidget's new style class API
2020-02-07 13:16:32 -05:00
Benjamin Otte
af6128b3ab
Remove gtkwidgetpath.h include where no longer needed
2020-01-28 02:17:02 +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
Benjamin Otte
9c0acf62b4
widget: Allow adding event controllers in ui files
2018-04-26 17:59:41 +02:00
Timm Bäder
172b0e7ea0
frame: Use underscores in widgets ids in the docs
...
They will work in composite widget templates this way.
2018-04-15 17:12:01 +02:00
Timm Bäder
bf08537885
frame: Remove priv pointer
2018-04-15 17:12:01 +02:00
Timm Bäder
be77e0d500
frame: Stop saving label and child allocation
...
We don't use them for anything anymore.
2018-04-15 17:12:01 +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
Daniel Boles
e4578ca7bf
Frame: Erase the now-useless property label-yalign
...
The border is now drawn on the frame node, not using an internal border
node, so we are no longer able to align the label to vertically overlap
the border. The property no longer performs its original purpose, & nor
is it a useful candidate for giving a new role, so no point keeping it.
https://bugzilla.gnome.org/show_bug.cgi?id=778886
2018-03-12 14:17:32 +00:00
Timm Bäder
93df23d962
Remove some more gtk_widget_get_content_size uses
2017-12-04 12:42:52 +01:00
Matthias Clasen
ffd6baec42
gtk: Intern css names
...
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Daniel Boles
252b03c43e
Frame: Enhance CSS docs
...
Indicate how the old shadow types are replaced by CSS border-style et
al., and quote the names of nodes and classes for easier readability.
2017-10-02 19:50:02 +01:00
Daniel Boles
ac4faad8a2
Frame: Add missing fixed-width format to enums
2017-09-14 18:29:08 +01: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
c2abb698be
Replace a few get_content_allocation calls with get_content_size
...
The position of the content allocation is almost never relevant since
it's 0/0 for measure, size_allocate and snapshot.
2017-07-19 21:27:14 -04:00
Timm Bäder
d3beea2c3d
frame: Fix child allocation
...
Don't add the parent's allocation from gtk_widget_get_allocation
2017-07-19 21:27:13 -04:00
Timm Bäder
671c5ac434
frame: Fix copy&paste bug in shadow-type handling
...
If the given shadow_type is none NONE, we have to remove the .flat style
class of course, not add it.
2017-07-19 21:27:12 -04:00
Timm Bäder
78b497bd7a
frame: Remove empty finalize implementation
2017-07-19 21:27:11 -04:00
Timm Bäder
c6cc314905
frame: Remove gadget
2017-07-19 21:27:11 -04:00
Timm Bäder
90537a5e04
frame: Remove css box drawing
2017-07-19 21:27:11 -04:00
Daniel Boles
ce1098598d
Frame: Don’t advise adding .flat class in code
...
https://bugzilla.gnome.org/show_bug.cgi?id=779653#c33
and this is closer to what gtk-3-22 says anyway.
2017-05-14 11:53:25 +01:00
Timm Bäder
bbe5385541
frame: Properly initialize clip
...
GtkCssGadget initializes the content clip to {0, 0, 0, 0}, so we can't
just union the child clip with it.
2017-04-28 11:27:09 +02:00
Timm Bäder
179b8b0cbc
Fix gdk_rectangle_union calls
...
Turns out that the destination is the last parameter, not the first one.
This fixes the flickering in the first page of the widget-factory when
using the expander on page 2.
2017-04-28 11:27:09 +02:00
Timm Bäder
b01b5267bb
frame: Compute clip directly
2017-04-25 20:30:37 +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
Daniel Boles
24b966f6e7
Frame: minor update to intro docs
...
This incorporates a couple of recent tweaks from gtk-3-22.
2017-03-06 07:25:08 +00:00
Daniel Boles
e0b70f3629
Frame—Note set_label always destroys :label-widget
...
The fact that it doesn’t reuse the existing GtkLabel if present is not
immediately obvious to users (or is it just me?), so clarify that the
pre-existing :label-widget, if any, is always removed and replaced.
2017-02-21 21:26:43 +00:00
Daniel Boles
b106c5e4d5
Frame—Clarify relationship of :shadow-type & .flat
2017-02-21 21:26:41 +00:00
Daniel Boles
b953710fd7
Frame: Explain the .flat style class
2017-02-19 17:19:08 +00:00
Alexander Larsson
7bee22bcb6
Avoid some more type checks for internal calls
2017-01-11 15:27:51 +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
3f75b11982
frame: Implement snapshot()
2016-12-20 18:01:12 +01:00
Piotr Drąg
a2da4ddceb
Use Unicode in translatable strings
...
See https://developer.gnome.org/hig/stable/typography.html
https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Benjamin Otte
96a94fc21d
frame: Remove the border node
...
It does weird clipping that
(a) nobody likes
(b) is hard to support in the new rendering world.
So we take the easy way out.
The actual frame is now drawn by the frame node around the label.
2016-12-19 05:36:06 +01:00
Timm Bäder
ac20c3eb22
frame: Use gtk_widget_measure to measure child sizes
2016-12-04 12:00:46 +01:00
Benjamin Otte
82eb223c58
Revert "GtkFrame: Convert to indirect rendering"
...
This reverts commit a0b2b3745f
.
Frames cannot be rendered by GSK yet, because they do clipping.
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
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
b2a0105234
frame: Get the render node from the gadget
...
So we get a proper css background etc. applied.
2016-10-28 19:33:47 +02:00
Timm Bäder
8c128f36c5
frame: Use measure() to measure label size
2016-10-28 16:33:02 +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
Timm Bäder
00e7c69044
frame: Remove unused constants
2016-10-20 20:12:05 +02:00