Skip to content

A mobile OS style slide switch (Android, iOS) in pyqt5

Notifications You must be signed in to change notification settings

JuneChen225/pyqt_slide_switch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android style slide switch for PyQt

A Android style slide switch in pyqt5.

Found myself one day wanting a switch like Android's while doing a GUI in pyqt5. Found a usable one, but much could be imporved. Thus this project.

The original C++ code was posted by IMAN4K: https://stackoverflow.com/a/38102598

The original Python version was ported by Stefan Scherfke: https://stackoverflow.com/a/51825815

The following GIF is a demo from the appDemo.py

Screen record

Main changes include, but are not limited to, the following.

  • Remove auto style change base on the values of track radius and thumb radius. Leave the decision to the user.

  • Softcode track opacity and thumb opacity.

  • Allow user defined colour palette.

  • Allow thumb text settings.

  • Allow thumb font size gain setting.

  • Allow slide animation setting.

  • Allow vertical direction.

  • Always center the thumb in relation to the track.

About

A mobile OS style slide switch (Android, iOS) in pyqt5

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%