mirror of
				https://github.com/slint-ui/slint.git
				synced 2025-10-31 03:54:25 +00:00 
			
		
		
		
	 39191e5acd
			
		
	
	
		39191e5acd
		
			
		
	
	
	
	
		
			
			`ContextMenu` -> `ContextMenuArea` `ContextMenu` must have a `Menu` child. `MenuItem` can no longer be put dirrectly in `MenuBar` and can no longer have children `Menu` is used now for sub menus
		
			
				
	
	
		
			48 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| // Copyright © SixtyFPS GmbH <info@slint.dev>
 | |
| // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
 | |
| 
 | |
| export component A  {
 | |
|     ContextMenuArea {
 | |
|         show => {
 | |
| //      ^error{'show' is not a callback in ContextMenuArea}
 | |
|             debug("hello");
 | |
|         }
 | |
| 
 | |
|         Menu {
 | |
|         }
 | |
| 
 | |
| 
 | |
|         property <int> entries: 45;
 | |
| //      ^error{Cannot re-define internal property 'entries'}
 | |
|         property <int> sub-menu: 45;
 | |
| //      ^error{Cannot re-define internal property 'sub-menu'}
 | |
|         property <string> activated: "me";
 | |
| //      ^error{Cannot re-define internal property 'activated'}
 | |
| 
 | |
|         property <string> xyz: "me";
 | |
| 
 | |
|     }
 | |
| 
 | |
|     ContextMenuArea { Rectangle {} }
 | |
| //  ^error{ContextMenuArea should have a Menu}
 | |
| 
 | |
|     ContextMenuArea {
 | |
|         Menu {
 | |
|             MenuItem { title: "ok"; }
 | |
|         }
 | |
|         Menu {
 | |
| //      ^error{Only one Menu is allowed in a ContextMenu}
 | |
|             MenuItem { title: "hello"; }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     ContextMenuArea {
 | |
|         if false : Menu {}
 | |
| //                 ^error{ContextMenuArea's root Menu cannot be in a conditional or repeated element}
 | |
|     }
 | |
|     ContextMenuArea {
 | |
|         for _ in [1,2,3] : Menu {}
 | |
| //                         ^error{ContextMenuArea's root Menu cannot be in a conditional or repeated element}
 | |
|     }
 | |
| }
 | |
| 
 |