GTK docking interfaces and more

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

Traditional menu nesting

by roundabout, Sunday, 2 March 2025, 10:12:21 (1740910341), pushed by roundabout, Sunday, 2 March 2025, 10:12:25 (1740910345)

Author identity: vlad <vlad.muntoiu@gmail.com>

aa95d03f8354559e0c9f5fff2ae0d30c1af645e7

gpanthera.cc

@@ -43,8 +43,8 @@ namespace gPanthera {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    auto header_menu_button = Gtk::make_managed<Gtk::MenuButton>();
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    auto header_menu = Gio::Menu::create();
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    header_menu_button->set_direction(Gtk::ArrowType::NONE);
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                header_menu_button->set_menu_model(header_menu);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                // Pane menu
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    auto action_group = Gio::SimpleActionGroup::create();
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    header_menu_button->insert_action_group("win", action_group);
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -68,6 +68,10 @@ namespace gPanthera {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    action_group->add_action(pop_out_action);
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    header_menu->append(_("Pop out"), "win.pop_out");
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                // Switch to traditional (nested) submenus, not sliding
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                auto popover_menu = Gtk::make_managed<Gtk::PopoverMenu>(header_menu, Gtk::PopoverMenu::Flags::NESTED);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                header_menu_button->set_popover(*popover_menu);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    // Move menu
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    auto move_menu = Gio::Menu::create();
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    for(auto &this_stack : this->layout->stacks) {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -80,10 +84,8 @@ namespace gPanthera {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        move_menu->append(this_stack->name, "win." + action_name);
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                // Add move section
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                auto move_menu_item = Gio::Menu::create();
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                move_menu_item->append_section(_("Move"), move_menu);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                header_menu->append_section({}, move_menu_item);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                // Add move submenu
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                header_menu->append_submenu(_("Move"), move_menu);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    header->pack_end(*header_menu_button);