switch_button.qss 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. QWidget {
  2. background-color: transparent;
  3. }
  4. SwitchButton {
  5. qproperty-spacing: 12;
  6. background-color: transparent;
  7. }
  8. SwitchButton>QLabel {
  9. font: 14px 'Segoe UI', 'Microsoft YaHei';
  10. color: white;
  11. background-color: transparent;
  12. border: none;
  13. }
  14. Indicator {
  15. height: 16px;
  16. width: 37px;
  17. qproperty-sliderOnColor: black;
  18. qproperty-sliderOffColor: rgb(210, 211, 210);
  19. qproperty-sliderDisabledColor: rgb(155, 154, 153);
  20. border-radius: 10px;
  21. }
  22. Indicator:!checked {
  23. background-color: rgb(45, 45, 45);
  24. border: 1px solid rgb(162, 163, 162);
  25. }
  26. Indicator:!checked:hover {
  27. background-color: rgb(58, 60, 59);
  28. border: 1px solid rgb(160, 161, 161);
  29. qproperty-sliderOffColor: rgb(91, 91, 91);
  30. }
  31. Indicator:!checked:pressed {
  32. background-color: rgb(64, 65, 64);
  33. border: 1px solid rgb(164, 165, 165);
  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 --ThemeColorDark1;
  42. background-color: --ThemeColorDark1;
  43. }
  44. Indicator:checked:pressed {
  45. border: 1px solid --ThemeColorDark2;
  46. background-color: --ThemeColorDark2;
  47. }
  48. Indicator:disabled {
  49. border: 1px solid rgb(100, 100, 100);
  50. background-color: transparent;
  51. }