_header-bars.scss 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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: 0;
  30. border-right-style: none;
  31. box-shadow: none;
  32. &:first-child {
  33. border-top-left-radius: 0px;
  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: 24px;
  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, transparent, $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-filter: 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. .arrow {
  186. -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
  187. color: transparentize($selected_fg_color,0.5);
  188. -gtk-icon-shadow: none;
  189. }
  190. }
  191. }
  192. }
  193. .tiled &,
  194. .maximized & {
  195. &.titlebar {
  196. @if $variant == 'light' { box-shadow: none; }
  197. @else { box-shadow: inset 0 -1px $bottom_highlight; }
  198. }
  199. &:backdrop, & { border-radius: 0; }
  200. } // squared corners when the window is maximized or tiled
  201. &.default-decoration {
  202. padding: 4px;
  203. min-height: 28px;
  204. button.titlebutton {
  205. min-height: 26px;
  206. min-width: 26px;
  207. margin: 0;
  208. padding: 0;
  209. }
  210. }
  211. }
  212. headerbar {
  213. // add vertical margins to common widget on the headerbar to avoid them spanning the whole height
  214. entry,
  215. spinbutton,
  216. separator:not(.sidebar),
  217. button,
  218. menubutton {
  219. margin-top: 5px;
  220. margin-bottom: 5px;
  221. }
  222. // Reset margins for buttons inside menubutton
  223. menubutton > button,
  224. spinbutton > button,
  225. splitbutton > button,
  226. splitbutton > menubutton,
  227. entry > menubutton {
  228. margin-top: 0px;
  229. margin-bottom: 0px;
  230. }
  231. switch {
  232. margin-top: 0;
  233. margin-bottom: 0;
  234. }
  235. separator { background: transparent; }
  236. }
  237. .background:not(.tiled):not(.maximized) .titlebar {
  238. @if $variant == 'light' { box-shadow: inset 0 1px lighten($headerbar_color, 5%); }
  239. @else { box-shadow: inset 0 1px $top_highlight,inset 0 -1px $bottom_highlight; }
  240. &:backdrop, & {
  241. border-top-left-radius: 4px;
  242. border-top-right-radius: 4px;
  243. }
  244. }
  245. headerbar {
  246. window:not(.tiled):not(.maximized) separator:first-child + &, // tackles the paned container case
  247. window:not(.tiled):not(.maximized) &:first-child { &:backdrop, & { border-top-left-radius: 4px; }}
  248. window:not(.tiled):not(.maximized) &:last-child { &:backdrop, & { border-top-right-radius: 4px; }}
  249. }
  250. .titlebar:not(headerbar) {
  251. window.csd > & {
  252. // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
  253. padding: 0;
  254. background-color: transparent;
  255. background-image: none;
  256. border-style: none;
  257. border-color: transparent;
  258. box-shadow: none;
  259. }
  260. > separator {
  261. &, &:backdrop {
  262. background: $headerbar_color;
  263. }
  264. }
  265. @extend %titlebar;
  266. }