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

Commit

Permalink
Auto-merge pull request #3684 from peter-b/switchbutton-rework
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
livecode-vulcan committed Mar 8, 2016
2 parents 770dfa6 + c2d8681 commit 75a279d
Show file tree
Hide file tree
Showing 3 changed files with 369 additions and 507 deletions.
35 changes: 35 additions & 0 deletions extensions/widgets/switchbutton/notes/feature-theming.md
@@ -0,0 +1,35 @@
# Theming and appearance

* The switch button is now drawn the same size for both its "iOS" and
"android" themes. It is no longer possible to resize the bounding box of
the switch button so that some of it is "cut off" at the edges.

* The switch button now uses the **theme** property to control its appearance.
Currently, the **theme** property is _not_ saved, and is reset to "native"
whenever the widget is loaded.

* The switch button colors are now controlled by the standard LiveCode
**hiliteColor**, **borderColor** and **backgroundColor** properties. They
can be edited in the property inspector.

* The switch button now obeys the standard LiveCode **showBorder** property,
which can be edited in the property inspector.

# Properties

* The **widgetTheme** property has been removed. Use the **theme** property
instead.

* The **colorScheme** property has been removed. Set the **hiliteColor**,
**borderColor** and **backgroundColor** properties instead.

* The **switchIsOn** property has been removed. Use the **hilited** property
instead.

# Signals

* The **switchChanged** signal has been renamed to **hiliteChanged**.

# Default script

* The switch button now has a default script.
@@ -0,0 +1,4 @@
script "com.livecode.widget.switchbutton.__DefaultScript"
on hiliteChanged pHilited

end hiliteChanged

0 comments on commit 75a279d

Please sign in to comment.