switch_button.qss 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. QWidget {
  2. background-color: white;
  3. }
  4. SwitchButton {
  5. qproperty-spacing: 12;
  6. background-color: transparent;
  7. }
  8. SwitchButton>QLabel {
  9. color: black;
  10. font: 14px 'Segoe UI', 'Microsoft YaHei';
  11. background-color: transparent;
  12. border: none;
  13. }
  14. Indicator {
  15. height: 16px;
  16. width: 37px;
  17. qproperty-sliderOnColor: white;
  18. qproperty-sliderOffColor: rgb(96, 96, 96);
  19. qproperty-sliderDisabledColor: rgb(155, 154, 153);
  20. border-radius: 10px;
  21. }
  22. Indicator:!checked {
  23. background-color: rgb(247, 247, 247);
  24. border: 1px solid rgb(139, 139, 139);
  25. }
  26. Indicator:!checked:hover {
  27. border: 1px solid rgb(136, 136, 136);
  28. background-color: rgb(238, 238, 238);
  29. qproperty-sliderOffColor: rgb(91, 91, 91);
  30. }
  31. Indicator:!checked:pressed {
  32. border: 1px solid rgb(133, 133, 133);
  33. background-color: rgb(229, 229, 229);
  34. qproperty-sliderOffColor: rgb(87, 87, 87);
  35. }
  36. Indicator:checked {
  37. border: 1px solid --ThemeColorPrimary;
  38. background-color: --ThemeColorPrimary;
  39. }
  40. Indicator:checked:hover {
  41. border: 1px solid --ThemeColorLight1;
  42. background-color: --ThemeColorLight1;
  43. }
  44. Indicator:checked:pressed {
  45. border: 1px solid --ThemeColorLight2;
  46. background-color: --ThemeColorLight2;
  47. }
  48. Indicator:disabled {
  49. border: 1px solid rgb(194, 194, 191);
  50. background-color: rgb(194, 194, 191);
  51. }