Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Implementation of Material Design 2 for the Switch component.

License

NotificationsYou must be signed in to change notification settings

CM0use/SwitchButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

WindowsmacOSLinux

Implementation of Material Design 2 for the Switch component.

FeaturesDescriptionUseContributingReferencesLicense

lightdark

Features

  • The color palette is based on Chrome aesthetics.
  • You can customize the track and thumb colors.
  • Easy to use and understand.

Description

Based onMaterial Design 2 used by Google and other applications.

This repository was created to improve the functionality of Switch/Toggle that do not have the expected functionality or are too complex. These Switch/Toggle often do not allow to place a text next to it that is activated when clicking on it or in the surrounding area.

The color palette can be changed according to the theme you are using with the setThemeDark and setThemeLight methods.
You can also customize the color palette with the setTrackColor and setThumbColor methods to change the track and thumb colors.

Use

#include"switchbutton.h"intmain(){// ...bool themeDarkIsOn{true };// Add the text "myText" next to the SwitchButton and enable Chrome's dark theme  SwitchButton *_switch{newSwitchButton("myText", themeDarkIsOn) };// Add the text "myText" next to the SwitchButton and enable Chrome's light theme  SwitchButton *_switch2{newSwitchButton("myText", !themeDarkIsOn) };// Change the track and thumb color palette  _switch.setTrackColor(QColor{"#0f0" }, QColor{"#00f" });  _switch.setThumbColor(QColor{"#f00" }, QColor{"#ff0" });// Change the color palette of the SwitchButton  _switch.setThemeLight();  _switch.setThemeDark();// ...}

Contributing

Any contribution you make will be greatly appreciated.
If you have any ideas/suggestions to improve this repository, make a fork and create a pull request.
You can alsoopen the issue tracker to report any improvements or bugs.

References

Toggle Switch in Qt
PyToggle
Qt Material Design Desktop Widgets

License

Distributed under the GNU General Public License v3.0
See accompanying fileLICENSE
or copy atGNU General Public License

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp