Dark.qss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. /* 全局字体样式 */
  2. /* 设置所有QWidget及其子类的字体 */
  3. /* 单独设置主窗口背景渐变 */
  4. QWidget {
  5. color:white !important;
  6. font-family: 'Source Han Sans K';
  7. font-size: 22px;
  8. }
  9. QMainWindow {
  10. background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #09090f,stop:1 #3A3A3F);
  11. }
  12. QLabel, QToolButton, QProgressBar, QTableWidget, QLineEdit, QDateTimeEdit, QComboBox, QTextEdit {
  13. background: transparent;
  14. border: none;
  15. }
  16. /* 关键:必须单独设置视口透明 */
  17. QScrollArea, QScrollArea QWidget, QScrollArea QScrollBar {
  18. background: transparent;
  19. border: none;
  20. }
  21. /* 优化 QScrollBar 样式(适用于 QScrollArea) */
  22. QScrollBar:vertical {
  23. background: #2A2A2F;
  24. width: 10px;
  25. margin: 2px 0 2px 0;
  26. border-radius: 5px;
  27. }
  28. QScrollBar::handle:vertical {
  29. background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #7CB0F3, stop:1 #508CDC);
  30. min-height: 30px;
  31. border-radius: 5px;
  32. border: 1px solid #3A3A3F;
  33. }
  34. QScrollBar::handle:vertical:hover {
  35. background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #508CDC, stop:1 #7CB0F3);
  36. }
  37. QScrollBar::handle:vertical:pressed {
  38. background: #3A3A3F;
  39. }
  40. QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
  41. height: 0px;
  42. background: none;
  43. border: none;
  44. }
  45. QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
  46. background: none;
  47. }
  48. QScrollBar:horizontal {
  49. background: #2A2A2F;
  50. height: 10px;
  51. margin: 0 2px 0 2px;
  52. border-radius: 5px;
  53. }
  54. QScrollBar::handle:horizontal {
  55. background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #7CB0F3, stop:1 #508CDC);
  56. min-width: 30px;
  57. border-radius: 5px;
  58. border: 1px solid #3A3A3F;
  59. }
  60. QScrollBar::handle:horizontal:hover {
  61. background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #508CDC, stop:1 #7CB0F3);
  62. }
  63. QScrollBar::handle:horizontal:pressed {
  64. background: #3A3A3F;
  65. }
  66. QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal {
  67. width: 0px;
  68. background: none;
  69. border: none;
  70. }
  71. QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
  72. background: none;
  73. }
  74. QSpinBox {
  75. background: transparent;
  76. /* 移除按钮区域 */
  77. padding-right: 0;
  78. }
  79. QSpinBox::up-button, QSpinBox::down-button {
  80. width: 0;
  81. border: none; /* 可选:移除边框 */
  82. }
  83. QCheckBox::indicator {
  84. width: 100px; /* 图标宽度,可根据实际图片调整 */
  85. height: 60px; /* 图标高度 */
  86. }
  87. QCheckBox::indicator:unchecked {
  88. image: url(:/icons/disable.png);
  89. }
  90. QCheckBox::indicator:checked {
  91. image: url(:/icons/enable.png);
  92. }
  93. QPushButton {
  94. background: #7CB0F3;
  95. height: 40px;
  96. border-radius:10px;
  97. }
  98. QPushButton:pressed {
  99. background: #5b5b79;
  100. }
  101. QProgressBar {
  102. border-radius:10px;
  103. }
  104. QTableWidget {
  105. selection-color: #00C1C3;
  106. selection-background-color: transparent;
  107. color: white;
  108. }
  109. QTableWidget::item {
  110. /* color: white; */
  111. padding: 5px;
  112. }
  113. /* 添加表头样式 */
  114. QTableWidget QHeaderView::section {
  115. background-color: #2A2A2F;
  116. color: #00C1C3;
  117. padding: 8px;
  118. border: none;
  119. font-weight: bold;
  120. }
  121. QTableWidget QHeaderView::section:hover {
  122. background-color: #3A3A3F;
  123. }
  124. QLabel#count_time {
  125. color: #00C1C3;
  126. font-size: 48px 'Source Han Sans K';
  127. font-weight: bold; /* 加粗 */
  128. }
  129. QProgressBar::chunk {
  130. background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,stop:0 #a8e4ff,stop:1 #00b894);
  131. border-radius: 10px;
  132. }
  133. FormLogin QPushButton#login,
  134. FormLogin QPushButton#cancel {
  135. background: transparent;
  136. border: none;
  137. }
  138. FormGunDetail QWidget {
  139. border-radius: 10px;
  140. }
  141. FormGunDetail QLabel#gun_index {
  142. color: #00C1C3;
  143. font-size: 48px 'Source Han Sans K';
  144. font-weight: bold; /* 加粗 */
  145. }
  146. FormGunDetail QLabel#gun_type {
  147. color: #00C1C3;
  148. font-size: 22px 'Source Han Sans K';
  149. }
  150. FormGunDetail QLabel#tips {
  151. font-size: 22px 'Source Han Sans K';
  152. }
  153. QLabel#charge_percent, QLabel#charge_percent_1 {
  154. font-size: 48px 'Source Han Sans K';
  155. font-style: italic; /* 斜体 */
  156. font-weight: bold; /* 加粗 */
  157. }
  158. QLabel#soc {
  159. color: #00C1C3;
  160. font-size: 32px 'Source Han Sans K';
  161. font-weight: bold; /* 加粗 */
  162. }
  163. QLabel#coundtime, QLabel#coundtime_unit {
  164. color: #00C1C3;
  165. font-size: 20px 'Source Han Sans K';
  166. }
  167. FormFinished QLabel#tips_normal, QLabel#tips_recover, QLabel#tips_irrecover{
  168. font-size: 16px 'Source Han Sans K';
  169. }
  170. QLabel#power_consumption,
  171. QLabel#duration,
  172. QLabel#price,
  173. QLabel#voltage,
  174. QLabel#current {
  175. color: #00C1C3;
  176. }
  177. QLabel#titles {
  178. color: #00C1C3;
  179. font-size: 32px;
  180. font-weight: bold; /* 加粗 */
  181. }
  182. FormChargeSettings QLineEdit#value,
  183. FormChargeSettings QLabel#unit {
  184. color: #00C1C3;
  185. font-size: 40px;
  186. font-weight: bold; /* 加粗 */
  187. }
  188. FormError QLabel#error_tips {
  189. color: #E45F45;
  190. }
  191. FormChargingRecordsItem QLabel {
  192. font-size: 16px 'Source Han Sans K';
  193. }
  194. /* QMessageBox 样式 */
  195. QMessageBox {
  196. background-color: #2A2A2F;
  197. color: white;
  198. }
  199. QMessageBox QLabel {
  200. color: white;
  201. font-size: 22px;
  202. min-width: 300px;
  203. }
  204. QMessageBox QPushButton {
  205. background-color: #7CB0F3;
  206. color: white;
  207. border-radius: 10px;
  208. padding: 8px 20px;
  209. min-width: 100px;
  210. font-size: 22px;
  211. }
  212. QMessageBox QPushButton:hover {
  213. background-color: #5b5b79;
  214. }
  215. QMessageBox QPushButton:pressed {
  216. background-color: #5b5b79;
  217. }
  218. /* QDateTimeEdit 日历弹出窗口样式 */
  219. QCalendarWidget {
  220. background-color: #2A2A2F;
  221. border: 1px solid #3A3A3F;
  222. border-radius: 10px;
  223. font-size: 20px;
  224. }
  225. QCalendarWidget QToolButton {
  226. background-color: #2A2A2F;
  227. border: none;
  228. font-size: 20px;
  229. font-weight: bold;
  230. padding: 5px 10px;
  231. border-radius: 8px;
  232. }
  233. QCalendarWidget QToolButton:hover {
  234. background-color: #3A3A3F;
  235. }
  236. QCalendarWidget QMenu {
  237. background-color: #2A2A2F;
  238. border: 1px solid #3A3A3F;
  239. border-radius: 8px;
  240. }
  241. QCalendarWidget QSpinBox,
  242. QCalendarWidget QDoubleSpinBox,
  243. QCalendarWidget QLineEdit {
  244. background: #2A2A2F;
  245. border: 1px solid #3A3A3F;
  246. border-radius: 6px;
  247. font-size: 18px;
  248. }
  249. QCalendarWidget QAbstractItemView {
  250. background-color: #2A2A2F;
  251. selection-background-color: #3A3A3F;
  252. selection-color: #00C1C3;
  253. border-radius: 6px;
  254. }
  255. QCalendarWidget QWidget#qt_calendar_navigationbar {
  256. background-color: #2A2A2F;
  257. border: none;
  258. border-radius: 10px 10px 0 0;
  259. }
  260. QCalendarWidget QTableView {
  261. border: none;
  262. }
  263. QCalendarWidget QTableView:item:selected {
  264. background-color: #00C1C3;
  265. color: #2A2A2F;
  266. border-radius: 4px;
  267. }
  268. /* QComboBox 统一深色风格 */
  269. QComboBox {
  270. background: transparent;
  271. color: white;
  272. border: none;
  273. padding: 5px 10px;
  274. min-width: 6em;
  275. font-size: 22px;
  276. }
  277. QComboBox:hover, QComboBox:focus {
  278. border: none;
  279. }
  280. QComboBox::drop-down {
  281. subcontrol-origin: padding;
  282. subcontrol-position: top right;
  283. width: 24px;
  284. border-left: 1px solid #3A3A3F;
  285. border-top-right-radius: 10px;
  286. border-bottom-right-radius: 10px;
  287. background: transparent;
  288. }
  289. QComboBox::down-arrow {
  290. image: url(:/icons/spread.png);
  291. width: 32px;
  292. height: 32px;
  293. }
  294. QComboBox::down-arrow:on {
  295. image: url(:/icons/packup.png);
  296. }
  297. QComboBox QAbstractItemView {
  298. background-color: #2A2A2F;
  299. color: white;
  300. border: none;
  301. border-radius: 10px;
  302. outline: none;
  303. text-align: center;
  304. font-size: 22px;
  305. }
  306. QComboBox QAbstractItemView::item {
  307. border: none;
  308. min-height: 36px;
  309. padding: 5px 10px;
  310. }
  311. QComboBox QAbstractItemView::item:hover {
  312. background-color: #3A3A3F;
  313. border: none;
  314. color: #00C1C3;
  315. }
  316. /* QListWidget 样式统一字体大小 */
  317. QListWidget {
  318. background-color: #2A2A2F;
  319. color: white;
  320. border: 1px solid #3A3A3F;
  321. border-radius: 10px;
  322. outline: none;
  323. }
  324. QListWidget::item {
  325. min-height: 40px;
  326. padding: 5px 10px;
  327. text-align: center;
  328. }
  329. QListWidget::item:selected {
  330. background-color: #00C1C3;
  331. color: #2A2A2F;
  332. border-radius: 6px;
  333. }
  334. QListWidget::item:hover {
  335. background-color: #3A3A3F;
  336. color: #00C1C3;
  337. }
  338. FormLogShow QTextEdit {
  339. color: white;
  340. font-size: 20px;
  341. }
  342. FormPayment QLabel#groupBox_title_1,
  343. FormPayment QLabel#groupBox_title_2,
  344. FormPayment QLabel#groupBox_title_3,
  345. FormPayment QLabel#groupBox_title_4,
  346. FormPayment QLabel#groupBox_title_5 {
  347. color : #808080;
  348. }
  349. QTreeWidget {
  350. background-color: #2A2A2F;
  351. color: white;
  352. border: 1px solid #3A3A3F;
  353. border-radius: 10px;
  354. outline: none;
  355. font-size: 22px;
  356. }
  357. QTreeWidget::item {
  358. min-height: 36px;
  359. padding: 5px 10px;
  360. text-align: left;
  361. border-radius: 6px;
  362. }
  363. QTreeWidget::item:selected {
  364. background-color: #00C1C3;
  365. color: #2A2A2F;
  366. border-radius: 6px;
  367. }
  368. QTreeWidget::item:hover {
  369. background-color: #3A3A3F;
  370. color: #00C1C3;
  371. }
  372. QTreeWidget::branch {
  373. background: transparent;
  374. }
  375. QTreeWidget::branch:has-children:!has-siblings:closed,
  376. QTreeWidget::branch:closed:has-children:has-siblings {
  377. border-image: none;
  378. image: url(:/icons/spread.png);
  379. width: 24px;
  380. height: 24px;
  381. }
  382. QTreeWidget::branch:open:has-children:!has-siblings,
  383. QTreeWidget::branch:open:has-children:has-siblings {
  384. border-image: none;
  385. image: url(:/icons/packup.png);
  386. width: 24px;
  387. height: 24px;
  388. }
  389. QDoubleSpinBox {
  390. background: transparent;
  391. color: white;
  392. border: none;
  393. padding: 5px 10px;
  394. font-size: 22px;
  395. }
  396. QDoubleSpinBox:disabled {
  397. color: #808080;
  398. }
  399. QDoubleSpinBox::up-button,
  400. QDoubleSpinBox::down-button,
  401. QTimeEdit::up-button,
  402. QTimeEdit::down-button,
  403. QDateTimeEdit::up-button,
  404. QDateTimeEdit::down-button {
  405. width: 0;
  406. border: none;
  407. }
  408. /* QTabWidget 及 QTabBar 样式 */
  409. QTabWidget::pane {
  410. border: none;
  411. background: transparent;
  412. }
  413. QTabBar {
  414. background: transparent;
  415. border: none;
  416. height: 40px;
  417. }
  418. QTabBar::tab {
  419. background: #5b5b79;
  420. color: white;
  421. border-radius: 10px;
  422. min-width: 100px;
  423. min-height: 40px;
  424. margin: 4px 8px 4px 0;
  425. padding: 0 20px;
  426. font-size: 22px;
  427. }
  428. QTabBar::tab:selected {
  429. background: #508CDC;
  430. color: white;
  431. }
  432. QTabBar::tab:!selected {
  433. background: #5b5b79;
  434. color: white;
  435. }
  436. QTabBar::tab:pressed {
  437. background: #64A0F0;
  438. }
  439. /* QGroupBox 样式 */
  440. QGroupBox {
  441. background: #5b5b79;
  442. border-radius: 10px;
  443. border: 2px solid #7CB0F3;
  444. margin-top: 24px;
  445. padding: 16px 12px 12px 12px;
  446. }
  447. QGroupBox::title {
  448. subcontrol-origin: margin;
  449. subcontrol-position: top left;
  450. color: #7CB0F3;
  451. font-weight: bold;
  452. padding: 0 8px;
  453. background: transparent;
  454. }