focus on your browsing
browser
web-browser
1using Gtk 4.0;
2using Adw 1;
3
4Adw.TabOverview overview {
5 enable-new-tab: true;
6 view: view;
7
8 Adw.ToastOverlay toast_overlay {
9 Adw.ToolbarView {
10 Adw.OverlaySplitView osv {
11 show-sidebar: bind sidebar_toggle.active;
12 min-sidebar-width: 225;
13 max-sidebar-width: 225;
14
15 sidebar: Adw.NavigationPage sidebar {
16 title: _("Ouch Browser");
17
18 Adw.ToolbarView sidebar_toolbar {
19 [top]
20 CenterBox {
21 margin-top: 6;
22 margin-start: 6;
23 margin-bottom: 6;
24
25 start-widget: Box {
26 orientation: horizontal;
27 spacing: 6;
28
29 WindowControls left_controls {
30 side: start;
31 }
32
33 MenuButton {
34 icon-name: "site.srht.shrimple.OuchBrowser-symbolic";
35 tooltip-text: _("Menu");
36 menu-model: main_menu;
37 focus-on-click: false;
38
39 styles [
40 "flat",
41 ]
42 }
43
44 ToggleButton sidebar_toggle {
45 active: true;
46 icon-name: "sidebar-show-symbolic";
47 tooltip-text: _("Hide Sidebar");
48 sensitive: false;
49 margin-end: 6;
50 focus-on-click: false;
51
52 styles [
53 "flat",
54 ]
55 }
56 };
57
58 end-widget: Box {
59 orientation: horizontal;
60 spacing: 5;
61 margin-end: 10;
62
63 Button go_back {
64 icon-name: "go-previous-symbolic";
65 tooltip-text: _("Back");
66 action-name: "win.go-back";
67 focus-on-click: false;
68
69 styles [
70 "flat",
71 ]
72 }
73
74 Button go_forward {
75 icon-name: "go-next-symbolic";
76 tooltip-text: _("Forward");
77 action-name: "win.go-forward";
78 focus-on-click: false;
79
80 styles [
81 "flat",
82 ]
83 }
84
85 Button refresh {
86 icon-name: "view-refresh-symbolic";
87 tooltip-text: _("Refresh");
88 action-name: "win.refresh";
89 focus-on-click: false;
90
91 styles [
92 "flat",
93 ]
94 }
95 };
96 }
97
98 Box {
99 orientation: vertical;
100
101 Separator {
102 orientation: vertical;
103
104 styles [
105 "spacer",
106 ]
107 }
108
109 Box {
110 orientation: horizontal;
111 margin-start: 10;
112 margin-end: 10;
113
114 Button url_button {
115 hexpand: true;
116 sensitive: false;
117 action-name: "win.palette";
118 focus-on-click: false;
119
120 Label hostname {
121 label: "";
122 ellipsize: end;
123 tooltip-text: _("Reveal Command Palette");
124
125 styles [
126 "font-medium",
127 "dimmed",
128 ]
129 }
130 }
131
132 Button copy_link {
133 icon-name: "chain-link-loose-symbolic";
134 tooltip-text: _("Copy Link");
135 action-name: "win.copy-link";
136 focus-on-click: false;
137 }
138
139 MenuButton website_settings {
140 icon-name: "sliders-horizontal-symbolic";
141 tooltip-text: _("Website Settings");
142 focus-on-click: false;
143
144 popover: Popover {
145 width-request: 300;
146
147 styles [
148 "website-settings",
149 ]
150
151 Adw.StatusPage {
152 icon-name: "sliders-horizontal-symbolic";
153 title: _("No Website Settings Available");
154
155 styles [
156 "compact",
157 ]
158 }
159 };
160 }
161
162 styles [
163 "linked",
164 ]
165 }
166
167 Separator {
168 orientation: vertical;
169
170 styles [
171 "spacer",
172 ]
173 }
174
175 Label {
176 label: "Main";
177 halign: start;
178 margin-start: 14;
179 margin-end: 10;
180
181 styles [
182 "caption-heading",
183 "dimmed",
184 ]
185 }
186
187 Separator {
188 orientation: horizontal;
189 margin-top: 10;
190 margin-bottom: 10;
191 margin-start: 14;
192 margin-end: 10;
193 }
194
195 Button {
196 margin-start: 10;
197 margin-end: 10;
198 margin-bottom: 6;
199 action-name: "win.palette-new";
200 focus-on-click: false;
201
202 Box {
203 spacing: 10;
204
205 Image {
206 icon-name: "list-add-symbolic";
207
208 styles [
209 "dimmed",
210 ]
211 }
212
213 Label {
214 label: _("New Tab");
215
216 styles [
217 "dimmed",
218 "font-medium",
219 ]
220 }
221 }
222
223 styles [
224 "flat",
225 "new-tab",
226 ]
227 }
228
229 ScrolledWindow {
230 vscrollbar-policy: external;
231
232 Box {
233 orientation: vertical;
234 margin-end: 10;
235
236 ListView tabs {
237 vexpand: true;
238 model: bind view.pages;
239
240 factory: BuilderListItemFactory {
241 template ListItem {
242 child: CenterBox {
243 start-widget: Box {
244 spacing: 10;
245
246 Image tab_icon {
247 gicon: bind template.item as <Adw.TabPage>.icon;
248 visible: bind spinner.visible inverted;
249 }
250
251 Adw.Spinner spinner {
252 width-request: 16;
253 height-request: 16;
254 visible: bind template.item as <Adw.TabPage>.loading;
255 }
256
257 Label {
258 label: bind template.item as <Adw.TabPage>.title;
259 ellipsize: end;
260 halign: start;
261 hexpand: true;
262 tooltip-text: bind template.item as <Adw.TabPage>.keyword;
263 }
264 };
265
266 end-widget: Button {
267 icon-name: "window-close-symbolic";
268 valign: center;
269 margin-start: 2;
270 visible: bind template.item as <Adw.TabPage>.selected;
271 tooltip-text: _("Close Tab");
272 action-name: "win.tab-close";
273 focus-on-click: false;
274
275 styles [
276 "flat",
277 "circular",
278 "tab-close",
279 ]
280 };
281 };
282 }
283 };
284
285 styles [
286 "navigation-sidebar",
287 ]
288 }
289 }
290 }
291 }
292
293 [bottom]
294 CenterBox {
295 margin-bottom: 6;
296 margin-start: 6;
297 margin-top: 6;
298
299 start-widget: MenuButton {
300 icon-name: "shoe-box-symbolic";
301 tooltip-text: _("Archive");
302 menu-model: archive_menu;
303 focus-on-click: false;
304
305 styles [
306 "flat",
307 ]
308 };
309
310 /* center-widget: Adw.ToggleGroup {
311 active-name: "space-1";
312
313 Adw.Toggle {
314 icon-name: "dot-symbolic";
315 name: "space-1";
316 }
317
318 Adw.Toggle {
319 icon-name: "dot-symbolic";
320 name: "space-2";
321 }
322 }; */
323 end-widget: Box {
324 orientation: horizontal;
325 margin-end: 10;
326 css-name: "splitbutton";
327
328 styles [
329 "image-button",
330 "flat",
331 ]
332
333 Button {
334 icon-name: "tab-new-symbolic";
335 tooltip-text: _("New Tab");
336 action-name: "win.palette-new";
337 focus-on-click: false;
338 }
339
340 Separator {
341 orientation: vertical;
342 }
343
344 MenuButton {
345 menu-model: new_menu;
346 tooltip-text: _("New…");
347 focus-on-click: false;
348
349 Image {
350 icon-name: "pan-down-symbolic";
351 }
352 }
353 };
354 }
355 }
356
357 styles [
358 "background",
359 ]
360 };
361
362 content: Adw.NavigationPage {
363 title: _("Ouch Browser");
364
365 Adw.ToolbarView content_toolbar {
366 reveal-top-bars: false;
367 reveal-bottom-bars: bind osv.collapsed;
368 top-bar-style: raised;
369 extend-content-to-top-edge: true;
370
371 [top]
372 Adw.HeaderBar content_headerbar {
373 show-title: false;
374
375 styles [
376 "content-top-bar",
377 ]
378
379 [start]
380 Button content_sidebar_toggle {
381 icon-name: "sidebar-show-symbolic";
382 tooltip-text: _("Show Sidebar");
383 visible: bind osv.show-sidebar inverted;
384 focus-on-click: false;
385
386 styles [
387 "flat",
388 ]
389 }
390 }
391
392 [bottom]
393 Box {
394 orientation: horizontal;
395 margin-top: 10;
396 margin-bottom: 10;
397 margin-start: 10;
398 margin-end: 10;
399 spacing: 5;
400
401 Button {
402 icon-name: "go-previous-symbolic";
403 tooltip-text: _("Back");
404 action-name: "win.go-back";
405 focus-on-click: false;
406
407 styles [
408 "flat",
409 ]
410 }
411
412 Box {
413 orientation: horizontal;
414
415 styles [
416 "linked",
417 ]
418
419 Adw.TabButton {
420 view: view;
421 action-name: "overview.open";
422 focus-on-click: false;
423 }
424
425 Button {
426 hexpand: true;
427 sensitive: false;
428 action-name: "win.palette";
429
430 Label {
431 label: "example.com";
432 margin-start: 6;
433 margin-end: 6;
434 ellipsize: end;
435 tooltip-text: _("Reveal Command Palette");
436 focus-on-click: false;
437
438 styles [
439 "font-medium",
440 "dimmed",
441 ]
442 }
443 }
444
445 Button {
446 icon-name: "view-refresh-symbolic";
447 tooltip-text: _("Refresh");
448 action-name: "win.refresh";
449 focus-on-click: false;
450 }
451 }
452
453 Button {
454 icon-name: "go-next-symbolic";
455 tooltip-text: _("Forward");
456 action-name: "win.go-forward";
457 focus-on-click: false;
458
459 styles [
460 "flat",
461 ]
462 }
463 }
464
465 Overlay {
466 [overlay]
467 Adw.Bin topbar_hover {
468 height-request: 30;
469 hexpand: true;
470 valign: start;
471 }
472
473 Box {
474 orientation: vertical;
475
476 Frame frame {
477 // margin-start: 10;
478 margin-end: 10;
479 margin-top: 10;
480 margin-bottom: 10;
481 hexpand: true;
482 vexpand: true;
483
484 Adw.TabView view {
485 receives-default: true;
486
487 styles [
488 "view",
489 ]
490 }
491 }
492 }
493 }
494 }
495 };
496 }
497 }
498 }
499}
500
501Adw.Dialog url_dialog {
502 presentation-mode: auto;
503 can-close: false;
504 follows-content-size: false;
505
506 Adw.Clamp {
507 Box {
508 orientation: vertical;
509 spacing: 10;
510
511 Box {
512 orientation: horizontal;
513 margin-top: 10;
514 margin-start: 10;
515 margin-end: 10;
516 spacing: 5;
517
518 Image {
519 icon-name: "site.srht.shrimple.OuchBrowser-symbolic";
520 pixel-size: 20;
521 margin-start: 10;
522
523 styles [
524 "dimmed",
525 ]
526 }
527
528 Entry url_entry {
529 input-purpose: url;
530 hexpand: true;
531 placeholder-text: _("Search or enter URL…");
532 receives-default: true;
533 width-request: 500;
534
535 styles [
536 "command-palette",
537 ]
538 }
539
540 Button url_bar_button {
541 icon-name: "go-next-symbolic";
542 visible: false;
543
544 styles [
545 "suggested-action",
546 ]
547 }
548 }
549
550 Separator {
551 orientation: horizontal;
552 }
553
554 /* Box {
555 orientation: vertical;
556 margin-top: 10;
557 margin-bottom: 10;
558 margin-start: 10;
559 margin-end: 10;
560 spacing: 10;
561
562 Adw.ActionRow {
563 title: "what is y2k";
564 subtitle: "Search on Google";
565 }
566
567 Adw.ActionRow {
568 title: "what is yapping";
569 subtitle: "Search on Google";
570 }
571 }
572
573 Separator {
574 orientation: horizontal;
575 } */
576 CenterBox {
577 margin-bottom: 10;
578 margin-start: 10;
579 margin-end: 10;
580
581 start-widget: Box {
582 orientation: horizontal;
583 spacing: 10;
584
585 Adw.ShortcutLabel {
586 accelerator: "Return";
587 opacity: 0.75;
588 }
589
590 Label {
591 label: _("Go");
592
593 styles [
594 "dimmed",
595 ]
596 }
597 };
598
599 end-widget: Box {
600 orientation: horizontal;
601 spacing: 10;
602 visible: bind url_dialog.can-close;
603
604 Label {
605 label: _("Close Palette");
606
607 styles [
608 "dimmed",
609 ]
610 }
611
612 Adw.ShortcutLabel {
613 accelerator: "Escape";
614 opacity: 0.75;
615 }
616 };
617 }
618 }
619 }
620}
621
622menu archive_menu {
623 section {
624 label: _("Archive");
625 item (_("History"))
626 item (_("Downloads"))
627 }
628}
629
630menu new_menu {
631 section {
632 label: _("New…");
633 item (_("New Room"))
634 item (_("New Folder"))
635 }
636
637 section {
638 item (_("New Tab"), "win.palette-new")
639 }
640}
641
642menu main_menu {
643 section {
644 item (_("Show All Tabs"), "overview.open")
645 }
646
647 section {
648 item (_("Preferences"), "win.preferences")
649 item (_("Plugins Manager"))
650
651 section {
652 item (_("About Ouch Browser"), "win.about")
653 }
654 }
655}