{"id":19646076,"url":"https://github.com/cm0use/switchbutton","last_synced_at":"2026-05-13T11:34:42.394Z","repository":{"id":206665053,"uuid":"717415952","full_name":"CM0use/SwitchButton","owner":"CM0use","description":"Implementation of Material Design 2 for the Switch component.","archived":false,"fork":false,"pushed_at":"2023-11-13T20:51:28.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T23:58:32.499Z","etag":null,"topics":["component","cpp","cpp-qt","cpp17","material-design","material-design-2","material-ui","qt","qt-gui","qt-widget","qt6","qt6-widgets","qtdesigner","widget"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CM0use.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-11T12:36:05.000Z","updated_at":"2023-11-15T12:02:34.000Z","dependencies_parsed_at":"2024-11-11T14:39:00.322Z","dependency_job_id":"d5e487ea-30a3-4236-8435-8b208912bd50","html_url":"https://github.com/CM0use/SwitchButton","commit_stats":null,"previous_names":["cm0use/switchbutton"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CM0use/SwitchButton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM0use%2FSwitchButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM0use%2FSwitchButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM0use%2FSwitchButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM0use%2FSwitchButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CM0use","download_url":"https://codeload.github.com/CM0use/SwitchButton/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CM0use%2FSwitchButton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32980812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T11:31:52.688Z","status":"ssl_error","status_checked_at":"2026-05-13T11:31:52.072Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","cpp","cpp-qt","cpp17","material-design","material-design-2","material-ui","qt","qt-gui","qt-widget","qt6","qt6-widgets","qtdesigner","widget"],"created_at":"2024-11-11T14:36:42.933Z","updated_at":"2026-05-13T11:34:42.372Z","avatar_url":"https://github.com/CM0use.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n*** If you like this README,\n*** it is available as a template in my repositories,\n*** here is the link:\n*** https://github.com/CM0use/README-TEMPLATE\n--\u003e\n\u003ch1 align=\"center\"\u003eSwitchButton\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Windows-0078d7?style=for-the-badge\u0026logo=windows\u0026logoColor=ffffff\" alt=\"Windows\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/mac%20OS-313131?style=for-the-badge\u0026logo=macos\u0026logoColor=d7d7d7\" alt=\"macOS\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Linux-ffffff?style=for-the-badge\u0026logo=linux\u0026logoColor=000000\" alt=\"Linux\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/CM0use/SwitchButton/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-GPLv3-4a6484?style=for-the-badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003ci\u003eImplementation of Material Design 2 for the Switch component.\u003c/i\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#description\"\u003eDescription\u003c/a\u003e •\n  \u003ca href=\"#use\"\u003eUse\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n  \u003ca href=\"#references\"\u003eReferences\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![light](https://github.com/CM0use/SwitchButton/assets/102839710/9e9fbf61-2655-49ff-8eb9-27b5136700eb)\n![dark](https://github.com/CM0use/SwitchButton/assets/102839710/7d848e43-4e2d-4760-a628-a991eb4987ca)\n\u003c/div\u003e\n\n## Features\n* The color palette is based on Chrome aesthetics.\n* You can customize the track and thumb colors.\n* Easy to use and understand.\n\n## Description\nBased on \u003ca href=\"https://m2.material.io/components/switches\"\u003eMaterial Design 2\u003c/a\u003e used by Google and other applications.\u003cbr\u003e\n\nThis 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.\u003cbr\u003e\n\nThe color palette can be changed according to the theme you are using with the setThemeDark and setThemeLight methods.\u003cbr\u003e\nYou can also customize the color palette with the setTrackColor and setThumbColor methods to change the track and thumb colors.\u003cbr\u003e\n\n## Use\n```cpp\n#include \"switchbutton.h\"\n\nint main()\n{\n  // ...\n\n  bool themeDarkIsOn{ true };\n\n  // Add the text \"myText\" next to the SwitchButton and enable Chrome's dark theme\n  SwitchButton *_switch{ new SwitchButton(\"myText\", themeDarkIsOn) };\n\n  // Add the text \"myText\" next to the SwitchButton and enable Chrome's light theme\n  SwitchButton *_switch2{ new SwitchButton(\"myText\", !themeDarkIsOn) };\n\n  // Change the track and thumb color palette\n  _switch.setTrackColor(QColor{ \"#0f0\" }, QColor{ \"#00f\" });\n  _switch.setThumbColor(QColor{ \"#f00\" }, QColor{ \"#ff0\" });\n\n  // Change the color palette of the SwitchButton\n  _switch.setThemeLight();\n  _switch.setThemeDark();\n\n  // ...\n}\n```\n\n## Contributing\n**Any contribution you make will be greatly appreciated.**\u003cbr\u003e\nIf you have any ideas/suggestions to improve this repository, make a fork and create a pull request.\u003cbr\u003e\nYou can also \u003ca href=\"https://github.com/CM0use/SwitchButton/issues\"\u003eopen the issue tracker\u003c/a\u003e to report any improvements or bugs.\u003cbr\u003e\n\n## References\n\u003ca href=\"https://stackoverflow.com/questions/14780517/toggle-switch-in-qt\"\u003eToggle Switch in Qt\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/Wanderson-Magalhaes/PyOneDark_Qt_Widgets_Modern_GUI/blob/master/gui/widgets/py_toggle/py_toggle.py\"\u003ePyToggle\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/laserpants/qt-material-widgets\"\u003eQt Material Design Desktop Widgets\u003c/a\u003e\n\n## License\n**Distributed under the GNU General Public License v3.0**\u003cbr\u003e\nSee accompanying file \u003ca href=\"https://github.com/CM0use/SwitchButton/blob/main/LICENSE\"\u003eLICENSE\u003c/a\u003e\u003cbr\u003e\nor copy at \u003ca href=\"https://www.gnu.org/licenses/gpl-3.0.txt\"\u003eGNU General Public License\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcm0use%2Fswitchbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcm0use%2Fswitchbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcm0use%2Fswitchbutton/lists"}