summaryrefslogtreecommitdiff
path: root/Redcore-nighttime/gtk-3.20/scss/widgets/_toolbar.scss
blob: 0b6f30e04253fe67c5fc0fb77173f6822f6d06c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
@import "button";


/*********
 ! Toolbar
**********/

@mixin toolbar($bg, $fg) {
    @include linear-gradient($bg);
    @include border($bg);

    color: $fg;

    &:disabled {
        @include linear-gradient(shade($bg, .9));

        color: mix($fg, $bg, .5);
    }

    .title {
        font-weight: bold;
        padding: 0 ($spacing * 2);
    }

    .subtitle {
        font-size: smaller;
        padding: 0 ($spacing * 2);
    }

    button { @include button($bg, $fg); }

    .linked > button { @include linked_button($bg); }

    combobox, button {
        padding: $spacing;

        &.text-button { padding: $spacing; }

        &.image-button { padding: $spacing; }
    }

    separator {
        &, &:disabled {
            color: shade($bg, ($contrast - .2));
            border-color: currentColor;

            -GtkWidget-window-dragging: true;
        }
    }
}

@mixin inline-toolbar($bg, $fg) {
    padding: 1px;
    border-width: 0 1px 1px;
    border-style: solid;
    border-color: $borders_color;
    background-color: mix($borders_color, $bg_color, .7);;
    background-image: none;

    &:backdrop {
        border-color: $backdrop_borders_color;
        background-color: $backdrop_dark_fill;
        transition: 200ms ease-out;
    }

    button { @include button($toolbar_bg_color, $toolbar_fg_color); }

    toolbutton,
    toolbutton:backdrop {
        > button.flat { @extend %linked_middle; }

        &:first-child > button.flat { @extend %linked_button:first-child; }

        &:last-child > button.flat { @extend %linked_button:last-child; }

        &:only-child > button.flat { @extend %linked_button:only-child; }
    }
}

@include exports("toolbar_extends") {
    %toolbar {
        padding: $spacing - 1px;
        border-style: none;

        // toolbar separators
        &.horizontal separator { margin: 0 ($spacing + 2px) 1px; }

        &.vertical separator { margin: ($spacing + 2px) 1px ($spacing + 2px) 0; }
    }

    %headerbar {
        border-width: 0 0 1px;
        border-style: solid;

        // add vertical margins to common widget on the headerbar to avoid them spanning the whole height
        entry,
        spinbutton,
        separator,
        button { // Size height
            margin-top: $spacing + 3px;
            margin-bottom: $spacing + 3px;
        }

        switch { // Size height
            margin-top: $spacing + 1px;
            margin-bottom: $spacing + 1px;
        }

        window:not(.tiled):not(.maximized) separator:first-child + &, // tackles the paned container case
        window:not(.tiled):not(.maximized) &:first-child { &:backdrop, & { border-top-left-radius: $roundness; } }

        window:not(.tiled):not(.maximized) &:last-child { &:backdrop, & { border-top-right-radius: $roundness; } }
    }

    %titlebar { // Default headerbar and titlebar code.
        @include toolbar($titlebar_bg_color, $titlebar_fg_color);
        @include linear-gradient($titlebar_bg_color);

        border-radius: $roundness $roundness 0 0;
        color: mix($titlebar_fg_color, $titlebar_bg_color, .1);
        padding: 0 $spacing * 2;
        min-height: 42px;

        &:backdrop {
            @include linear-gradient($titlebar_bg_color);

            color: mix($titlebar_fg_color, $titlebar_bg_color, .6);
            text-shadow: none;
        }

        &.default-decoration { // Default titlebar (old metacity)
            min-height: 24px;
            box-shadow: none;
            border: 0;

            button.titlebutton {
                min-height: 16px;
                min-width: 16px;
                margin: 0;
                padding: 0;
            }
        }

        .tiled &,
        .maximized & { &:backdrop, & { border-radius: 0; } } // squared corners when the window is maximized or tiled

        .title { font-weight: bold; }

        separator.titlebutton { margin-left: $spacing; }

        button {
            @include button($header_button_bg_color, $header_button_fg_color);
        }

        button.titlebutton + separator.titlebutton {
            margin-left: 0;
            margin-right: $spacing;
        }

        button.titlebutton {
            border: 0;
            background-image: none;
            background-color: transparent;
            color: mix($titlebar_fg_color, $titlebar_bg_color, .1);
            box-shadow: none;

            &:hover, &:hover:focus {
                background-image: none;
                background-color: transparent;
                color: $selected_bg_color;
                box-shadow: none;
            }

            &:active, &:active:hover {
                background-image: none;
                background-color: transparent;
                color: shade($selected_bg_color, .9);
                box-shadow: none;
            }

            &:backdrop {
                background: none;
                color: mix($titlebar_fg_color, $titlebar_bg_color, .6);
                -gtk-icon-shadow: none;
            }
        }
    }
}

@include exports("toolbar") {
    toolbar {
        @include toolbar($toolbar_bg_color, $toolbar_fg_color);

        @extend %toolbar;

        &.inline-toolbar { @include inline-toolbar($toolbar_bg_color, $toolbar_fg_color); }
    }

    headerbar {
        @extend %titlebar;
        @extend %headerbar;
    }

    .titlebar:not(headerbar) {
        window.csd > & {
            // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
            padding: 0;
            background-color: transparent;
            background-image: none;
            border-style: none;
            border-color: transparent;
            box-shadow: none;
        }

        > separator { background-color: shade($titlebar_bg_color, .88); }  // $borders_color

        @extend %titlebar;
    }

    .background:not(.tiled):not(.maximized) .titlebar {
        &:backdrop, & {
            border-top-left-radius: $roundness;
            border-top-right-radius: $roundness;
        }
    }

    // Fixed: https://github.com/numixproject/numix-gtk-theme/issues/585
    // workaround for ugly Ubuntu-related CSD patches
    .background:not(.csd):not(.ssd):not(.solid-csd) headerbar {
        &, &:backdrop {
            &, &:not(:last-child) {
                border-radius: 0;
                border-top-color: transparent;
            }
        }
    }
}