summaryrefslogtreecommitdiff
path: root/Redcore-daylight/gtk-3.20/scss/widgets/_view.scss
blob: ece8b414f356d540e85d4ad75c1fc98027f77e95 (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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
/***************
 ! Generic views
****************/

@include exports("view") {
    .view,
    %view {
        color: $text_color;
        background-color: $base_color;
        caret-color: $primary_caret_color;
        -gtk-secondary-caret-color: $secondary_caret_color;

        &:backdrop {
            color: $backdrop_text_color;
            background-color: $backdrop_base_color;
        }

        &:selected {
            &:focus, & {
                @extend %selected_items;

                border-radius: $roundness;
            }
        }
    }

    .view,
    textview {
        text {
            @extend %view;

            selection { &:focus, & { @extend %selected_items; } }
        }
    }

    textview border { background-color: mix($bg_color, $base_color, .5); }

    iconview { @extend .view; }
}


/************
! Treeview
*************/

@include exports("treeview") {
    .rubberband,
    rubberband {
        border: 1px solid darken($selected_bg_color, .1);
        background-color: transparentize(darken($selected_bg_color, .1), .8);
    }

    treeview entry {
        &:focus {
            &:dir(rtl), &:dir(ltr) { // specificity bump hack
                background-color: $base_color;
                transition-property: color, background;
            }
        }

        &.flat, & {
            border-radius: 0;
            background-image: none;
            background-color: $base_color;

            &:focus { border-color: $selected_bg_color; }
        }
    }

    %column_header_button {
        padding: ($spacing - 2px) ($spacing + 1px);
        border-radius: 0;
        background-image: none;
        text-shadow: none;
        border-style: none solid solid none;
        border-color: $bg_color;

        &:disabled {
            border-color: $bg_color;
            background-image: none;
        }

        &:backdrop {
            border-color: $backdrop_bg_color;
            border-style: none solid solid none;
            color: mix($backdrop_fg_color, $backdrop_bg_color, .5);
            background-image: none;
            background-color: $backdrop_base_color;

            &:disabled {
                border-color: $backdrop_bg_color;
                background-image: none;
            }
        }
    }

    treeview.view {
        -GtkTreeView-grid-line-width: 1;
        -GtkTreeView-grid-line-pattern: '';
        -GtkTreeView-tree-line-width: 1;
        -GtkTreeView-tree-line-pattern: '';

        border-left-color: mix($fg_color, $base_color, .5); // this is actually the tree lines color,
        border-top-color: $bg_color;                        // while this is the grid lines color, better then nothing

        rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props

        &:selected {
            &:focus, & {
                @extend %selected_items;

                border-radius: 0;
            }

            &:backdrop, & {
                border-left-color: mix($selected_fg_color, $selected_bg_color, .5);
                border-top-color: transparentize($fg_color, .9); // doesn't work unfortunatelly
            }
        }

        &:disabled {
            color: $insensitive_fg_color;

            &:selected {
                color: mix($selected_fg_color, $selected_bg_color, .4);

                &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, .3); }
            }

            &:backdrop { color: $backdrop_insensitive_color; }
        }

        &.separator {
            min-height: 2px;
            color: $bg_color;

            &:backdrop { color: transparentize($bg_color, .9); }
        }

        &:backdrop {
            border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, .5);
            border-top: $backdrop_bg_color;
        }

        &:drop(active) {
            border-style: solid none;
            border-width: 1px;
            border-color: $selected_borders_color;

            &.after { border-top-style: none; }

            &.before { border-bottom-style: none; }
        }

        &.expander {
            -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
            color: mix($base_color, $fg_color, .7);

            &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }

            &:hover { color: $fg_color; }

            &:selected {
                color: mix($selected_bg_color, $selected_fg_color, .7);

                &:hover { color: $selected_fg_color; }

                &:backdrop { color: mix($selected_bg_color, $backdrop_selected_fg_color, .7); }
            }

            &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }

            &:backdrop { color: mix($backdrop_base_color, $backdrop_fg_color, .7); }
        }

        &.progressbar { // progress bar in treeviews
            @if $variant == light { color: $base_color; }

            border-radius: $roundness;
            border: 1px solid $selected_borders_color;
            background-color: $selected_bg_color;
            //background-image: linear-gradient(to bottom, $selected_bg_color, darken($selected_bg_color, .1));
            //box-shadow: inset 0 1px $fg_color,
            //0 1px if($variant == 'light', transparentize($black, .8), transparentize($black, .9));

            &:selected {
                &:focus, & {
                    @if $variant == 'light' {
                        color: $selected_fg_color;
                        box-shadow: none;
                    } @else {
                        box-shadow: inset 0 1px transparentize($white, .95);
                    }

                    @include linear-gradient($selected_bg_color);
                    border-radius: $roundness;

                    &:backdrop {
                        @if $variant == 'light' {
                            color: $backdrop_selected_fg_color;
                            border-color: $selected_borders_color; // otherwise it gets inherited by .view(?!?)
                        } @else {
                            border-color: $backdrop_base_color;
                        }

                        background-color: mix($backdrop_base_color, $selected_bg_color, .9);
                    }
                }
                border: 1px solid mix($selected_bg_color, $selected_fg_color, .2);
            }

            &:disabled {
                @include linear-gradient($bg_color);
                border-color: border_insensitive($bg_color);
            }

            &:backdrop {
                @if $variant == 'light' {
                    color: $backdrop_base_color;
                } @else {
                    border-color: $backdrop_base_color;
                }

                background-image: none;
                box-shadow: none;
            }
        }

        &.trough { // progress bar trough in treeviews
            background-color: transparentize($fg_color, .9);
            border-radius: $roundness;

            &:selected {
                &:focus, & {
                    background-color: if($variant == 'light', transparentize($selected_fg_color, .7), darken($selected_bg_color, .1));

                    @if $variant == 'light' {
                        border-width: 1px 0;
                        border-style: solid;
                        border-color: $selected_bg_color;
                    }
                    border-radius: $roundness;
                }
            }
        }

        header {
            button {
                $_column_header_color: mix($fg_color, $base_color, .5);

                @extend %column_header_button;

                color: $_column_header_color;
                background-color: $base_color;
                font-weight: bold;
                text-shadow: none;
                box-shadow: none;

                &:hover {
                    @extend %column_header_button;

                    color: mix($_column_header_color, $fg_color, .5);
                    box-shadow: none;
                    transition: none; //I shouldn't need this
                }

                &:active {
                    @extend %column_header_button;

                    color: $fg_color;
                    transition: none; //I shouldn't need this
                }
            }

            button:last-child { &:backdrop, & { border-right-style: none; } }
        }

        button.dnd,
        header.button.dnd { // for treeview-like derive widgets
            &:active, &:selected, &:hover, & {
                padding: 0 6px;
                transition: none;
                background-image: none;
                background-color: $selected_bg_color;
                color: $base_color;
                border-radius: 0;
                border-style: none;
                box-shadow: inset 0 0 0 1px $base_color;
                text-shadow: none;
            }
        }

        acceleditor > label { background-color: $selected_bg_color; }
    }
}


/***********
 ! Separator
************/

@include exports("separator") {
    separator { // vbox and hbox separators
        background: transparentize($black, .9);
        min-width: 1px;
        min-height: 1px;
    }
}


/**********
 ! Frames *
***********/

@include exports("frame") {
    frame > border, .frame {
        border: 1px solid $borders_color;

        &.flat { border-style: none; }

        &:backdrop { border-color: $backdrop_borders_color; }
    }

    /* avoid double borders when a viewport is packed into a GtkScrolledWindow */
    scrolledwindow viewport.frame { border: 0; }
}


/***************
 ! Places view *
****************/

@include exports("placesview") {
    placesview {
        .server-list-button > image {
            transition: 200ms cubic-bezier(.25, .46, .45, .94);
            -gtk-icon-transform: rotate(0turn);
        }

        .server-list-button:checked > image {
            transition: 200ms cubic-bezier(.25, .46, .45, .94);
            -gtk-icon-transform: rotate(-0.5turn);
        }

        row.activatable:hover { background-color: transparent; }

        // this selects the "connect to server" label
        > actionbar > revealer > box > label {
            padding-left: 8px;
            padding-right: 8px;
        }
    }
}