new1.qss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. /* ================================================ *
  2. author:lei
  3. lastedited:2020.2
  4. * ================================================ */
  5. /*hover*/
  6. /*actived*/
  7. /*gradient start*/
  8. /*gradient end*/
  9. QWidget
  10. {
  11. color: #ffffff;
  12. background-color: #1d1d1d;
  13. }
  14. QFrame{
  15. color: #ffffff;
  16. background-color: #1d1d1d;/*不能设置为transparent*/
  17. }
  18. QMainWindow::separator{
  19. border: 1px solid #999999;
  20. border-style: outset;
  21. width: 4px;
  22. height: 4px;
  23. }
  24. QMainWindow::separator:hover{
  25. background: #efca22;
  26. }
  27. QSplitter::handle{
  28. border: 1px solid #999999;
  29. border-style: outset;
  30. width: 4px;
  31. height: 4px;
  32. }
  33. QSplitter::handle:hover{/*splitter->handle(1)->setAttribute(Qt::WA_Hover, true);才生效*/
  34. border-color: #efca22;
  35. }
  36. QSplitter::handle:pressed{
  37. border-color: #efca22;
  38. }
  39. QSizeGrip{
  40. background-color: none;
  41. }
  42. /* =============================================== */
  43. /* Label */
  44. /* =============================================== */
  45. QLabel {
  46. background: transparent;
  47. border: 1px solid transparent;
  48. padding: 1px;
  49. }
  50. /* A QLabel is a QFrame ... */
  51. /* A QToolTip is a QLabel ... */
  52. QToolTip {
  53. border: 1px solid #999999;
  54. padding: 5px;
  55. border-radius: 3px;
  56. opacity:210;
  57. }
  58. /* =============================================== */
  59. /* TextBox */
  60. /* =============================================== */
  61. QLineEdit {
  62. background: #1d1d1d;/*不建议设为透明,否则table编辑时会字显示*/
  63. selection-background-color: #efca22;
  64. border: 1px solid #999999;
  65. border-radius: 2px;
  66. border-style: inset;
  67. padding: 0 1px;
  68. }
  69. QLineEdit:hover{
  70. border-color: #efca22;
  71. }
  72. QLineEdit:focus{
  73. border-color: #efca22;
  74. }
  75. /*QLineEdit[readOnly="true"] { color: gray }*/
  76. QLineEdit[echoMode="2"]{
  77. lineedit-password-character: 9679;/*字符的ascii码35 88等 */
  78. }
  79. QLineEdit:read-only {
  80. color: lightgray;
  81. }
  82. QLineEdit:disabled{
  83. color: lightgray;
  84. background: lightgray;
  85. }
  86. QTextEdit{
  87. selection-background-color:#efca22;
  88. border: 1px solid #999999;
  89. border-style: inset;
  90. }
  91. QTextEdit:hover{
  92. border-color: #efca22;
  93. }
  94. QTextEdit:focus{
  95. border-color: #efca22;
  96. }
  97. /* =============================================== */
  98. /* Button */
  99. /* =============================================== */
  100. QPushButton {
  101. border: 1px solid #999999;
  102. border-radius: 2px;
  103. background-color: #f6d541;
  104. padding: 1px 4px;
  105. min-width: 50px;
  106. min-height: 16px;
  107. }
  108. QPushButton:hover{
  109. background-color: #efca22;
  110. border-color: #efca22;
  111. }
  112. QPushButton:pressed
  113. {
  114. border-width: 1px;
  115. background-color: #efca22;
  116. border-color: #999999;
  117. }
  118. QPushButton:focus, QPushButton:default {
  119. border-color: #efca22; /* make the default button prominent */
  120. }
  121. QToolButton,QToolButton:unchecked { /* ToolBar里的按钮和带下拉菜单的按钮 */
  122. border: 1px solid transparent;
  123. border-radius: 3px;
  124. background-color: transparent;
  125. margin: 1px;
  126. }
  127. QToolButton:checked{
  128. background-color: #efca22;
  129. border-color: #efca22;
  130. }
  131. QToolButton:hover{
  132. background-color: #efca22;
  133. border-color: #efca22;
  134. }
  135. QToolButton:pressed,QToolButton:checked:hover{
  136. background-color: #efca22;
  137. border-color: #efca22;
  138. }
  139. QToolButton:checked:pressed{
  140. background-color: #efca22;
  141. }
  142. /* only for MenuButtonPopup */
  143. QToolButton[popupMode="1"]{
  144. padding-left: 1px;
  145. padding-right: 15px; /* make way for the popup button */
  146. border: 1px solid #999999;
  147. min-height: 15px;
  148. /*background: qlineargradient(x1:0, y1:0 ,x2:0, y2:1
  149. stop: 0 #EEEEEF, stop: 0.05 #DADADF, stop: 0.5 #DADADF
  150. stop: 0.95 #EEEEEF stop: 1#EEEEEF)*/
  151. }
  152. QToolButton[popupMode="1"]:hover{
  153. background-color: #efca22;
  154. border-color: #efca22;
  155. }
  156. QToolButton[popupMode="1"]:pressed{
  157. border-width: 1px;
  158. background-color: #efca22;
  159. border-color: #999999;
  160. }
  161. QToolButton::menu-button {
  162. border: 1px solid #999999;
  163. border-top-right-radius: 2px;
  164. border-bottom-right-radius: 2px;
  165. width: 16px;
  166. }
  167. /* =============================================== */
  168. /* Slider ProgressBar */
  169. /* =============================================== */
  170. QProgressBar {
  171. border: 1px solid #999999;
  172. border-radius: 4px;
  173. text-align: center;
  174. }
  175. QProgressBar::chunk {
  176. background-color: #efca22;
  177. width: 4px;
  178. margin: 1px;
  179. }
  180. QSlider{
  181. border: 1px solid transparent;
  182. }
  183. QSlider::groove{
  184. border: 1px solid #999999;
  185. background: #1d1d1d;
  186. }
  187. QSlider::handle {/*设置中间的那个滑动的键*/
  188. border: 1px solid #999999;
  189. background: #efca22;
  190. }
  191. QSlider::groove:horizontal {
  192. height: 3px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
  193. left:5px; right: 5px;
  194. }
  195. QSlider::groove:vertical{
  196. width: 3px;
  197. top: 5px; bottom: 5px;
  198. }
  199. QSlider::handle:horizontal{
  200. width: 6px;
  201. margin: -7px; /* height */
  202. }
  203. QSlider::handle:vertical{
  204. height: 6px;
  205. margin: -7px; /* height */
  206. }
  207. QSlider::add-page{/*还没有滑上去的地方*/
  208. border: 1px solid #999999;
  209. background:#EEEEEF;
  210. }
  211. QSlider::sub-page{/*已经划过的从地方*/
  212. background: #efca22;
  213. }
  214. /* =============================================== */
  215. /* ScrollBar */
  216. /* =============================================== */
  217. QScrollBar{
  218. background-color: #1d1d1d;
  219. border: 1px solid #999999;
  220. border-radius: 5px;
  221. padding: 1px;
  222. height: 10px;
  223. width: 10px;
  224. }
  225. QScrollBar:hover{
  226. border-color:#efca22;
  227. }
  228. QScrollBar::handle{
  229. border-radius: 3px;
  230. background: #efca22;
  231. min-width: 16px;
  232. min-height: 16px;
  233. }
  234. QScrollBar::handle:hover {
  235. background: #efca22;
  236. }
  237. QScrollBar::add-line, QScrollBar::sub-line,
  238. QScrollBar::add-page, QScrollBar::sub-page {
  239. width: 0px;
  240. background: transparent;
  241. }
  242. QScrollArea{
  243. border: none;
  244. }
  245. /*QScrollArea QAbstractSlider{
  246. border-radius: 0px;
  247. }*/
  248. /* =============================================== */
  249. /* DockWidget */
  250. /* =============================================== */
  251. QDockWidget, QDockWidget > QWidget/*not work*/
  252. {
  253. border-color: #999999;/*qt bug*/
  254. background: transparent;
  255. }
  256. QDockWidget::title {
  257. border-bottom: 1px solid #999999;
  258. border-style: inset;
  259. text-align: left; /* align the text to the left */
  260. padding: 6px;
  261. }
  262. /* =============================================== */
  263. /* GroupBox */
  264. /* =============================================== */
  265. QGroupBox {
  266. background-color: #1d1d1d;
  267. border: 1px solid #999999;
  268. border-radius: 4px;
  269. margin-top: 0.5em;
  270. }
  271. QGroupBox::title {
  272. subcontrol-origin: margin;
  273. subcontrol-position: top left;
  274. left: 1em;
  275. top: 0.1em;
  276. background-color: #1d1d1d;
  277. }
  278. /* =============================================== */
  279. /* ToolBox */
  280. /* =============================================== */
  281. QToolBox{
  282. border: 1px solid #999999;
  283. }
  284. QToolBox::tab {
  285. background: #EEEEEF;
  286. border: 1px solid #999999;
  287. border-radius: 1px;
  288. }
  289. QToolBox::tab:hover {
  290. background-color: #efca22;
  291. border-color: transparent;
  292. }
  293. QToolBox::tab:pressed {
  294. background-color: #efca22;
  295. border-color: transparent;
  296. }
  297. QToolBox::tab:selected {
  298. font-weight: bold;
  299. border-color: #efca22;
  300. }
  301. /* =============================================== */
  302. /* TabWidget */
  303. /* =============================================== */
  304. QTabWidget{
  305. margin-top:10px;
  306. }
  307. QTabWidget::pane{
  308. border: 1px solid #999999;
  309. }
  310. QTabWidget::tab-bar {
  311. left: 0px;
  312. }
  313. QTabBar::tab {
  314. background: #1d1d1d;
  315. border: 1px solid #999999;
  316. padding: 3px 5px;
  317. }
  318. QTabBar::tab:hover {
  319. background: #efca22;
  320. border-color: transparent;
  321. }
  322. QTabBar::tab:selected {
  323. background: #efca22;
  324. border-color: #efca22;
  325. }
  326. QTabBar::tab:pressed {
  327. background: #efca22;
  328. border-color: transparent;
  329. }
  330. QTabBar::tab:focus {
  331. border-color: #efca22;
  332. }
  333. QTabBar::tab:top{
  334. margin-top: 3px;
  335. border-bottom: transparent;
  336. margin-right: 1px;
  337. }
  338. QTabBar::tab:bottom{
  339. margin-bottom: 3px;
  340. border-top: transparent;
  341. margin-right: 1px;
  342. }
  343. QTabBar::tab:left{
  344. border-right: transparent;
  345. margin-bottom: 1px;
  346. }
  347. QTabBar::tab:right{
  348. border-left: transparent;
  349. margin-bottom: 1px;
  350. }
  351. /* =============================================== */
  352. /* QHeaderView for list table */
  353. /* =============================================== */
  354. QHeaderView {
  355. border: none;
  356. margin: 0px;
  357. padding: 0px;
  358. }
  359. QHeaderView::section, QTableCornerButton::section {/*设置表头属性*//*左上角*/
  360. background-color: #EEEEEF;
  361. padding: 0 3px;
  362. border-right: 1px solid #999999;
  363. border-bottom: 1px solid #999999;
  364. border-radius: 0px;
  365. }
  366. QHeaderView::section:hover, QTableCornerButton::section:hover{
  367. background-color: #efca22;
  368. }
  369. QHeaderView::section:pressed{
  370. background-color: #efca22;
  371. }
  372. QHeaderView::section:checked {
  373. background-color: #efca22;
  374. }
  375. /* =============================================== */
  376. /* QTableWidget */
  377. /* =============================================== */
  378. QTableWidget, QTableView
  379. {
  380. gridline-color: #999999; /*表格中的网格线条颜色*/
  381. background: #1d1d1d;
  382. /*设置交替颜色,需要在函数属性中设置:tableWidget->setAlternatingRowColors(true)*/
  383. alternate-background-color: #EEEEEF;
  384. /*selection-color:#1d1d1d; 鼠标选中时前景色:文字颜色*/
  385. selection-background-color:#efca22; /*鼠标选中时背景色*/
  386. border:1px solid #999999; /*边框线的宽度、颜色*/
  387. /*border:none; 去除边界线*/
  388. /*border-radius:5px;*/
  389. /*padding:10px 10px;*/ /*表格与边框的间距*/
  390. }
  391. QTableView::item, QTabWidget::item{
  392. background: transparent;
  393. outline-style: none;
  394. border: none;
  395. }
  396. QTableView::item:hover {
  397. background: #efca22;
  398. border: 1px solid #efca22;
  399. }
  400. QTableView::item:selected {
  401. background: #efca22;
  402. color: #EEEEEF;
  403. }
  404. QTableView::item:selected:active {
  405. background: #efca22;
  406. color: #EEEEEF;
  407. }
  408. QTableWidget QComboBox{
  409. margin: 2px;
  410. border: none;
  411. }