Skip to content

Commit a6631a7

Browse files
committed
Use gnome platform 44, use Adw.TabOverview
1 parent 7d4d697 commit a6631a7

File tree

5 files changed

+177
-162
lines changed

5 files changed

+177
-162
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ toml = "0.5.6"
2828
serde = { version = "1.0.116", features = ["derive"] }
2929
env_logger = "0.8.1"
3030
log = "0.4.0"
31-
adw = { package = "libadwaita", version = "0.3", features = ["v1_2"]}
31+
adw = { package = "libadwaita", version = "0.3", features = ["v1_3"]}

build-aux/com.ranfdev.Geopard.Devel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app-id" : "com.ranfdev.Geopard.Devel",
33
"runtime" : "org.gnome.Platform",
4-
"runtime-version" : "43",
4+
"runtime-version" : "44",
55
"sdk" : "org.gnome.Sdk",
66
"sdk-extensions" : [
77
"org.freedesktop.Sdk.Extension.rust-stable",

build-aux/com.ranfdev.Geopard.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app-id" : "com.ranfdev.Geopard",
33
"runtime" : "org.gnome.Platform",
4-
"runtime-version" : "43",
4+
"runtime-version" : "44",
55
"sdk" : "org.gnome.Sdk",
66
"sdk-extensions" : [
77
"org.freedesktop.Sdk.Extension.rust-stable"

data/resources/ui/window.blp

Lines changed: 162 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -8,158 +8,41 @@ template GeopardWindow: Adw.ApplicationWindow {
88

99
[content]
1010
Gtk.Box {
11-
orientation: vertical;
12-
Adw.Squeezer squeezer {
13-
transition-type: crossfade;
14-
15-
Adw.HeaderBar {
16-
[start]
17-
Gtk.Box {
18-
Gtk.Button previous {
19-
icon-name: "go-previous-symbolic";
20-
action-name: "win.previous";
21-
tooltip-text: _("Go back one page\nRight-click to show history");
22-
}
23-
24-
Gtk.Popover previous_popover {
25-
autohide: true;
26-
has-arrow: false;
27-
}
28-
}
29-
30-
[start]
31-
Gtk.Box {
32-
Gtk.Button next {
33-
icon-name: "go-next-symbolic";
34-
action-name: "win.next";
35-
tooltip-text: _("Go forward one page\nRight-click to show history");
36-
}
37-
38-
Gtk.Popover next_popover {
39-
autohide: true;
40-
has-arrow: false;
41-
}
42-
}
43-
44-
[start]
45-
Gtk.Button {
46-
icon-name: "view-refresh-symbolic";
47-
action-name: "win.reload";
48-
tooltip-text: _("Reload current page");
49-
}
50-
51-
[start]
52-
Gtk.Button {
53-
icon-name: "tab-new-symbolic";
54-
action-name: "win.new-tab";
55-
tooltip-text: _("Open a new tab");
56-
}
57-
58-
[title]
59-
Adw.Clamp {
60-
maximum-size: 768;
61-
tightening-threshold: 720;
62-
width-request: 360;
63-
64-
Gtk.SearchEntry url_bar {
65-
hexpand: true;
66-
placeholder-text: _("Enter Gemini address or search with Geminispace");
67-
}
68-
}
69-
70-
[end]
71-
Gtk.MenuButton primary_menu_btn {
72-
icon-name: "open-menu";
73-
menu-model: primary_menu;
74-
tooltip-text: _("Main menu");
75-
}
76-
}
77-
78-
Gtk.WindowHandle header_small {
79-
Gtk.Box {
80-
margin-top: 6;
81-
margin-bottom: 6;
82-
margin-start: 6;
83-
margin-end: 6;
84-
spacing: 6;
85-
styles ["headerbar"]
86-
87-
Gtk.WindowControls ws {
88-
side: start;
89-
visible: bind ws.empty inverted;
90-
}
91-
92-
[title]
93-
Gtk.SearchEntry small_url_bar {
94-
hexpand: true;
95-
placeholder-text: _("Enter Gemini address or search with Geminispace");
96-
}
97-
98-
Gtk.WindowControls we {
99-
side: end;
100-
visible: bind we.empty inverted;
101-
}
102-
}
103-
}
104-
}
105-
106-
Adw.TabBar tab_bar {
11+
Adw.TabOverview tab_overview {
10712
view: tab_view;
108-
}
109-
110-
Gtk.Overlay {
111-
Adw.TabView tab_view {
112-
vexpand: true;
113-
hexpand: true;
114-
}
115-
116-
[overlay]
117-
Gtk.ProgressBar progress_bar {
118-
styles ["osd"]
119-
valign: start;
120-
text: bind GeopardWindow.progress;
121-
}
122-
123-
[overlay]
13+
enable-new-tab: true;
12414
Gtk.Box {
12515
orientation: vertical;
126-
valign: end;
127-
128-
Gtk.Box url_status_box {
129-
visible: false;
130-
styles ["background"]
131-
132-
Gtk.Label url_status {
133-
xalign: 0.0;
134-
ellipsize: end;
135-
margin-top: 6;
136-
margin-bottom: 6;
137-
margin-start: 6;
138-
margin-end: 6;
139-
}
140-
}
141-
142-
Gtk.Revealer bottom_bar_revealer {
143-
transition-type: slide_up;
144-
valign: end;
145-
146-
[child]
147-
Adw.HeaderBar bottom_bar {
148-
show-end-title-buttons: false;
149-
show-start-title-buttons: false;
16+
Adw.Squeezer squeezer {
17+
transition-type: crossfade;
15018

19+
Adw.HeaderBar {
15120
[start]
152-
Gtk.Button {
153-
icon-name: "go-previous-symbolic";
154-
action-name: "win.previous";
155-
tooltip-text: _("Go back one page\nRight-click to show history");
21+
Gtk.Box {
22+
Gtk.Button previous {
23+
icon-name: "go-previous-symbolic";
24+
action-name: "win.previous";
25+
tooltip-text: _("Go back one page\nRight-click to show history");
26+
}
27+
28+
Gtk.Popover previous_popover {
29+
autohide: true;
30+
has-arrow: false;
31+
}
15632
}
15733

15834
[start]
159-
Gtk.Button {
160-
icon-name: "go-next-symbolic";
161-
action-name: "win.next";
162-
tooltip-text: _("Go forward one page\nRight-click to show history");
35+
Gtk.Box {
36+
Gtk.Button next {
37+
icon-name: "go-next-symbolic";
38+
action-name: "win.next";
39+
tooltip-text: _("Go forward one page\nRight-click to show history");
40+
}
41+
42+
Gtk.Popover next_popover {
43+
autohide: true;
44+
has-arrow: false;
45+
}
16346
}
16447

16548
[start]
@@ -169,25 +52,150 @@ template GeopardWindow: Adw.ApplicationWindow {
16952
tooltip-text: _("Reload current page");
17053
}
17154

172-
[title]
55+
[start]
17356
Gtk.Button {
174-
icon-name: "system-search-symbolic";
175-
action-name: "win.focus-url-bar";
176-
tooltip-text: _("Start searching");
57+
icon-name: "tab-new-symbolic";
58+
action-name: "win.new-tab";
59+
tooltip-text: _("Open a new tab");
60+
}
61+
62+
[title]
63+
Adw.Clamp {
64+
maximum-size: 768;
65+
tightening-threshold: 720;
66+
width-request: 360;
67+
68+
Gtk.SearchEntry url_bar {
69+
hexpand: true;
70+
placeholder-text: _("Enter Gemini address or search with Geminispace");
71+
}
17772
}
17873

17974
[end]
180-
Gtk.MenuButton {
75+
Gtk.MenuButton primary_menu_btn {
18176
icon-name: "open-menu";
18277
menu-model: primary_menu;
18378
tooltip-text: _("Main menu");
18479
}
80+
}
18581

186-
[end]
187-
Gtk.Button {
188-
icon-name: "tab-new-symbolic";
189-
action-name: "win.new-tab";
190-
tooltip-text: _("Open a new tab");
82+
Gtk.WindowHandle header_small {
83+
Gtk.Box {
84+
margin-top: 6;
85+
margin-bottom: 6;
86+
margin-start: 6;
87+
margin-end: 6;
88+
spacing: 6;
89+
styles ["headerbar"]
90+
91+
Gtk.WindowControls ws {
92+
side: start;
93+
visible: bind ws.empty inverted;
94+
}
95+
96+
[title]
97+
Gtk.SearchEntry small_url_bar {
98+
hexpand: true;
99+
placeholder-text: _("Enter Gemini address or search with Geminispace");
100+
}
101+
102+
Gtk.WindowControls we {
103+
side: end;
104+
visible: bind we.empty inverted;
105+
}
106+
}
107+
}
108+
}
109+
110+
Gtk.Revealer tab_bar_revealer {
111+
Adw.TabBar tab_bar {
112+
view: tab_view;
113+
}
114+
}
115+
116+
Gtk.Overlay {
117+
Adw.TabView tab_view {
118+
vexpand: true;
119+
hexpand: true;
120+
}
121+
122+
[overlay]
123+
Gtk.ProgressBar progress_bar {
124+
styles ["osd"]
125+
valign: start;
126+
text: bind GeopardWindow.progress;
127+
}
128+
129+
[overlay]
130+
Gtk.Box {
131+
orientation: vertical;
132+
valign: end;
133+
134+
Gtk.Box url_status_box {
135+
visible: false;
136+
styles ["background"]
137+
138+
Gtk.Label url_status {
139+
xalign: 0.0;
140+
ellipsize: end;
141+
margin-top: 6;
142+
margin-bottom: 6;
143+
margin-start: 6;
144+
margin-end: 6;
145+
}
146+
}
147+
148+
Gtk.Revealer bottom_bar_revealer {
149+
transition-type: slide_up;
150+
valign: end;
151+
152+
[child]
153+
Adw.HeaderBar bottom_bar {
154+
show-end-title-buttons: false;
155+
show-start-title-buttons: false;
156+
157+
[start]
158+
Gtk.Button {
159+
icon-name: "go-previous-symbolic";
160+
action-name: "win.previous";
161+
tooltip-text: _("Go back one page\nRight-click to show history");
162+
}
163+
164+
[start]
165+
Gtk.Button {
166+
icon-name: "go-next-symbolic";
167+
action-name: "win.next";
168+
tooltip-text: _("Go forward one page\nRight-click to show history");
169+
}
170+
171+
[start]
172+
Gtk.Button {
173+
icon-name: "view-refresh-symbolic";
174+
action-name: "win.reload";
175+
tooltip-text: _("Reload current page");
176+
}
177+
178+
[title]
179+
Gtk.Button {
180+
icon-name: "system-search-symbolic";
181+
action-name: "win.focus-url-bar";
182+
tooltip-text: _("Start searching");
183+
}
184+
185+
[end]
186+
Gtk.MenuButton {
187+
icon-name: "open-menu";
188+
menu-model: primary_menu;
189+
tooltip-text: _("Main menu");
190+
}
191+
192+
[end]
193+
Gtk.Button {
194+
icon-name: "view-grid-symbolic";
195+
action-name: "overview.open";
196+
tooltip-text: _("Open tab overview");
197+
}
198+
}
191199
}
192200
}
193201
}

0 commit comments

Comments
 (0)