|
9 | 9 | @include linear-gradient($bg); |
10 | 10 | @include border($bg); |
11 | 11 |
|
12 | | - padding: $spacing * 2; |
13 | 12 | color: $fg; |
14 | 13 |
|
15 | 14 | &:disabled { |
|
33 | 32 | .linked > button { @include linked_button($bg); } |
34 | 33 |
|
35 | 34 | combobox, button { |
36 | | - padding: $spacing - 1px; |
| 35 | + padding: $spacing; |
37 | 36 |
|
38 | 37 | &.text-button { padding: $spacing; } |
39 | 38 |
|
40 | | - &.image-button { padding: ($spacing + 1px) ($spacing - 1px) ($spacing + 1px) $spacing; } |
| 39 | + &.image-button { padding: $spacing; } |
41 | 40 | } |
42 | 41 |
|
43 | | - // toolbar separators |
44 | | - &.horizontal separator { margin: 0 ($spacing + 2px) 1px ($spacing + 2px); } |
45 | | - |
46 | | - &.vertical separator { margin: ($spacing + 2px) 1px ($spacing + 2px) 0; } |
| 42 | + separator { |
| 43 | + &, &:disabled { |
| 44 | + color: shade($bg, ($contrast - .2)); |
| 45 | + border-color: currentColor; |
47 | 46 |
|
48 | | - separator, separator:disabled { |
49 | | - color: shade($bg, ($contrast - .2)); |
50 | | - border-color: currentColor; |
51 | | - |
52 | | - -GtkWidget-window-dragging: true; |
| 47 | + -GtkWidget-window-dragging: true; |
| 48 | + } |
53 | 49 | } |
54 | | - |
55 | | - .menubar, menubar { -GtkToolbar-button-relief: normal; } |
56 | 50 | } |
57 | 51 |
|
58 | | -@include exports("toolbar") { |
59 | | - toolbar { |
60 | | - @include toolbar($toolbar_bg_color, $toolbar_fg_color); |
| 52 | +@mixin inline-toolbar($bg, $fg) { |
| 53 | + background-image: none; |
| 54 | + border-width: 0 1px 1px; |
| 55 | + border-style: solid; |
| 56 | + border-color: $borders_color; |
| 57 | + background-color: mix($borders_color, $bg_color, .7); |
| 58 | + |
| 59 | + &:backdrop { |
| 60 | + border-color: $backdrop_borders_color; |
| 61 | + background-color: $backdrop_dark_fill; |
| 62 | + transition: 200ms ease-out; |
| 63 | + } |
61 | 64 |
|
62 | | - border-style: none; |
| 65 | + button { @include button($toolbar_bg_color, $toolbar_fg_color); } |
63 | 66 |
|
64 | | - &.inline-toolbar { |
65 | | - background-image: none; |
66 | | - border-width: 0 1px 1px; |
67 | | - border-style: solid; |
68 | | - border-color: $borders_color; |
69 | | - background-color: mix($borders_color, $bg_color, .7); |
| 67 | + toolbutton, |
| 68 | + toolbutton:backdrop { |
| 69 | + > button.flat { @extend %linked_middle; } |
70 | 70 |
|
71 | | - &:backdrop { |
72 | | - border-color: $backdrop_borders_color; |
73 | | - background-color: $backdrop_dark_fill; |
74 | | - transition: 200ms ease-out; |
75 | | - } |
| 71 | + &:first-child > button.flat { @extend %linked_button:first-child; } |
76 | 72 |
|
77 | | - button { @include button($toolbar_bg_color, $toolbar_fg_color); } |
| 73 | + &:last-child > button.flat { @extend %linked_button:last-child; } |
78 | 74 |
|
79 | | - toolbutton, |
80 | | - toolbutton:backdrop { |
81 | | - > button.flat { @extend %linked_middle; } |
| 75 | + &:only-child > button.flat { @extend %linked_button:only-child; } |
| 76 | + } |
| 77 | +} |
82 | 78 |
|
83 | | - &:first-child > button.flat { @extend %linked_button:first-child; } |
| 79 | +@include exports("toolbar_extends") { |
| 80 | + %toolbar { |
| 81 | + padding: $spacing - 1px; |
| 82 | + border-style: none; |
84 | 83 |
|
85 | | - &:last-child > button.flat { @extend %linked_button:last-child; } |
| 84 | + // toolbar separators |
| 85 | + &.horizontal separator { margin: 0 ($spacing + 2px) 1px; } |
86 | 86 |
|
87 | | - &:only-child > button.flat { @extend %linked_button:only-child; } |
88 | | - } |
89 | | - } |
| 87 | + &.vertical separator { margin: ($spacing + 2px) 1px ($spacing + 2px) 0; } |
90 | 88 | } |
91 | 89 |
|
92 | | - headerbar { |
93 | | - @include toolbar($titlebar_bg_color, $titlebar_fg_color); |
94 | | - |
| 90 | + %headerbar { |
95 | 91 | border-width: 0 0 1px; |
96 | 92 | border-style: solid; |
97 | 93 |
|
| 94 | + // add vertical margins to common widget on the headerbar to avoid them spanning the whole height |
| 95 | + entry, |
| 96 | + spinbutton, |
| 97 | + separator, |
| 98 | + switch, |
| 99 | + button { // Size height |
| 100 | + margin-top: $spacing + 3px; |
| 101 | + margin-bottom: $spacing + 3px; |
| 102 | + } |
| 103 | + |
| 104 | + switch { // Size height |
| 105 | + margin-top: $spacing + 1px; |
| 106 | + margin-bottom: $spacing + 1px; |
| 107 | + } |
| 108 | + |
98 | 109 | window:not(.tiled):not(.maximized) separator:first-child + &, // tackles the paned container case |
99 | 110 | window:not(.tiled):not(.maximized) &:first-child { &:backdrop, & { border-top-left-radius: $roundness; } } |
100 | 111 |
|
101 | 112 | window:not(.tiled):not(.maximized) &:last-child { &:backdrop, & { border-top-right-radius: $roundness; } } |
102 | 113 | } |
103 | 114 |
|
104 | | - .background:not(.tiled):not(.maximized) .titlebar { |
105 | | - &:backdrop, & { |
106 | | - border-top-left-radius: $roundness; |
107 | | - border-top-right-radius: $roundness; |
108 | | - } |
109 | | - } |
110 | | - |
111 | | - .titlebar { |
| 115 | + %titlebar { // Default headerbar and titlebar code. |
| 116 | + @include toolbar($titlebar_bg_color, $titlebar_fg_color); |
112 | 117 | @include linear-gradient($titlebar_bg_color); |
113 | 118 |
|
114 | 119 | border-radius: $roundness $roundness 0 0; |
115 | 120 | color: mix($titlebar_fg_color, $titlebar_bg_color, .1); |
| 121 | + padding: 0 $spacing; |
| 122 | + min-height: 42px; |
116 | 123 |
|
117 | 124 | &:backdrop { |
118 | 125 | @include linear-gradient($titlebar_bg_color); |
|
121 | 128 | text-shadow: none; |
122 | 129 | } |
123 | 130 |
|
124 | | - &.default-decoration { |
125 | | - border: 0; |
| 131 | + &.default-decoration { // Default titlebar (old metacity) |
| 132 | + min-height: 24px; |
126 | 133 | box-shadow: none; |
| 134 | + border: 0; |
| 135 | + |
| 136 | + button.titlebutton { |
| 137 | + min-height: 16px; |
| 138 | + min-width: 16px; |
| 139 | + margin: 0; |
| 140 | + padding: 0; |
| 141 | + } |
127 | 142 | } |
128 | 143 |
|
129 | | - .tiled &, .maximized & { border-radius: 0; } |
| 144 | + .tiled &, |
| 145 | + .maximized & { &:backdrop, & { border-radius: 0; } } // squared corners when the window is maximized or tiled |
130 | 146 |
|
131 | 147 | .title { font-weight: bold; } |
132 | 148 |
|
133 | | - separator.titlebutton { margin-left: $spacing * 2; } |
| 149 | + separator.titlebutton { margin-left: $spacing; } |
134 | 150 |
|
135 | 151 | button.titlebutton + separator.titlebutton { |
136 | 152 | margin-left: 0; |
137 | | - margin-right: $spacing * 2; |
| 153 | + margin-right: $spacing; |
138 | 154 | } |
139 | 155 |
|
140 | 156 | button.titlebutton { |
141 | | - padding: $spacing; |
142 | 157 | border: 0; |
143 | 158 | background-image: none; |
144 | 159 | background-color: transparent; |
|
167 | 182 | } |
168 | 183 | } |
169 | 184 | } |
| 185 | + |
| 186 | +@include exports("toolbar") { |
| 187 | + toolbar { |
| 188 | + @include toolbar($toolbar_bg_color, $toolbar_fg_color); |
| 189 | + |
| 190 | + @extend %toolbar; |
| 191 | + |
| 192 | + &.inline-toolbar { @include inline-toolbar($toolbar_bg_color, $toolbar_fg_color); } |
| 193 | + } |
| 194 | + |
| 195 | + headerbar { |
| 196 | + @extend %titlebar; |
| 197 | + @extend %headerbar; |
| 198 | + } |
| 199 | + |
| 200 | + .titlebar:not(headerbar) { |
| 201 | + window.csd > & { |
| 202 | + // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases |
| 203 | + padding: 0; |
| 204 | + background-color: transparent; |
| 205 | + background-image: none; |
| 206 | + border-style: none; |
| 207 | + border-color: transparent; |
| 208 | + box-shadow: none; |
| 209 | + } |
| 210 | + |
| 211 | + > separator { background-color: shade($titlebar_bg_color, .88); } // $borders_color |
| 212 | + |
| 213 | + @extend %titlebar; |
| 214 | + } |
| 215 | + |
| 216 | + .background:not(.tiled):not(.maximized) .titlebar { |
| 217 | + &:backdrop, & { |
| 218 | + border-top-left-radius: $roundness; |
| 219 | + border-top-right-radius: $roundness; |
| 220 | + } |
| 221 | + } |
| 222 | +} |
0 commit comments