Clear last separator in geometry prepare.
This commit is contained in:
		
							parent
							
								
									41d1fe9232
								
							
						
					
					
						commit
						19193b3c7b
					
				
					 1 changed files with 7 additions and 6 deletions
				
			
		| 
						 | 
					@ -900,12 +900,6 @@ void PopupMenu::deleteOnHide(bool del) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PopupMenu::popup(const QPoint &p) {
 | 
					void PopupMenu::popup(const QPoint &p) {
 | 
				
			||||||
	if (_clearLastSeparator) {
 | 
					 | 
				
			||||||
		_menu->clearLastSeparator();
 | 
					 | 
				
			||||||
		for (const auto &[action, submenu] : _submenus) {
 | 
					 | 
				
			||||||
			submenu->menu()->clearLastSeparator();
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (prepareGeometryFor(p)) {
 | 
						if (prepareGeometryFor(p)) {
 | 
				
			||||||
		popupPrepared();
 | 
							popupPrepared();
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
| 
						 | 
					@ -957,6 +951,13 @@ bool PopupMenu::prepareGeometryFor(const QPoint &p) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool PopupMenu::prepareGeometryFor(const QPoint &p, PopupMenu *parent) {
 | 
					bool PopupMenu::prepareGeometryFor(const QPoint &p, PopupMenu *parent) {
 | 
				
			||||||
 | 
						if (_clearLastSeparator) {
 | 
				
			||||||
 | 
							_menu->clearLastSeparator();
 | 
				
			||||||
 | 
							for (const auto &[action, submenu] : _submenus) {
 | 
				
			||||||
 | 
								submenu->menu()->clearLastSeparator();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const auto usingScreenGeometry = !::Platform::IsWayland();
 | 
						const auto usingScreenGeometry = !::Platform::IsWayland();
 | 
				
			||||||
	const auto screen = QGuiApplication::screenAt(p);
 | 
						const auto screen = QGuiApplication::screenAt(p);
 | 
				
			||||||
	if ((usingScreenGeometry && !screen)
 | 
						if ((usingScreenGeometry && !screen)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue