_spinbuttons.scss 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*****************
  2. * GtkSpinButton *
  3. *****************/
  4. spinbutton {
  5. &:not(.vertical) {
  6. // in this horizontal configuration, the whole spinbutton
  7. // behaves as the entry, so we extend the entry styling
  8. // and nuke the style on the internal entry
  9. @extend %entry;
  10. padding: 0;
  11. entry {
  12. min-width: 28px;
  13. // reset all the other props since the spinbutton node is styled here
  14. margin: 0;
  15. background: none;
  16. background-color: transparent;
  17. border: none;
  18. border-radius: 0;
  19. box-shadow: none;
  20. }
  21. button {
  22. min-height: 16px;
  23. margin: 0;
  24. padding-bottom: 0;
  25. padding-top: 0;
  26. color: mix($fg_color, $base_color, 90%);
  27. background-image: none;
  28. border-style: none none none solid;
  29. border-color: transparentize($borders_color, 0.7);
  30. border-radius: 0;
  31. box-shadow: inset 1px 0px 0px 0px rgba(0,0,0,0.07);
  32. &:dir(rtl) { border-style: none solid none none; }
  33. &:hover {
  34. color: $fg_color;
  35. background-color: $base_hover_color;
  36. }
  37. &:disabled { color: transparentize($insensitive_fg_color, 0.7); }
  38. &:active {
  39. background-color: transparentize(black, 0.9);
  40. box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
  41. }
  42. &:backdrop {
  43. color: mix($backdrop_fg_color, $backdrop_base_color, 90%);
  44. background-color: transparent;
  45. border-color: transparentize($backdrop_borders_color, 0.7);
  46. transition: $backdrop_transition;
  47. }
  48. &:backdrop:disabled {
  49. color: transparentize($backdrop_insensitive_color,0.7);
  50. background-image: none;
  51. border-style: none none none solid; // It is needed or it gets overridden
  52. box-shadow: inset 1px 0px 0px 0px rgba(0,0,0,0.07);
  53. &:dir(rtl) { border-style: none solid none none; }
  54. }
  55. &:last-child {
  56. border-top-right-radius: 2px;
  57. border-bottom-right-radius: 2px;
  58. }
  59. }
  60. }
  61. // OSD horizontal
  62. .osd &:not(.vertical) {
  63. button {
  64. @include button(undecorated);
  65. color: $osd_fg_color;
  66. border-style: none none none solid;
  67. border-color: transparentize($osd_borders_color, 0.3);
  68. border-radius: 0;
  69. box-shadow: none;
  70. -gtk-icon-shadow: 0 1px black;
  71. &:dir(rtl) { border-style: none solid none none; }
  72. &:hover {
  73. @include button(undecorated);
  74. color: $osd_fg_color;
  75. border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
  76. background-color: transparentize($osd_fg_color, 0.9);
  77. -gtk-icon-shadow: 0 1px black;
  78. box-shadow: none;
  79. }
  80. &:backdrop {
  81. @include button(undecorated);
  82. color: $osd_fg_color;
  83. border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
  84. -gtk-icon-shadow: none;
  85. box-shadow: none;
  86. }
  87. &:disabled {
  88. @include button(undecorated);
  89. color: $osd_insensitive_fg_color;
  90. border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
  91. -gtk-icon-shadow: none;
  92. box-shadow: none;
  93. }
  94. &:last-child { border-radius: 0 3px 3px 0; }
  95. &:dir(rtl):first-child { border-radius: 3px 0 0 3px; }
  96. }
  97. }
  98. // Vertical
  99. &.vertical {
  100. // in the vertical configuration, we treat the spinbutton
  101. // as a box, and tweak the style of the entry in the middle
  102. // so that it's linked
  103. // FIXME: this should not be set at all, but otherwise it gets the wrong
  104. // color
  105. &:disabled { color: $insensitive_fg_color; }
  106. &:backdrop:disabled { color: $backdrop_insensitive_color; }
  107. &:drop(active) {
  108. border-color: transparent;
  109. box-shadow: none;
  110. }
  111. entry {
  112. min-height: 32px;
  113. min-width: 32px;
  114. padding: 0;
  115. border-radius: 0;
  116. }
  117. button {
  118. min-height: 32px;
  119. min-width: 32px;
  120. padding: 0;
  121. border-width: 1px;
  122. border-color: $borders_color;
  123. box-shadow: 0 1px $top_highlight;
  124. &.up { @extend %top_button; }
  125. &.down { @extend %bottom_button; }
  126. }
  127. %top_button {
  128. border-radius: 3px 3px 0 0;
  129. border-style: solid solid none solid;
  130. }
  131. %bottom_button {
  132. border-radius: 0 0 3px 3px;
  133. border-style: none solid solid solid;
  134. }
  135. }
  136. // OSD vertical
  137. .osd &.vertical button:first-child {
  138. @include button(osd);
  139. &:hover { @include button(osd-hover);}
  140. &:active { @include button(osd-active); }
  141. &:disabled { @include button(osd-insensitive); }
  142. &:backdrop { @include button(osd-backdrop); }
  143. }
  144. // Misc
  145. treeview &:not(.vertical) {
  146. min-height: 0;
  147. border-style: none;
  148. border-radius: 0;
  149. entry {
  150. min-height: 0;
  151. padding: 1px 2px;
  152. }
  153. }
  154. }