|
| 1 | +using Gtk 4.0; |
| 2 | +using Adw 1; |
| 3 | + |
| 4 | +Adw.Window { |
| 5 | + modal: true; |
| 6 | + width-request: 360; |
| 7 | + height-request: 360; |
| 8 | + content: |
| 9 | + Box { |
| 10 | + orientation: vertical; |
| 11 | + |
| 12 | + Adw.HeaderBar { |
| 13 | + centering-policy: strict; |
| 14 | + title-widget: |
| 15 | + Adw.ViewSwitcherTitle switcher_title { |
| 16 | + stack: stack; |
| 17 | + title: _("AdwViewSwitcher Demo"); |
| 18 | + }; |
| 19 | + } |
| 20 | + |
| 21 | + Adw.ViewStack stack { |
| 22 | + vexpand: true; |
| 23 | + |
| 24 | + Adw.ViewStackPage page1 { |
| 25 | + name: "page1"; |
| 26 | + title: _("Favorites"); |
| 27 | + icon-name: "star-filled-rounded-symbolic"; |
| 28 | + use-underline: true; |
| 29 | + child: |
| 30 | + |
| 31 | + Adw.StatusPage{ |
| 32 | + title: bind page1.title; |
| 33 | + icon-name: bind page1.icon-name; |
| 34 | + child: |
| 35 | + |
| 36 | + Box{ |
| 37 | + orientation: vertical; |
| 38 | + valign: center; |
| 39 | + |
| 40 | + LinkButton { |
| 41 | + label: "API Reference"; |
| 42 | + uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.2/class.ViewSwitcher.html"; |
| 43 | + } |
| 44 | + LinkButton { |
| 45 | + label: "Human Interface Guidelines"; |
| 46 | + uri: "https://developer.gnome.org/hig/patterns/nav/view-switchers.html"; |
| 47 | + } |
| 48 | + }; |
| 49 | + }; |
| 50 | + } |
| 51 | + |
| 52 | + Adw.ViewStackPage page2 { |
| 53 | + name: "page2"; |
| 54 | + title: _("Recents"); |
| 55 | + icon-name: "clock-alt-symbolic"; |
| 56 | + use-underline: true; |
| 57 | + child: |
| 58 | + |
| 59 | + Adw.StatusPage{ |
| 60 | + title: bind page2.title; |
| 61 | + icon-name: bind page2.icon-name; |
| 62 | + child: |
| 63 | + |
| 64 | + Box{ |
| 65 | + orientation: vertical; |
| 66 | + valign: center; |
| 67 | + |
| 68 | + LinkButton { |
| 69 | + label: "API Reference"; |
| 70 | + uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.2/class.ViewSwitcher.html"; |
| 71 | + } |
| 72 | + LinkButton { |
| 73 | + label: "Human Interface Guidelines"; |
| 74 | + uri: "https://developer.gnome.org/hig/patterns/nav/view-switchers.html"; |
| 75 | + } |
| 76 | + }; |
| 77 | + }; |
| 78 | + } |
| 79 | + |
| 80 | + |
| 81 | + Adw.ViewStackPage page3 { |
| 82 | + name: "page3"; |
| 83 | + title: _("Notifications"); |
| 84 | + icon-name: "bell-symbolic"; |
| 85 | + badge-number: 0; |
| 86 | + needs-attention: true; |
| 87 | + use-underline: true; |
| 88 | + child: |
| 89 | + |
| 90 | + Adw.StatusPage{ |
| 91 | + title: bind page3.title; |
| 92 | + valign: start; |
| 93 | + margin-start: 15; |
| 94 | + margin-end: 15; |
| 95 | + child: |
| 96 | + |
| 97 | + Adw.Clamp{ |
| 98 | + maximum-size: 500; |
| 99 | + ListBox notification_list{ |
| 100 | + halign: baseline; |
| 101 | + styles["boxed-list"] |
| 102 | + |
| 103 | + } |
| 104 | + }; |
| 105 | + }; |
| 106 | + } |
| 107 | + |
| 108 | + Adw.ViewStackPage page4{ |
| 109 | + name: "page4"; |
| 110 | + title: _("Account"); |
| 111 | + icon-name: "person-symbolic"; |
| 112 | + use-underline: true; |
| 113 | + child: |
| 114 | + |
| 115 | + Adw.StatusPage{ |
| 116 | + title: bind page4.title; |
| 117 | + icon-name: bind page4.icon-name; |
| 118 | + child: |
| 119 | + |
| 120 | + Box{ |
| 121 | + orientation: vertical; |
| 122 | + valign: center; |
| 123 | + |
| 124 | + LinkButton { |
| 125 | + label: "API Reference"; |
| 126 | + uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.2/class.ViewSwitcher.html"; |
| 127 | + } |
| 128 | + |
| 129 | + LinkButton { |
| 130 | + label: "Human Interface Guidelines"; |
| 131 | + uri: "https://developer.gnome.org/hig/patterns/nav/view-switchers.html"; |
| 132 | + } |
| 133 | + }; |
| 134 | + }; |
| 135 | + } |
| 136 | + } |
| 137 | + |
| 138 | + Adw.ViewSwitcherBar switcher_bar { |
| 139 | + stack: stack; |
| 140 | + reveal: bind switcher_title.title-visible; |
| 141 | + } |
| 142 | + }; |
| 143 | +} |
0 commit comments