summaryrefslogtreecommitdiff
path: root/gtk/gtkswitch.c
Commit message (Collapse)AuthorAgeFilesLines
* GtkSwitch: fix a reentry issueMatthias Clasen2015-07-011-2/+2
| | | | | | | The introduction of state broke some users which relied on being able to set active in a notify::active handler. https://bugzilla.gnome.org/show_bug.cgi?id=751754
* switch: add a style property for the switch heightCosimo Cecchi2015-06-301-5/+19
| | | | | | | Instead of hardcoding an aspect ratio. This will be replaced by min-height/max-height when we have them. https://bugzilla.gnome.org/show_bug.cgi?id=751689
* Stop using GDK_POINTER_MOTION_HINT_MASK in widgetsMatthias Clasen2015-03-221-1/+0
| | | | | | It is deprecated and no longer needed, and,as observed in https://bugzilla.gnome.org/show_bug.cgi?id=746253 it interferes with turning off event compression.
* gtkswitch.c: Fix Build on C89 CompilersChun-wei Fan2015-03-031-1/+1
| | | | | | This file now uses round(), which was not available until C99, so include fallback-c89.c instead of math.h, which includes math.h and does a fallback implementation of round().
* switch: Have a priv varibale in the constructorBenjamin Otte2015-02-161-4/+6
|
* switch: Change handle_x to handle_posBenjamin Otte2015-02-161-41/+16
| | | | | | | | Make that variable go from 0.0 to 1.0 where 0.0 means inactive (slider is on the left) and 1.0 means active (slider is on the right). The math is simpler that way and most importantly the value is independent of size.
* switch: Get rid of offset member variableBenjamin Otte2015-02-161-15/+15
| | | | We can compute it on-demand whereever we need it.
* switch: Remove unused variables from private structBenjamin Otte2015-02-161-2/+0
|
* switch: Use trough style class by defaultBenjamin Otte2014-10-131-5/+9
| | | | This allows animating the trough, and saves a save/restore pair.
* switch: Set PRELIGHT state on widgetBenjamin Otte2014-10-131-5/+2
|
* GtkSwitch: Use gtk_widget_add_tick_callbackMatthias Clasen2014-09-231-11/+11
| | | | | This api automatically takes care of dealing with disappearing frame clocks, which we currently forget to and pay with crashes.
* widget: Make _gtk_set_simple_clip() take an optional content clipBenjamin Otte2014-08-211-1/+1
|
* GtkSwitch: Initialize offset when beginning animationMatthias Clasen2014-08-041-0/+1
| | | | | | handle_x always corresponds to the visible position of the handle, which is where we want to start the animation. Without this, repeated keyboard activation will not always animate.
* GtkSwitch: Update handle_x in size-allocateMatthias Clasen2014-08-041-0/+5
| | | | | | | | Since we are storing positions here that depend on the allocation, we need to update them in size-allocate. This fixes incorrect positioning of the handle if the switch is active initially. https://bugzilla.gnome.org/show_bug.cgi?id=734213
* GtkSwitch: Don't store dest_offsetMatthias Clasen2014-08-041-11/+12
| | | | | | Instead, calculate it on the spot in the tick callback, and update handle_x in gtk_switch_set_active, based on the new active property.
* GtkSwitch: End animations on finalizeMatthias Clasen2014-08-041-0/+9
| | | | | Handle the unlikely case that a switch gets finalized while its toggle animation is running.
* GtkSwitch: End animation in set_activeMatthias Clasen2014-08-041-1/+2
| | | | | End any running toggle animation before setting the set, otherwise things get confused.
* GtkSwitch: Also animate for keyboard activationMatthias Clasen2014-08-041-3/+1
|
* GtkSwitch: implement animationPaolo Borelli2014-08-031-7/+96
|
* GtkSwitch: remove unused assignmentPaolo Borelli2014-08-031-3/+0
|
* GtkSwitch: implement clippingMatthias Clasen2014-07-181-0/+3
| | | | | | So switches can have shadows, too. https://bugzilla.gnome.org/show_bug.cgi?id=733360
* gtkswitch: Fix docsJasper St. Pierre2014-06-291-0/+1
|
* GtkSwitch: Implement hover for GtkSwitchMatthias Clasen2014-06-211-2/+13
| | | | | This makes switches more similar to other activatable widgets like buttons or scales.
* GtkSwitch: Use G_PARAM_EXPLICIT_NOTIFYMatthias Clasen2014-06-091-2/+2
|
* gtk: Update GtkGesture users to the GtkPropagationPhase semantics changeCarlos Garnacho2014-05-271-2/+2
| | | | | | Mainly doing s/TARGET/BUBBLE/ on the fully ported widgets, but GtkTreeView where the double click handler has moved to GTK_PHASE_TARGET so it runs parallelly to the still existing event handlers.
* gesture: Replace gtk_gesture_attach/detach with event controller APICarlos Garnacho2014-05-271-2/+7
| | | | | | | | Event controllers now auto-attach, and the GtkCapturePhase only determines when are events dispatched, but all controllers are managed by the widget wrt grabs. All callers have been updated.
* gtk: Update callers of GtkGesturePan orientationCarlos Garnacho2014-05-271-1/+1
|
* switch: Use GtkGesture to handle input eventsCarlos Garnacho2014-05-231-137/+118
| | | | | | A pan gesture is used to handle switch dragging, which is only triggered by horizontal panning movements. A multipress gesture handles the cases where clicking without dragging happens, just toggling the switch.
* switch: don't use focus-line-widthCosimo Cecchi2014-05-091-21/+7
|
* switch: don't use focus paddingCosimo Cecchi2014-05-091-15/+9
|
* switch: Remove unneeded checksBenjamin Otte2014-05-011-10/+4
| | | | | Size vfuncs always get non-null out variables passed, so no need to check for NULL.
* switch: Add a delayed state capabilityMatthias Clasen2014-04-061-12/+142
| | | | | | | | This commit makes it possible for GtkSwitch to indicate when the underlying state changes with a delay, causing the switch to temporarily go 'out of sync' with the underlying change. https://bugzilla.gnome.org/show_bug.cgi?id=725648
* docs: use Returns: consistentlyWilliam Jon McCann2014-02-191-2/+2
| | | | Instead of Return value:
* docs: use proper quotesWilliam Jon McCann2014-02-051-2/+2
|
* a11y: Remove default description from GtkSwitchAlejandro Piñeiro2013-09-121-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=707926
* Move wholly deprecated classes to gtk/deprecated/Matthias Clasen2013-07-191-2/+2
| | | | | | | | | | | | | | | | | | We've recently a number of classes wholly. For these cases, move the headers and sources to gtk/deprecated/ and adjust Makefiles and includes accordingly. Affected classes: GtkAction GtkActionGroup GtkActivatable GtkIconFactory GtkImageMenuItem GtkRadioAction GtkRecentAction GtkStock GtkToggleAction GtkUIManager
* gtk: Use new macros for defining private dataEmmanuele Bassi2013-07-091-3/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=702996
* Deprecate GtkAction and GtkUIManagerWilliam Jon McCann2013-06-301-0/+21
| | | | It is recommended to use GAction et al and GtkBuilder.
* GtkSwitch: Don't handle events from extra mouse buttonsBastien Nocera2013-05-181-12/+20
| | | | | | | Also use GDK_EVENT_{STOP,PROPAGATE} to make return values clearer. https://bugzilla.gnome.org/show_bug.cgi?id=696640
* GtkSwitch: moved focus drawing from outside border inside the handle.Juan Pablo Ugarte2013-04-161-19/+21
|
* Add gtk_widget_(un)register_windowAlexander Larsson2013-02-071-2/+2
| | | | | | | | | | | | This replaces the previously hardcoded calls to gdk_window_set_user_data, and also lets us track which windows are a part of a widget. Old code should continue working as is, but new features that require the windows may not work perfectly. We need this for the transparent widget support to work, as we need to specially mark the windows of child widgets. https://bugzilla.gnome.org/show_bug.cgi?id=687842
* switch: Remove hack to change text sizeBenjamin Otte2012-12-061-20/+0
| | | | | | The same effect can now be achieved via .switch { font-size: smaller; } so there is no need to hardcode things.
* port GtkSwitch to GtkActionHelperRyan Lortie2012-08-201-92/+15
|
* css: Remove old animation codeBenjamin Otte2012-04-171-11/+0
| | | | | | | | Deprecate public API where appropriate and make it no-ops. Remove all calls to it. Get rid of the 'transition' css property. For now, this means spinners don't animate anymore.
* switch: Set ACTIVE state flag with is_active propertyBenjamin Otte2012-04-171-26/+8
|
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* Rename gtk_application_window_get_observerRyan Lortie2012-01-111-12/+8
| | | | | | | | This should have been called _create_observer https://bugzilla.gnome.org/show_bug.cgi?id=667394 Fixup switch
* GtkSwitch: Implement GtkActionableMatthias Clasen2012-01-111-1/+164
|
* GtkSwitch: Return FALSE from the button press handlerMatthias Clasen2011-08-231-3/+3
| | | | | | | | This makes the behavior identical to other widgets which handle button presses, and it avoids problems when placing switches into a windows main toolbar. https://bugzilla.gnome.org/show_bug.cgi?id=656986
* Make focus rectangles optionalMatthias Clasen2011-08-101-1/+1
| | | | | | | | | | | | | | | | | | This commit introduces a new setting, gtk-visible-focus, backed by the Gtk/VisibleFocus X setting. Its three values control how focus rectangles are displayed. 'always' is equivalent to the traditional GTK+ behaviour of always rendering focus rectangles. 'never' does what it says, and is intended for keyboardless situations, e.g. tablets. 'automatic' hides focus rectangles initially, until the user interacts with the keyboard, at which point focus rectangles become visible. https://bugzilla.gnome.org/show_bug.cgi?id=649567