Browse Source

Moved app menu to the menu bar to ensure consistent appearance across desktops.

pipelines/1486128344
Shivang Gangadia 1 year ago
parent
commit
a5cf0529d5
  1. 9
      src/juci.cpp
  2. 61
      src/menu.cpp

9
src/juci.cpp

@ -121,14 +121,7 @@ void Application::on_startup() {
Gtk::Application::on_startup(); Gtk::Application::on_startup();
Menu::get().build(); Menu::get().build();
set_menubar(Menu::get().window_menu);
if(!Menu::get().juci_menu || !Menu::get().window_menu) {
std::cerr << "Menu not found." << std::endl;
}
else {
set_app_menu(Menu::get().juci_menu);
set_menubar(Menu::get().window_menu);
}
} }
Application::Application() : Gtk::Application("no.sout.juci", Gio::APPLICATION_NON_UNIQUE | Gio::APPLICATION_HANDLES_COMMAND_LINE) { Application::Application() : Gtk::Application("no.sout.juci", Gio::APPLICATION_NON_UNIQUE | Gio::APPLICATION_HANDLES_COMMAND_LINE) {

61
src/menu.cpp

@ -87,38 +87,39 @@ const Glib::ustring menu_xml = R"RAW(<interface>
</item> </item>
</section> </section>
</menu> </menu>
<menu id='juci-menu'>
<section>
<item>
<attribute name='label' translatable='yes'>_About</attribute>
<attribute name='action'>app.about</attribute>
</item>
</section>
<section>
<item>
<attribute name='label' translatable='yes'>_Preferences</attribute>
<attribute name='action'>app.preferences</attribute>
</item>
</section>
<section>
<item>
<attribute name='label' translatable='yes'>_Snippets</attribute>
<attribute name='action'>app.snippets</attribute>
</item>
<item>
<attribute name='label' translatable='yes'>_Commands</attribute>
<attribute name='action'>app.commands</attribute>
</item>
</section>
<section>
<item>
<attribute name='label' translatable='yes'>_Quit</attribute>
<attribute name='action'>app.quit</attribute>
</item>
</section>
</menu>
<menu id='window-menu'> <menu id='window-menu'>
<submenu id='juci-menu'>
<attribute name='label' translatable='yes'>_juci++</attribute>
<section>
<item>
<attribute name='label' translatable='yes'>_About</attribute>
<attribute name='action'>app.about</attribute>
</item>
</section>
<section>
<item>
<attribute name='label' translatable='yes'>_Preferences</attribute>
<attribute name='action'>app.preferences</attribute>
</item>
</section>
<section>
<item>
<attribute name='label' translatable='yes'>_Snippets</attribute>
<attribute name='action'>app.snippets</attribute>
</item>
<item>
<attribute name='label' translatable='yes'>_Commands</attribute>
<attribute name='action'>app.commands</attribute>
</item>
</section>
<section>
<item>
<attribute name='label' translatable='yes'>_Quit</attribute>
<attribute name='action'>app.quit</attribute>
</item>
</section>
</submenu>
<submenu> <submenu>
<attribute name='label' translatable='yes'>_File</attribute> <attribute name='label' translatable='yes'>_File</attribute>
<section> <section>

Loading…
Cancel
Save