Commit Graph

385 Commits

Author SHA1 Message Date
Timm Bäder
5fd936beef spinbutton: Use increment/decrement icon names
And add list-{remove,add}-symbolic as fallback.

Fixes #1569
2019-01-11 18:29:20 +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
Ernestas Kulik
edc4b2f7d0 eventcontrollerscroll: Conditionally propagate ::scroll
Currently, gtk_event_controller_scroll_handle_event() always returns
TRUE if it is handled, which stops the propagation of the event. If
there’s a single GtkEventControllerScroll in the widget hierarchy, that
means that no others will run, depending on the propagation phase. In
Nautilus, this can be observed when adding a scroll controller to the
GtkScrolledWindow (ctrl-scrolling controls the zoom level) - either the
scrolling or the zooming breaks.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/45
2018-11-12 10:35:37 +01:00
Timm Bäder
e0a1311e5b spinbutton: Don't use gfloat in a code sample 2018-10-11 12:27:56 +02:00
Timm Bäder
8c403c43f0 spinbutton: Keep GParamSpecs around
notify_by_pspec is more efficient and this way the source file is more
in line with the others.
2018-07-05 19:08:19 +02:00
Carlos Garnacho
c5586f85fb gtkspinbutton: Use GtkEventControllerKey
And drop the ::event vfunc implementation with it.
2018-06-21 12:50:57 +02:00
Daniel Boles
e7809f43ec SpinButton: Fix an obviously wrong arg description
:climb-rate is not about what you get when you single-click on a button,
as this implied: it's what happens if you hold down a button or a key.
Fix the description of @climb_rate to new(), and while here, mention the
key in the blurb of :climb-rate itself.
2018-05-26 01:06:00 +01:00
Matthias Clasen
ec2d0edd79 spin button: Stop using ::key-release-event
Just use the generic ::event signal.
2018-05-21 20:20:43 -04:00
Timm Bäder
5ff4ef14e6 widget: Directly notify gestures of grab
Since each widget has a list of event controllers now, we don't need to
connect to ::grab-notify of the widget for every controller.
2018-05-19 10:18:50 +02:00
Benjamin Otte
74dbb057ed eventcontrollerscroll: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
4ddc94b293 multipressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
66223aaa08 swipegesture: Port to new API model 2018-04-26 17:59:41 +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
9665c4d651 spinbutton: spinbuttons aren't entries anymore
Fix a code sample to reflect that.
2018-03-27 19:09:15 +02:00
Timm Bäder
8646f9da19 spinbutton: Remove queue_resize call from realize
No reason for this to be here.
2018-03-27 19:08:50 +02:00
Timm Bäder
490abbb292 spinbutton: Fix a copy/paste bug in the docs 2018-03-27 18:25:03 +02:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Daniel Boles
41a5e744d8 SpinButton: Desensitise +/- buttons as appropriate
The logic for this in 3 got lost in the move from gadgets to widgets. We
must update the sensitivities when :wrap, :value, or the bounds change.

Close: https://gitlab.gnome.org/GNOME/gtk/issues/88
2018-03-17 15:53:50 +00:00
Timm Bäder
afffc696f4 spinbutton: Remove an unnecessary queue_draw call
This is done automatically in case the spinbutton value actually
changes.
2018-03-15 09:44:49 +01:00
Timm Bäder
00d37c80f8 spinbutton: Remove priv pointer 2018-03-09 09:24:20 +01:00
Timm Bäder
83c74ff7d0 spinbutton: Fold function into only caller 2018-02-27 10:30:14 +01:00
Timm Bäder
7c59ac2e4a spinbutton: Remove unused macro 2018-02-27 10:30:14 +01:00
Benjamin Otte
f08bc40fbb a11y: Don't include gtk.h
Also add missing includes and sort them for all the widgets that relied
on that before.
2018-02-08 15:25:53 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Emmanuele Bassi
c655759cef Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Matthias Clasen
5cb1c606bb spin button: Stop using ::focus-out-event
Just use the generic ::event signal.
2018-01-16 14:14:10 -05:00
Daniel Boles
fecce75c73 SpinButton: Explain meaning of nullable Adjustment
configure() marked the @adj argument as (allow-none) but did not explain
what passing NULL would do. Fix that, and move it to (nullable) as well.
2017-11-22 20:58:28 +00:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -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
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Carlos Garnacho
27a391bad8 gtkspinbutton: Remove motion notify handler
It does nothing nowadays.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
ad05caedd3 gtkspinbutton: Use scroll event controller 2017-09-19 18:40:50 +02:00
Carlos Garnacho
e2eb20208b spinbutton: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Timm Bäder
d31621256d spinbutton: Fix css node docs 2017-07-19 21:27:16 -04:00
Timm Bäder
bd446c48e9 spinbutton: expand the entry
It's supposed to fill the entire spinbutton allocation apart from the
buttons
2017-07-19 21:27:16 -04:00
Timm Bäder
348871d9fc Fix a few testsuite failures
Adjust default property values, skip GtkRange:adjustment.
2017-07-19 21:27:16 -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
c4f6cea111 fix a few documentation problems 2017-07-19 21:27:15 -04:00
Timm Bäder
f1813e8f88 spinbutton: Fix gesture state
We claimed the gesture previously to keep it from propagating to the
underlying entry, but now that the entry is in a box with the two
buttons, we can do this properly and restore the previous long-press
behavior.
2017-07-19 21:27:14 -04:00
Timm Bäder
70d90a9923 spinbutton: Remove unused import 2017-07-19 21:27:14 -04:00
Timm Bäder
a0ebad70cd spinbutton: Fix property notification 2017-07-19 21:27:14 -04:00
Timm Bäder
121cf9c78c spinbutton: Add docs for new public API 2017-07-19 21:27:13 -04:00
Timm Bäder
218e0b9929 spinbutton: Use 0 as default for (max-)width-chars
This mimics the old spinbutton size request better.
2017-07-19 21:27:13 -04:00
Timm Bäder
9ab43dfe9e spinbutton: Add accessors for (max-)width-chars 2017-07-19 21:27:12 -04:00
Timm Bäder
6aa9ca7b55 spinbutton: Fix activation 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
f736b071b4 spinbutton: Add text property 2017-07-19 21:27:11 -04:00
Timm Bäder
3c2d2545b2 spinbutton: Inherit from GtkWidget
Use a box, an entry and the current 2 buttons.
Remaining problems: Entry sizing and activation.
2017-07-19 21:27:11 -04: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
a919f0c7f3 spinbutton: Add undershoot nodes to CSS docs 2017-04-24 16:24:32 +02:00