Skip to content

Commit 117c47b

Browse files
committed
Use classic notebook style from libadwaita
1 parent 842acc4 commit 117c47b

File tree

3 files changed

+63
-39
lines changed

3 files changed

+63
-39
lines changed

src/sass/_libhandy.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,7 @@ window.csd.unified list.content spinbutton {
917917
// Other fixes
918918
window.csd.unified .titlebar {
919919
border-bottom: 0;
920+
box-shadow: none;
920921
}
921922

922923
window.csd.unified .sidebar {

src/sass/gtk4/libadwaita-tweaks.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
--accent-purple: #9141ac;
2020
--accent-slate: #6f8396;
2121

22-
--accent-color: var(--accent-bg-color);
2322
--accent-bg-color: var(--accent-blue);
2423
--accent-fg-color: @accent_fg_color;
2524

2625
--window-bg-color: @window_bg_color;
2726
--headerbar-bg-color: @headerbar_bg_color;
2827
}
2928

30-
// add a bg color to notebook headers
29+
// Some apps don't like transparency or don't style this
30+
// https://github.com/lassekongo83/adw-gtk3/issues/232
3131
notebook > header {
32-
background-color: var(--headerbar-bg-color);
33-
border-color: var(--headerbar-bg-color);
32+
background-color: var(--window-bg-color);
33+
border-color: var(--window-bg-color);
3434
}
3535

3636
// Better osd

src/sass/widgets/_notebook.scss

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,61 @@
22
@forward 'buttons';
33

44
notebook {
5-
&, &.frame { border: none; }
6-
75
> header {
8-
padding: 6px;
9-
border: none;
6+
padding: 1px;
7+
border-width: 0px;
8+
background-clip: padding-box;
109
background-color: $window_bg_color;
11-
box-shadow: none;
12-
border-color: transparent;
10+
border-color: $window_bg_color;
1311

14-
tabs { margin: 0px; }
12+
tabs { margin: -1px; }
1513

1614
&.top, &.bottom, &.left, &.right {
15+
> tabs > tab {
16+
&:hover { background-color: $hover_color; }
17+
}
18+
}
19+
20+
&.top {
1721
border-bottom-style: solid;
1822
> tabs {
19-
margin-bottom: 0px;
20-
> tab {
21-
padding: 2px 8px;
22-
border-radius: $button_radius;
23-
transition: $button_transition;
24-
background-color: transparent;
25-
26-
&:hover {
27-
background-color: $hover_color;
28-
}
29-
&:checked {
30-
background-color: $selected_color;
31-
&:hover { background-color: $selected_hover_color; }
32-
}
23+
margin-bottom: -2px;
24+
> tab:not(.reorderable-page) {
25+
&:hover { box-shadow: inset 0 -4px $border_color; }
26+
&:checked { box-shadow: inset 0 -4px $accent_bg_color; }
27+
}
28+
}
29+
}
30+
31+
&.bottom {
32+
border-top-style: solid;
33+
> tabs {
34+
margin-top: -2px;
35+
> tab:not(.reorderable-page) {
36+
&:hover { box-shadow: inset 0 4px $border_color; }
37+
&:checked { box-shadow: inset 0 4px $accent_bg_color; }
38+
}
39+
}
40+
}
41+
42+
&.left {
43+
border-right-style: solid;
44+
> tabs {
45+
margin-right: -2px;
46+
> tab:not(.reorderable-page) {
47+
&:hover { box-shadow: inset -4px 0 $border_color; }
48+
&:checked { box-shadow: inset -4px 0 $accent_bg_color; }
49+
}
50+
}
51+
}
52+
53+
&.right {
54+
border-left-style: solid;
55+
> tabs {
56+
margin-left: -2px;
57+
> tab:not(.reorderable-page) {
58+
&:hover { box-shadow: inset 4px 0 $border_color; }
59+
&:checked { box-shadow: inset 4px 0 $accent_bg_color; }
3360
}
3461
}
3562
}
@@ -89,11 +116,7 @@ notebook {
89116
min-width: 16px;
90117
border-radius: 0;
91118

92-
&:hover:not(:active):not(:backdrop) {
93-
background-clip: padding-box;
94-
background-image: none;
95-
background-color: transparentize(white, 0.7);
96-
border-color: transparent;
119+
&:hover:not(:active) {
97120
box-shadow: none;
98121
}
99122

@@ -105,8 +128,6 @@ notebook {
105128
min-width: 30px;
106129
padding: 3px 12px;
107130

108-
outline-offset: -5px;
109-
110131
color: $window_fg_color;
111132
font-weight: normal;
112133

@@ -115,22 +136,24 @@ notebook {
115136

116137
&.reorderable-page {
117138
-gtk-outline-radius: calc($button_radius + 2px);
118-
outline-width: 2px;
119-
outline-offset: -2px;
120-
outline-style: solid;
121-
outline-color: entry_focus_border();
139+
margin: 4px 2px;
140+
border-radius: $button_radius;
141+
@include focus-ring($transition: $button_transition);
122142

123143
&:hover {
124144
background-color: $hover_color;
145+
box-shadow: none;
125146
}
126147
&:checked {
127148
background-color: $selected_color;
149+
box-shadow: none;
128150
&:hover { background-color: $selected_hover_color; }
129151
}
130152
}
131153

132154
// colors the button like the label, overridden otherwise
133155
button.flat {
156+
color: gtkalpha(currentColor, 0.3);
134157
padding: 0;
135158
margin-top: 4px;
136159
margin-bottom: 4px;
@@ -161,8 +184,8 @@ notebook {
161184
&.top,
162185
&.bottom {
163186
tabs {
164-
padding-left: 0px;
165-
padding-right: 0px;
187+
padding-left: 4px;
188+
padding-right: 4px;
166189

167190
&:not(:only-child) {
168191
margin-left: 3px;
@@ -217,6 +240,6 @@ notebook {
217240
}
218241

219242
> stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
220-
background-color: $window_bg_color;
243+
background-color: $view_bg_color;
221244
}
222245
}

0 commit comments

Comments
 (0)