Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

switchbutton: General rework #3684

Merged
merged 1 commit into from Mar 8, 2016
Merged

Conversation

peter-b
Copy link
Contributor

@peter-b peter-b commented Mar 3, 2016

  • The switchbutton now uses a "theme" property to control its
    theme. The "theme" defaults to "native", but can also be
    temporarily set to "Android" or "iOS". However, the "theme"
    is not persisted over a save, so the switchbutton will always
    look "correct" when deployed.

    This is a temporary expedient to ensure that widgets look
    correct on mobile devices and can also have their mobile
    appearance previewed in the IDE.

  • The switchbutton now uses the "hilited"/"highlight"/etc. control
    property, the same as the built-in checkbox control. It uses the
    "hiliteChanged" message to indicate that the switchbutton has
    turned on or off.

    It's currently possible to change the status of the switchbutton
    without emiting "hiliteChanged" by setting the "hilite"
    property directly. Maybe this is wrong.

  • The different Android colour themes have gone.

  • The switchbutton is now the same size in both the Android and iOS
    styles.

@peter-b
Copy link
Contributor Author

peter-b commented Mar 3, 2016

Still to do:

  • Decide if setting the hilited property should trigger a "hiliteChanged" signal
  • Maybe make it possible to customise colours

* The switchbutton now uses a "theme" property to control its
  theme.  The "theme" defaults to "native", but can also be
  _temporarily_ set to "Android" or "iOS".  However, the "theme"
  is not persisted over a save, so the switchbutton will always
  look "correct" when deployed.

  This is a temporary expedient to ensure that widgets look
  correct on mobile devices and can also have their mobile
  appearance previewed in the IDE.

* The switchbutton now uses the "hilited"/"highlight"/etc. control
  property, the same as the built-in checkbox control.  It uses the
  "hiliteChanged" message to indicate that the switchbutton has
  turned on or off.

  It's currently possible to change the status of the switchbutton
  _without_ emiting "hiliteChanged" by setting the "hilite"
  property directly.  Maybe this is wrong.

* The different Android colour themes have gone, and the
  switchbutton now uses "my background paint", "my border paint"
  and "my highlight paint" instead (painting in layers where
  necessary to achieve variation in shade).

* The switchbutton is now the same size in both the Android and iOS
  styles.

* Only one set of drawing logic is used for both the Android
  and iOS styles, controlled by the `kGeometry` and `kPaints`
  constants
@peter-b
Copy link
Contributor Author

peter-b commented Mar 4, 2016

@livecodeali I think this is good to go.

@livecodeali
Copy link
Member

@livecode-vulcan review ok c2d8681

@livecode-vulcan
Copy link
Contributor

💙 review by @livecodeali ok c2d8681

livecode-vulcan added a commit that referenced this pull request Mar 8, 2016
switchbutton: General rework

* The switchbutton now uses a "theme" property to control its
  theme.  The "theme" defaults to "native", but can also be
  _temporarily_ set to "Android" or "iOS".  However, the "theme"
  is not persisted over a save, so the switchbutton will always
  look "correct" when deployed.

  This is a temporary expedient to ensure that widgets look
  correct on mobile devices and can also have their mobile
  appearance previewed in the IDE.

* The switchbutton now uses the "hilited"/"highlight"/etc. control
  property, the same as the built-in checkbox control.  It uses the
  "hiliteChanged" message to indicate that the switchbutton has
  turned on or off.

  It's currently possible to change the status of the switchbutton
  _without_ emiting "hiliteChanged" by setting the "hilite"
  property directly.  Maybe this is wrong.

* The different Android colour themes have gone.

* The switchbutton is now the same size in both the Android and iOS
  styles.
@livecode-vulcan
Copy link
Contributor

😎 test success c2d8681

@peter-b peter-b modified the milestones: 8.0.0-dp-16, 8.0.0-freeze Mar 8, 2016
peter-b added a commit that referenced this pull request Mar 8, 2016
@peter-b peter-b merged commit e513c97 into livecode:develop Mar 8, 2016
@peter-b peter-b deleted the switchbutton-rework branch March 8, 2016 13:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants