| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  | using Gtk 4.0; | 
					
						
							|  |  |  | using Adw 1; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | template $MusicusHomePage : Adw.NavigationPage { | 
					
						
							|  |  |  |   title: _("Musicus"); | 
					
						
							|  |  |  |   tag: "home"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-21 17:19:31 +02:00
										 |  |  |   Gtk.Overlay { | 
					
						
							|  |  |  |     Adw.ToolbarView { | 
					
						
							|  |  |  |       [top] | 
					
						
							|  |  |  |       Adw.HeaderBar header_bar { | 
					
						
							|  |  |  |         [end] | 
					
						
							|  |  |  |         MenuButton { | 
					
						
							|  |  |  |           icon-name: "open-menu-symbolic"; | 
					
						
							|  |  |  |           menu-model: primary_menu; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-21 17:19:31 +02:00
										 |  |  |       [top] | 
					
						
							|  |  |  |       Adw.Clamp { | 
					
						
							|  |  |  |         maximum-size: 1000; | 
					
						
							|  |  |  |         tightening-threshold: 600; | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-30 00:22:33 +02:00
										 |  |  |         $MusicusSearchEntry search_entry { | 
					
						
							|  |  |  |           activate => $select() swapped; | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  |         } | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |       Gtk.Stack stack { | 
					
						
							|  |  |  |         Gtk.StackPage { | 
					
						
							|  |  |  |           name: "results"; | 
					
						
							|  |  |  |           child: Gtk.ScrolledWindow { | 
					
						
							|  |  |  |             hscrollbar-policy: never; | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |             Adw.Clamp { | 
					
						
							|  |  |  |               maximum-size: 1000; | 
					
						
							|  |  |  |               tightening-threshold: 600; | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |               Gtk.Box { | 
					
						
							|  |  |  |                 orientation: vertical; | 
					
						
							|  |  |  |                 margin-start: 12; | 
					
						
							|  |  |  |                 margin-end: 12; | 
					
						
							|  |  |  |                 margin-top: 24; | 
					
						
							|  |  |  |                 margin-bottom: 68; | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                 Gtk.Label { | 
					
						
							|  |  |  |                   styles ["heading"] | 
					
						
							| 
									
										
										
										
											2023-10-08 15:11:47 +02:00
										 |  |  |                   visible: bind composers_flow_box.visible;  | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                   halign: start; | 
					
						
							| 
									
										
										
										
											2023-10-08 15:11:47 +02:00
										 |  |  |                   label: _("Composers"); | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-09-21 17:19:31 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-08 15:11:47 +02:00
										 |  |  |                 Gtk.FlowBox composers_flow_box { | 
					
						
							|  |  |  |                   margin-top: 12; | 
					
						
							|  |  |  |                   margin-bottom: 24; | 
					
						
							|  |  |  |                   column-spacing: 12; | 
					
						
							|  |  |  |                   row-spacing: 12; | 
					
						
							|  |  |  |                   homogeneous: true; | 
					
						
							|  |  |  |                   selection-mode: none; | 
					
						
							| 
									
										
										
										
											2023-10-11 12:04:49 +02:00
										 |  |  |                   child-activated => $tile_selected() swapped; | 
					
						
							| 
									
										
										
										
											2023-10-08 15:11:47 +02:00
										 |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 Gtk.Label { | 
					
						
							|  |  |  |                   styles ["heading"] | 
					
						
							|  |  |  |                   visible: bind performers_flow_box.visible;  | 
					
						
							|  |  |  |                   halign: start; | 
					
						
							|  |  |  |                   label: _("Performers"); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 Gtk.FlowBox performers_flow_box { | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                   margin-top: 12; | 
					
						
							|  |  |  |                   margin-bottom: 24; | 
					
						
							|  |  |  |                   column-spacing: 12; | 
					
						
							|  |  |  |                   row-spacing: 12; | 
					
						
							|  |  |  |                   homogeneous: true; | 
					
						
							|  |  |  |                   selection-mode: none; | 
					
						
							| 
									
										
										
										
											2023-10-11 12:04:49 +02:00
										 |  |  |                   child-activated => $tile_selected() swapped; | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 Gtk.Label { | 
					
						
							|  |  |  |                   styles ["heading"] | 
					
						
							|  |  |  |                   visible: bind ensembles_flow_box.visible;  | 
					
						
							|  |  |  |                   halign: start; | 
					
						
							|  |  |  |                   label: _("Ensembles"); | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                 Gtk.FlowBox ensembles_flow_box { | 
					
						
							|  |  |  |                   margin-top: 12; | 
					
						
							|  |  |  |                   margin-bottom: 24; | 
					
						
							|  |  |  |                   column-spacing: 12; | 
					
						
							|  |  |  |                   row-spacing: 12; | 
					
						
							|  |  |  |                   homogeneous: true; | 
					
						
							|  |  |  |                   selection-mode: none; | 
					
						
							| 
									
										
										
										
											2023-10-11 12:04:49 +02:00
										 |  |  |                   child-activated => $tile_selected() swapped; | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 Gtk.Label { | 
					
						
							|  |  |  |                   styles ["heading"] | 
					
						
							|  |  |  |                   visible: bind works_flow_box.visible; | 
					
						
							|  |  |  |                   halign: start; | 
					
						
							|  |  |  |                   label: _("Works"); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 Gtk.FlowBox works_flow_box { | 
					
						
							|  |  |  |                   margin-top: 12; | 
					
						
							|  |  |  |                   margin-bottom: 24; | 
					
						
							|  |  |  |                   column-spacing: 12; | 
					
						
							|  |  |  |                   row-spacing: 12; | 
					
						
							|  |  |  |                   homogeneous: true; | 
					
						
							|  |  |  |                   selection-mode: none; | 
					
						
							| 
									
										
										
										
											2023-10-11 12:04:49 +02:00
										 |  |  |                   child-activated => $tile_selected() swapped; | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 Gtk.Label { | 
					
						
							|  |  |  |                   styles ["heading"] | 
					
						
							|  |  |  |                   visible: bind recordings_flow_box.visible; | 
					
						
							|  |  |  |                   halign: start; | 
					
						
							|  |  |  |                   label: _("Recordings"); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 Gtk.FlowBox recordings_flow_box { | 
					
						
							|  |  |  |                   margin-top: 12; | 
					
						
							|  |  |  |                   margin-bottom: 24; | 
					
						
							|  |  |  |                   column-spacing: 12; | 
					
						
							|  |  |  |                   row-spacing: 12; | 
					
						
							|  |  |  |                   homogeneous: true; | 
					
						
							|  |  |  |                   selection-mode: none; | 
					
						
							| 
									
										
										
										
											2023-10-11 12:04:49 +02:00
										 |  |  |                   child-activated => $recording_selected() swapped; | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |                 } | 
					
						
							|  |  |  |               } | 
					
						
							| 
									
										
										
										
											2023-09-21 17:19:31 +02:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-10-07 23:13:32 +02:00
										 |  |  |           }; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         Gtk.StackPage { | 
					
						
							|  |  |  |           name: "empty"; | 
					
						
							|  |  |  |           child: Adw.StatusPage { | 
					
						
							|  |  |  |             icon-name: "system-search-symbolic"; | 
					
						
							|  |  |  |             title: _("Nothing Found"); | 
					
						
							|  |  |  |             description: _("Try a different search."); | 
					
						
							|  |  |  |           }; | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  |         } | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-09-21 17:19:31 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     [overlay] | 
					
						
							|  |  |  |     Gtk.Button play_button { | 
					
						
							|  |  |  |       styles ["pill", "suggested-action"] | 
					
						
							|  |  |  |       halign: end; | 
					
						
							|  |  |  |       valign: end; | 
					
						
							|  |  |  |       margin-end: 24; | 
					
						
							|  |  |  |       margin-bottom: 24; | 
					
						
							|  |  |  |       label: _("Play music"); | 
					
						
							|  |  |  |       clicked => $play() swapped; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-09-20 13:49:02 +02:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | menu primary_menu { | 
					
						
							|  |  |  |   item { | 
					
						
							|  |  |  |     label: _("_Preferences"); | 
					
						
							|  |  |  |     action: "app.preferences"; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   item { | 
					
						
							|  |  |  |     label: _("_About Musicus"); | 
					
						
							|  |  |  |     action: "app.about"; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } |