summaryrefslogtreecommitdiff
path: root/gtk/gtkswitch.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove lots of focus vfuncsMatthias Clasen2020-05-111-3/+0
| | | | | In many cases, the default widget vfuncs work just fine, combined with setting focusable.
* widget: Add a :focusable propertyMatthias Clasen2020-05-101-1/+1
| | | | | | | | | | Add back a property that determines whether an individual widget will accept focus or not. :can-focus prevents the focus from ever entering the entire widget hierarchy below a widget, and :focusable just determines if grabbing the focus to the widget itself will succeed. See #2686
* Reinstate expected focus behaviorMatthias Clasen2020-04-091-0/+3
| | | | | | | | After the :can-focus change in the previous commit, widgets need to set suitable focus and grab_focus implementations to implement the desired focus behavior. This commit does that for all widgets.
* gizmo: Allow passing changing focus behaviorMatthias Clasen2020-04-091-1/+1
| | | | | We need this in popovers. Maybe it could be done better by defining one-off custom widgets.
* switch: Stop using a private structTimm Bäder2019-09-111-165/+137
| | | | Private type, no private struct needed.
* va_marshaller: add various va_marshallersChristian Hergert2019-06-061-0/+3
| | | | | | | | | We don't need to cover every case with a va_marshaller, but there are a number of them that are useful because they will often only be connected to by a single signal handler. Generally speaking, if I opened into a file to add a va_marshaller, I just set all of them.
* Rename GtkGestureMultiPress to GtkGestureClickMatthias Clasen2019-05-291-17/+17
| | | | | The name just made it hard for people to find the right gesture to use.
* Remove gtk_widget_get/set_has_surfaceMatthias Clasen2019-05-281-1/+0
| | | | | These serve no purpose anymore - widgets don't have surfaces, unless they're a GtkNative.
* switch: Make finalMatthias Clasen2019-05-261-1/+24
| | | | This should not be subclassed.
* gizmo: Add a contains_funcMatthias Clasen2019-04-071-1/+1
| | | | | Let GtkGizmo override the contains() implementation. Update all callers to pass NULL for the contains_func.
* Changes after reviewEmmanuele Bassi2019-03-261-3/+2
| | | | | | | | | - Rename GtkLegacyLayout to GtkCustomLayout - Use for() to iterate over children in GtkBinLayout - Whitespace fixes for code imported from GtkBox - Store the GtkLayoutChild instances inside LayoutManager - Simplify the GtkLayoutManager API by dropping unnecessary arguments - Fix the ownership model of GtkLayoutManager
* Port GtkSwitch to GtkLegacyLayoutEmmanuele Bassi2019-03-261-7/+11
|
* gtk: Check return value of compute_bounds()Benjamin Otte2019-02-201-1/+3
| | | | | Half of these calls will completely break if anybody ever uses CSS transforms with them, but hey...
* switch: Notify :state by pspecTimm Bäder2019-01-301-1/+1
|
* switch: Use iconsMatthias Clasen2019-01-241-98/+19
| | | | | This works better than glyphs, avoiding the uncertainties of font availability and fallback..
* switch: Avoid problems with glyph availabilityMatthias Clasen2019-01-231-0/+2
| | | | | | If none of the glyphs we want are available, fall back to using empty strings here, rather than causing critical warnings.
* switch: Update state labels when neededEmmanuele Bassi2019-01-181-0/+28
| | | | | | If the text style changes, or the display settings do, we need to update the state labels to ensure that the glyphs are available in the font we're using.
* Add fallback glyphs for GtkSwitch statesEmmanuele Bassi2019-01-151-2/+53
| | | | | | | | | Even though the IEC power glyphs are part of Unicode 9.0 (released in 2016) not all fonts have them. To avoid showing the hexbox of doom when the system font does not have the glyphs we'd like to use, add a fallback pair, using the old glyphs we suggested when the labels were translatable.
* Use the IEC power symbols for GtkSwitch labelsEmmanuele Bassi2019-01-111-2/+2
| | | | | | | | | | | | | | | | | | | Unicode 9.0 introduced glyps for the "on" and "off" power states, in the form of: - U+23FD POWER ON SYMBOL, or ⏽ - U+2B58 HEAVY CIRCLE, or ⭘ With `HEAVY CIRCLE` as "power off symbol" selected to avoid adding yet another circle to the standard. Since we moved GtkSwitch to always show glyphs instead of (translatable) strings, asking the localisation teams to either come up with a suitable short string to replace the English "ON" and "OFF", or to fall back to Unicode glyphs, we should ensure we're using the appropriate symbols to begin with. See also: gtk!503 for the corresponding gtk-3-24 change.
* switch: Always use I/OMatthias Clasen2019-01-101-9/+2
| | | | | This allows for smaller switches, and goes better with modern themes that have round switches.
* switch: Shorten size_allocate impl a bitTimm Bäder2018-11-271-8/+5
|
* widget: Don't pass a position to ->size_allocateTimm Bäder2018-11-131-10/+11
| | | | | The values have been 0/0 for a long time now, so just drop the GtkAllocation argument and replace it with width and height.
* multipressgesture: Port to new API modelBenjamin Otte2018-04-261-3/+2
|
* pangesture: Port to new API modelBenjamin Otte2018-04-261-3/+2
|
* widget: Remove _get_own_allocationTimm Bäder2018-04-101-4/+4
| | | | Replace all usages of it with _compute_bounds
* widget: Remove clip from size-allocate vfuncBenjamin Otte2018-04-051-9/+4
| | | | As the clip is no longer needed, get rid of it.
* Merge branch 'rename-window-to-surface' into 'master'Alexander Larsson2018-03-201-1/+1
|\ | | | | | | | | Rename window to surface See merge request GNOME/gtk!72
| * GtkWidget: Start renaming widget->windowAlexander Larsson2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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*
* | switch: Avoid a gtk_widget_get_clip callTimm Bäder2018-03-201-1/+0
|/ | | | | Since we get the correct clip anyway from the gtk_widget_size_allocate call above.
* a11y: Don't include gtk.hBenjamin Otte2018-02-081-7/+11
| | | | | Also add missing includes and sort them for all the widgets that relied on that before.
* The big versioning cleanupMatthias Clasen2018-02-061-14/+0
| | | | | | | 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.
* Rename GtkActionHelper private headerEmmanuele Bassi2018-02-021-1/+1
| | | | Follow the naming scheme for private headers.
* switch: Remove unused variableTimm Bäder2017-12-041-2/+0
|
* Remove some more gtk_widget_get_content_size usesTimm Bäder2017-12-041-3/+4
|
* gtk: Intern css namesMatthias Clasen2017-11-171-1/+1
| | | | This avoids a bunch of strdups at startup.
* switch: Use gtk_widget_contains()Benjamin Otte2017-11-011-4/+1
|
* switch: Fix int/double comparisonTimm Bäder2017-10-051-2/+2
| | | | We get a double coordinate.
* switch: Remove priv pointerTimm Bäder2017-10-011-34/+39
|
* switch: Remove some unneeded includesTimm Bäder2017-10-011-5/+0
|
* widget: Add baseline and out_clip parameters to size-allocateTimm Bäder2017-07-191-13/+10
| | | | | | | | | | | 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.
* switch: Put the slider node lastTimm Bäder2017-07-191-17/+5
| | | | | Makes sense since we draw it over both labels. Also make this obvious by using the default snapshot implementation.
* switch: Remove in_switch flagTimm Bäder2017-07-191-27/+4
| | | | | | It's pretty simple and less code to just check whether the gesture coords are inside the widget at the one place where we actually used the flag.
* switch: Fix handle dragging with padding appliedTimm Bäder2017-07-191-8/+9
| | | | | We only move the handle inside the content allocation, so we need to use the content width when calculating the new handle_pos.
* switch: Remove manual PRELIGHT codeTimm Bäder2017-07-191-2/+0
| | | | This works automatically now
* switch: Use a gizmo as sliderTimm Bäder2017-07-191-1/+2
| | | | The button was jut a stop-gap solution before GtkGizmo existed.
* switch: Remove gadgetTimm Bäder2017-07-191-64/+21
|
* switch: Remove css box drawingTimm Bäder2017-07-191-20/+5
|
* gtkswitch: Remove event windowCarlos Garnacho2017-05-251-87/+5
| | | | | | It's not necessary anymore to receive input events. The pan gesture has been set on the capture phase as the child widgets may capture during bubbling.
* gtk: Mass delete all GtkWidget event mask APICarlos Garnacho2017-05-251-7/+1
| | | | | | | | | | 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.
* switch: Update css docs to reflect current realityMatthias Clasen2017-03-311-3/+5
| | | | This should have been done when the hierarchy was changed.