_header-bars.scss 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. /***************
  2. * Header bars *
  3. ***************/
  4. %titlebar,
  5. headerbar {
  6. padding: 0 6px;
  7. min-height: 34px;
  8. background-color: $headerbar_color;
  9. color: $headerbar_fg_color;
  10. border-radius: 0;
  11. &:backdrop {
  12. border-color: $backdrop_borders_color;
  13. background-image: none;
  14. transition: $backdrop_transition;
  15. }
  16. .title {
  17. font-weight: bold;
  18. padding-left: 12px;
  19. padding-right: 12px;
  20. }
  21. .subtitle {
  22. font-size: smaller;
  23. padding-left: 12px;
  24. padding-right: 12px;
  25. @extend .dim-label;
  26. }
  27. %linked-header {
  28. border: none;
  29. border-radius: 7px;
  30. border-right-style: none;
  31. box-shadow: none;
  32. // &:first-child {
  33. // border-top-left-radius: 7px;
  34. // border-bottom-left-radius: 0px;
  35. // }
  36. // &:last-child {
  37. // border-top-right-radius: 0px;
  38. // border-bottom-right-radius: 0px;
  39. // border-right-style: solid;
  40. // }
  41. // &:only-child {
  42. // border-radius: 0px;
  43. // border-style: solid;
  44. // }
  45. }
  46. entry { min-height: 24px; }
  47. button {
  48. @include button(normal-header);
  49. min-height: 30px;
  50. margin-top: 5px;
  51. margin-bottom: 5px;
  52. &:hover {
  53. @include button(hover-header, transparent, $purple);
  54. }
  55. &:active,
  56. &:checked {
  57. @include button(active-header, red, $purple);
  58. }
  59. &:backdrop,
  60. &:disabled,
  61. &:backdrop:disabled {
  62. @include button(backdrop-header,transparent,transparentize(white,0.7));
  63. }
  64. &:backdrop {
  65. &:hover,
  66. &:active,
  67. &:checked {
  68. background-color: transparent;
  69. color: $selected_bg_color;
  70. box-shadow: none;
  71. // @include button(hover-header,transparent,transparentize(white,0.7));
  72. }
  73. }
  74. @each $b_type, $b_color in (suggested-action, $cyan),
  75. (destructive-action, $destructive_color) {
  76. &.#{$b_type} {
  77. font-weight: bold;
  78. min-height: 24px;
  79. margin-top: 4px;
  80. margin-bottom: 4px;
  81. border-radius: 3px;
  82. @include button(normal, $b_color, white);
  83. &:hover { @include button(hover, $b_color, white); }
  84. &:active { @include button(active, $b_color, white); }
  85. &:disabled {
  86. @include button(insensitive, $b_color, white);
  87. label {color: transparentize(white,0.5);}
  88. }
  89. &:backdrop {
  90. @include button(backdrop, $b_color, white);
  91. border-radius: 3px;
  92. }
  93. &:backdrop:disabled { @include button(backdrop-insensitive, $b_color, white); }
  94. }
  95. }
  96. //Reset style
  97. &.titlebutton {
  98. color: transparent;
  99. box-shadow: none;
  100. &:hover,
  101. &:active,
  102. &:checked,
  103. &:backdrop,
  104. &:backdrop:hover,* {
  105. color: transparent;
  106. box-shadow: none;
  107. }
  108. }
  109. }
  110. .linked > button,
  111. .linked > button:hover,
  112. .linked > button:active,
  113. .linked > button:checked,
  114. .linked > button:backdrop { @extend %linked-header; }
  115. .linked > button:active,
  116. .linked > button:checked{
  117. &:backdrop{
  118. color: $backdrop_selected_bg_color;
  119. label{
  120. color: $backdrop_selected_bg_color;
  121. }
  122. }
  123. }
  124. // End reset style
  125. &.selection-mode {
  126. $_hc: mix($top_highlight,$selected_bg_color, 50%); // highlight color
  127. color: $selected_fg_color;
  128. text-shadow: 0 -1px transparentize(black, 0.5);
  129. border-color: $selected_borders_color;
  130. @include headerbar_fill($selected_bg_color, $_hc);
  131. &:backdrop {
  132. background-color: $selected_bg_color;
  133. background-image: none;
  134. box-shadow: inset 0 1px mix($top_highlight, $selected_bg_color, 60%);
  135. }
  136. .subtitle:link { @extend *:link:selected; }
  137. button {
  138. @include button(normal, $selected_bg_color, $selected_fg_color);
  139. &.flat { @include button(undecorated); }
  140. &:hover { @include button(hover, $selected_bg_color, $selected_fg_color); }
  141. &:active,
  142. &:checked { @include button(active, $selected_bg_color, $selected_fg_color); }
  143. &:backdrop {
  144. &.flat, & {
  145. @include button(backdrop, $selected_bg_color, $selected_fg_color);
  146. -gtk-icon-effect: none;
  147. border-color: $selected_borders_color;
  148. &:active,
  149. &:checked {
  150. @include button(backdrop-active, $selected_bg_color, $selected_fg_color);
  151. border-color: $selected_borders_color;
  152. }
  153. &:disabled {
  154. @include button(backdrop-insensitive, $selected_bg_color, $selected_fg_color);
  155. border-color: $selected_borders_color;
  156. &:active, &:checked {
  157. @include button(backdrop-insensitive-active, $selected_bg_color, $selected_fg_color);
  158. border-color: $selected_borders_color;
  159. }
  160. }
  161. }
  162. }
  163. &.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
  164. &:disabled {
  165. @include button(insensitive, $selected_bg_color, $selected_fg_color);
  166. &:active,
  167. &:checked { @include button(insensitive-active, $selected_bg_color, $selected_fg_color); }
  168. }
  169. &.suggested-action {
  170. @include button(normal, $cyan, white);
  171. &:hover { @include button(hover, $cyan, white); }
  172. &:active { @include button(active, $cyan, white); }
  173. &:disabled { @include button(insensitive, $cyan, white); }
  174. &:backdrop { @include button(backdrop, $cyan, white); }
  175. &:backdrop:disabled { @include button(backdrop-insensitive, $cyan, white); }
  176. }
  177. }
  178. .selection-menu {
  179. &:backdrop, & {
  180. border-color: transparentize($selected_bg_color, 1);
  181. background-image: linear-gradient(to bottom, transparentize($selected_bg_color, 1), transparentize($selected_bg_color, 1));
  182. box-shadow: none;
  183. padding-left: 10px;
  184. padding-right: 10px;
  185. GtkArrow { -GtkArrow-arrow-scaling: 1; }
  186. .arrow {
  187. -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
  188. color: transparentize($selected_fg_color,0.5);
  189. -gtk-icon-shadow: none;
  190. }
  191. }
  192. }
  193. }
  194. .tiled &,
  195. .maximized & {
  196. &.titlebar {
  197. @if $variant == 'light' { box-shadow: none; }
  198. @else { box-shadow: inset 0 -1px $bottom_highlight; }
  199. }
  200. &:backdrop, & { border-radius: 0; }
  201. } // squared corners when the window is maximized or tiled
  202. &.default-decoration {
  203. padding: 4px;
  204. min-height: 28px;
  205. button.titlebutton {
  206. min-height: 26px;
  207. min-width: 26px;
  208. margin: 0;
  209. padding: 0;
  210. }
  211. }
  212. }
  213. headerbar {
  214. // add vertical margins to common widget on the headerbar to avoid them spanning the whole height
  215. entry,
  216. spinbutton,
  217. separator {
  218. margin-top: 5px;
  219. margin-bottom: 5px;
  220. }
  221. switch {
  222. margin-top: 10px;
  223. margin-bottom: 10px;
  224. }
  225. separator { background: transparent; }
  226. viewswitcher, switcher {
  227. > box.horizontal {
  228. > button.radio {
  229. image { margin-left: 7px; }
  230. label { margin-right: 7px; }
  231. margin: 0;
  232. padding: 0;
  233. border-radius: 0;
  234. }
  235. }
  236. }
  237. }
  238. .background:not(.tiled):not(.maximized) .titlebar {
  239. @if $variant == 'light' { box-shadow: inset 0 1px lighten($headerbar_color, 5%); }
  240. @else { box-shadow: inset 0 1px $top_highlight,inset 0 -1px $bottom_highlight; }
  241. &:backdrop, & {
  242. border-top-left-radius: 4px;
  243. border-top-right-radius: 4px;
  244. }
  245. }
  246. headerbar {
  247. window:not(.tiled):not(.maximized) separator:first-child + &, // tackles the paned container case
  248. window:not(.tiled):not(.maximized) &:first-child { &:backdrop, & { border-top-left-radius: 4px; }}
  249. window:not(.tiled):not(.maximized) &:last-child { &:backdrop, & { border-top-right-radius: 4px; }}
  250. }
  251. window { border-radius: 6px; }
  252. .titlebar:not(headerbar) {
  253. window.csd > & {
  254. // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
  255. padding: 0;
  256. background-color: transparent;
  257. background-image: none;
  258. border-style: none;
  259. border-color: transparent;
  260. box-shadow: none;
  261. }
  262. > separator {
  263. &, &:backdrop {
  264. background: $headerbar_color;
  265. }
  266. }
  267. @extend %titlebar;
  268. }