Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Known issue: no menubar on macOS #114

Open
danirod opened this issue Dec 30, 2024 · 1 comment
Open

Known issue: no menubar on macOS #114

danirod opened this issue Dec 30, 2024 · 1 comment
Labels
Bug Report that something does not work properly. macOS Related to the macOS Port

Comments

@danirod
Copy link
Owner

danirod commented Dec 30, 2024

The menubar for Cartero looks poor on macOS.

image

(The joke is that there is no menu bar).

To integrate with the system HID, it should have a menu bar with actions, even if those actions are identical to the ones offered by the primary menu. It's not necessary to have something as rich as SoapUI,

image

Related:

@danirod danirod added Bug Report that something does not work properly. macOS Related to the macOS Port labels Dec 30, 2024
@danirod
Copy link
Owner Author

danirod commented Dec 30, 2024

And now, in a separate comment. Here is a menu bar that shows a File menu. It mimics the elements of the primary menu and it's a copy-paste of the primary menu. However, because of the action model, the menu bar is just another set of triggers for the action set, so it's just a different way to call the same set of actions.

using Gtk 4.0;

menu app_menu {
    submenu {
        label: _('File');

        section {
            item {
                label: _("New tab");
                action: "win.new";
            }
            item {
                label: _("Open request…");
                action: "win.open";
            }
        }

        section {
            item {
                label: _("Close tab");
                action: "win.close";
            }
            item {
                label: _("Save request");
                action: "win.save";
                icon: "document-save-symbolic";
            }
            item {
                label: _("Save request as…");
                action: "win.save-as";
            }
        }
    }
}

Now, what's the stopper for adding something like this right now? Mainly the Edit menu. It would be nice to also have an Edit menu with the standard sections: undo, redo, cut, copy, paste, select all, search (codeview.search)...

The main stopper would be that these system actions are created by calling the gtk_widget_class_install_action function, at least according to the current source code, GTK 4.16. This system is different from the one used by Gio.ActionMap, which is the one that the MenuModel seems to expect.

Someone opened this discussion in the GNOME Discourse Community (casually from today as well). If someone from GNOME answered the thread and provided a constructive solution or feedback, maybe the solution could be used as well.

Also worth following GTK !7906, where a solution is also being worked on by adding native responders to the Quartz backend for GTK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report that something does not work properly. macOS Related to the macOS Port
Projects
None yet
Development

No branches or pull requests

1 participant