Commit Graph

394 Commits

Author SHA1 Message Date
Carlos Garnacho
d491e49fd6 gtk: s/gdk_event_free/g_object_unref/ 2017-12-14 01:05:48 +01:00
Matthias Clasen
05fbd32c4d button: Add private api to get at the gesture
Attaching another gesture from the outside does not
work currently, so let widgets share their button's
gesture for now.
2017-12-12 22:18:19 -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
Matthias Clasen
dbfaa99107 image: Remove icon-size argument from icon setters
Instead, add a function gtk_image_set_icon_size() for the cases where
overriding the icon size is necessary.

Treat icon sizes the same way as pixel sizes, too. So gtk_image_clear()
no longer unsets the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
049cc6aa01 image: Change getters
Instead of returning the icon size with them, make
gtk_image_get_icon_name() and gtk_image_get_gicon() only return the icon
itself.

As a benefit, we can turn them into regular getters that return values
instead of requiring out parameters.

Instead, provide gtk_image_get_icon_size() to query the icon size.
2017-11-15 14:22:17 -05:00
Benjamin Otte
f53b72e5ff button: Get rid of icon size
In fact, make gtk_button_new_from_icon_name() just set the icon-name
property instead of creating a GtkImage.
2017-11-15 14:22:16 -05:00
Benjamin Otte
b6e0c9392a button: Use gtk_widget_contains() 2017-11-01 20:50:33 +01:00
Benjamin Otte
9b0d9aa7a6 wayland: Remove unused variable 2017-11-01 20:09:06 +01:00
Benjamin Otte
44614394e6 widget: Turn screen-changed signal into display-changed 2017-10-31 00:43:11 +01:00
Matthias Clasen
acb12e1198 button: Fix label alignment in checks and radios
Yes, this is ugly, but the alternative is broken ui.
2017-10-06 22:32:53 -04:00
Carlos Garnacho
9d5c04012e gtkbutton: Remove enter/leave event handlers
They just maintain priv->in_button and widget state up-to-date, this
basically matters during user interaction, and is already maintained
in the gesture ::update handler. This seems to be sufficient.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
fac9ba0fff button: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Timm Bäder
36c4582086 button: Stop fiddling with PRELIGHT state
This is done automatically now and it's wrong here since it gets
executed after gesture release.
2017-08-01 18:16:40 +02: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
1dd716e66f button: Reset in_button state in unmap
Since at that point the point is clearly not in the button anymore.
2017-07-19 21:27:15 -04:00
Timm Bäder
a4d2da76b3 button: Fix in_button checks
The gesture coords are relative to the button's origin, so use
gtk_widget_get_own_allocation to check if the coords are inside the
button.
2017-07-19 21:27:14 -04:00
Timm Bäder
b344267e6c button: Don't care about sizing if no child is set
We don't need to care in this case since the default values should
always be assumed to be 0, and setting a baseline of 0 is just wrong
when orientation == HORIZONTAL, it should be -1 (or unset).
2017-07-19 21:27:13 -04:00
Timm Bäder
28b18129b5 button: Remove gadget 2017-07-19 21:27:12 -04:00
Timm Bäder
6c484ca4f3 button: Remove gadget usage
Can't remove it entirely yet, since GtkCheckButton still uses it
2017-07-19 21:27:11 -04:00
Timm Bäder
aa5f90d9f5 fontbutton: Call the css node "fontbutton"
Otherwise the default looks like a button inside a button.
2017-07-19 21:27:11 -04:00
Timm Bäder
ca94c680cc button: Remove css box drawing 2017-07-19 21:27:10 -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
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
Carlos Garnacho
5836beee78 gtkbutton: Handle crossing events without the event window
The event shall no longer be "directed" to the event window, but the
widget. Getting a enter/leave event is enough now to know whether the
pointer is inside or outside the widget.
2017-05-25 16:25:58 +02:00
Timm Bäder
b97b8b6ec1 button: Compute clip directly 2017-04-28 11:27:08 +02:00
Timm Bäder
548f6138ef Add a few missing (nullable) annotations 2017-02-17 18:23:01 +01:00
Timm Bäder
3fb4b079e1 button: Don't explicitly show child widgets 2017-01-20 21:50:02 +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
Matthias Clasen
0a75bb4353 Work towards a clean docs build
Remove various no-longer-existing functions from the sections
file, and exclude more private headers, etc.
2016-11-18 14:43:34 -05:00
Benjamin Otte
ab47479045 snapshot: Convert GtkButton and subclasses 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
3b970f4555 button: Remove _get_event_window 2016-11-05 11:56:36 +01:00
Timm Bäder
773c16076b widget: Remove state-flags leftovers 2016-11-02 18:40:00 +01:00
Benjamin Otte
32a5729d18 gtk: Chain up in realize()
... instead of copy/paste from gtk_widget_real_realize.
2016-11-02 07:16:08 +01:00
Timm Bäder
d7df491656 button: show() the image in gtk_button_new_from_icon_name 2016-10-31 12:23:27 +01:00
Rico Tzschichholz
471d8d6184 Remove deprecated GTK_RELIEF_HALF 2016-10-23 18:23:58 +02:00
Timm Bäder
38f2290479 button: Add Since annotations to icon-name setter/getter 2016-10-22 21:02:34 +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
f65af48d51 button: Fix icon-name implementation 2016-10-20 20:12:05 +02:00
Timm Bäder
f989281b38 button: Remove grab_time
Unused.
2016-10-20 20:12:05 +02:00
Matthias Clasen
9d06ee637b button: Restore focus
The custom gadget draw function has the side effect of informing
the gadget machinery wether to draw focus or not. Bring the
draw function back, just for its boolean return value. We may
want to find a better solution for this.
2016-10-18 11:49:12 +01:00
Matthias Clasen
1d5e05b0d1 button: Convert to indirect rendering
WARNING! This commit breaks GtkButton subclasses.
2016-10-18 11:49:11 +01:00
Timm Bäder
be2f19663b button: Add icon-name property
Remove the old-style button construction that allowed to show both an
icon and a label and change visibility based on a GtkSetting.
2016-10-18 00:29:19 +02:00
Timm Bäder
7e16396cc5 button: Stop implementing GtkActivatable 2016-10-18 00:29:18 +02:00
Timm Bäder
05211d200f button: Stop checking for GtkSettings:gtk-button-images setting 2016-10-18 00:29:18 +02:00
Benjamin Otte
31b5ba5bad button: Use gdk_window_new_input() 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
Timm Bäder
10e24d58c3 button: Remove _{get,set}_focus_click
Deprecated for the GtkWidget variant. Also remove some unused fields
from the GtkButtonPrivate struct.
2016-10-16 18:17:21 +02:00
Timm Bäder
10a92a210b button: Remove deprecated style properties 2016-10-16 18:17:21 +02:00
Timm Bäder
9f2ca684e2 button: Remove deprecated signals from public API 2016-10-16 18:17:21 +02:00