diff --git a/src/files.h b/src/files.h index 55dc46c..28fb041 100644 --- a/src/files.h +++ b/src/files.h @@ -59,19 +59,19 @@ const std::string configjson = " \"clang_format_style\": \"ColumnLimit: 0\"\n" " },\n" " \"keybindings\": {\n" +" \"preferences\": \"comma\",\n" +" \"quit\": \"q\",\n" " \"new_file\": \"n\",\n" " \"new_folder\": \"n\",\n" -" \"open_folder\": \"o\",\n" " \"open_file\": \"o\",\n" +" \"open_folder\": \"o\",\n" " \"save\": \"s\",\n" " \"save_as\": \"s\",\n" -" \"preferences\": \"comma\",\n" -" \"quit\": \"q\",\n" -" \"edit_copy\": \"c\",\n" -" \"edit_cut\": \"x\",\n" -" \"edit_paste\": \"v\",\n" " \"edit_undo\": \"z\",\n" " \"edit_redo\": \"z\",\n" +" \"edit_cut\": \"x\",\n" +" \"edit_copy\": \"c\",\n" +" \"edit_paste\": \"v\",\n" " \"edit_find\": \"f\",\n" " \"edit_set_tab\": \"\",\n" " \"source_spellcheck\": \"\",\n" @@ -81,10 +81,10 @@ const std::string configjson = " \"source_indentation_auto_indent_buffer\": \"i\",\n" " \"source_goto_line\": \"g\",\n" " \"source_center_cursor\": \"l\",\n" +" \"source_find_documentation\": \"d\",\n" " \"source_goto_declaration\": \"d\",\n" " \"source_goto_method\": \"m\",\n" " \"source_rename\": \"r\",\n" -" \"source_find_documentation\": \"d\",\n" " \"source_goto_next_diagnostic\": \"e\",\n" " \"source_apply_fix_its\": \"space\",\n" " \"compile_and_run\": \"Return\",\n" diff --git a/src/juci.cc b/src/juci.cc index 30f7332..c2bff14 100644 --- a/src/juci.cc +++ b/src/juci.cc @@ -38,6 +38,7 @@ int app::on_command_line(const Glib::RefPtr &cmd) { } void app::on_activate() { + window = std::unique_ptr(new Window()); add_window(*window); window->show(); bool first_directory=true; @@ -83,13 +84,10 @@ void app::on_startup() { set_app_menu(juci_menu); set_menubar(window_menu); } - - window->set_menu_actions(); } app::app() : Gtk::Application("no.sout.juci", Gio::APPLICATION_NON_UNIQUE | Gio::APPLICATION_HANDLES_COMMAND_LINE) { Glib::set_application_name("juCi++"); - window = std::unique_ptr(new Window()); } int main(int argc, char *argv[]) { diff --git a/src/menu.cc b/src/menu.cc index ed3118b..8a65aaa 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -44,7 +44,7 @@ Menu::Menu() { " " " _New _Project" " " - " C++" + " C++" " app.new_project_cpp" " " " " @@ -70,6 +70,162 @@ Menu::Menu() { " " " " " " + "" + " " + " _Edit" + "
" + " " + " _Undo" + " app.edit_undo" + " " + " " + " _Redo" + " app.edit_redo" + " " + "
" + "
" + " " + " _Cut" + " app.edit_cut" + " " + " " + " _Copy" + " app.edit_copy" + " " + " " + " _Paste" + " app.edit_paste" + " " + "
" + "
" + " " + " _Find" + " app.edit_find" + " " + "
" + "
" + "" + " " + " _Source" + "
" + " " + " _Spell _Check" + " " + " _Spell _Check _Buffer" + " app.source_spellcheck" + " " + " " + " _Clear _Spelling _Errors" + " app.source_spellcheck_clear" + " " + " " + " _Go _to _Next _Spelling _Error" + " app.source_spellcheck_next_error" + " " + " " + "
" + "
" + " " + " _Indentation" + " " + " _Set _Current _Buffer _Tab" + " app.source_indentation_set_buffer_tab" + " " + " " + " _Auto-Indent _Current _Buffer" + " app.source_indentation_auto_indent_buffer" + " " + " " + "
" + "
" + " " + " _Go _to _Line" + " app.source_goto_line" + " " + " " + " _Center _Cursor" + " app.source_center_cursor" + " " + "
" + "
" + " " + " _Find _Documentation" + " app.source_find_documentation" + " " + "
" + "
" + " " + " _Go to Declaration" + " app.source_goto_declaration" + " " + " " + " _Go to Method" + " app.source_goto_method" + " " + " " + " _Rename" + " app.source_rename" + " " + "
" + "
" + " " + " _Go to Next Diagnostic" + " app.source_goto_next_diagnostic" + " " + " " + " _Apply Fix-Its" + " app.source_apply_fix_its" + " " + "
" + "
" + "" + " " + " _Project" + "
" + " " + " _Compile _and _Run" + " app.compile_and_run" + " " + " " + " _Compile" + " app.compile" + " " + "
" + "
" + " " + " _Run _Command" + " app.run_command" + " " + " " + " _Kill _Last _Process" + " app.kill_last_running" + " " + " " + " _Force _Kill _Last _Process" + " app.force_kill_last_running" + " " + "
" + "
" + "" + " " + " _Window" + "
" + " " + " _Next _Tab" + " app.next_tab" + " " + " " + " _Previous _Tab" + " app.previous_tab" + " " + "
" + "
" + " " + " _Close _Tab" + " app.close_tab" + " " + "
" + "
" " " ""; } @@ -78,10 +234,15 @@ void Menu::add_action(const std::string &name, std::function action) { auto application = builder->get_application(); actions[name]=application->add_action(name, action); +} + +void Menu::set_keys() { + auto application = builder->get_application(); - auto key=Singleton::Config::menu()->keys.find(name); - if(key!=Singleton::Config::menu()->keys.end()) - application->set_accel_for_action("app."+name, key->second); + for(auto &key: Singleton::Config::menu()->keys) { + if(key.second.size()>0 && actions.find(key.first)!=actions.end()) + application->set_accel_for_action("app."+key.first, key.second); + } } void Menu::build() { diff --git a/src/menu.h b/src/menu.h index d5cec5a..eb381bf 100644 --- a/src/menu.h +++ b/src/menu.h @@ -13,12 +13,14 @@ public: }; Menu(); + void add_action(const std::string &name, std::function action); std::unordered_map > actions; + void set_keys(); void build(); + Glib::RefPtr builder; std::string ui_xml; - Glib::RefPtr builder; }; #endif // JUCI_MENU_H_ diff --git a/src/window.cc b/src/window.cc index bf52ebb..410d207 100644 --- a/src/window.cc +++ b/src/window.cc @@ -27,10 +27,12 @@ Window::Window() : compiling(false) { JDEBUG("start"); set_title("juCi++"); set_events(Gdk::POINTER_MOTION_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::SCROLL_MASK); + set_menu_actions(); configure(); set_default_size(Singleton::Config::window()->default_size.first, Singleton::Config::window()->default_size.second); //PluginApi(&this->notebook, &this->menu); + add(vpaned); directory_and_notebook_panes.pack1(*Singleton::directories(), Gtk::SHRINK); @@ -87,27 +89,8 @@ Window::Window() : compiling(false) { notebook.get_current_view()->search_highlight(last_search, case_sensitive_search, regex_search); } - /*if(auto menu_item=dynamic_cast(menu.ui_manager->get_widget("/MenuBar/SourceMenu/SourceIndentation/SourceIndentationAutoIndentBuffer"))) - menu_item->set_sensitive((bool)notebook.get_current_view()->auto_indent); - - if(auto menu_item=dynamic_cast(menu.ui_manager->get_widget("/MenuBar/SourceMenu/SourceGotoDeclaration"))) - menu_item->set_sensitive((bool)notebook.get_current_view()->get_declaration_location); - - if(auto menu_item=dynamic_cast(menu.ui_manager->get_widget("/MenuBar/SourceMenu/SourceGotoMethod"))) - menu_item->set_sensitive((bool)notebook.get_current_view()->goto_method); - - if(auto menu_item=dynamic_cast(menu.ui_manager->get_widget("/MenuBar/SourceMenu/SourceRename"))) - menu_item->set_sensitive((bool)notebook.get_current_view()->rename_similar_tokens); - - if(auto menu_item=dynamic_cast(menu.ui_manager->get_widget("/MenuBar/SourceMenu/SourceGotoNextDiagnostic"))) - menu_item->set_sensitive((bool)notebook.get_current_view()->goto_next_diagnostic); - - if(auto menu_item=dynamic_cast(menu.ui_manager->get_widget("/MenuBar/SourceMenu/SourceApplyFixIts"))) - menu_item->set_sensitive((bool)notebook.get_current_view()->apply_fix_its); + activate_menu_items(); - if(auto menu_item=dynamic_cast(menu.ui_manager->get_widget("/MenuBar/SourceMenu/SourceFindDocumentation"))) - menu_item->set_sensitive((bool)notebook.get_current_view()->get_token_data);*/ - Singleton::directories()->select(notebook.get_current_view()->file_path); if(auto source_view=dynamic_cast(notebook.get_current_view())) { @@ -145,11 +128,14 @@ Window::Window() : compiling(false) { void Window::configure() { MainConfig(); // Read the configs here + auto style_context = Gtk::StyleContext::create(); auto screen = Gdk::Screen::get_default(); auto css_provider = Gtk::CssProvider::get_named(Singleton::Config::window()->theme_name, Singleton::Config::window()->theme_variant); //TODO: add check if theme exists, or else write error to Singleton::terminal() style_context->add_provider_for_screen(screen, css_provider, GTK_STYLE_PROVIDER_PRIORITY_SETTINGS); + + Singleton::menu()->set_keys(); } void Window::set_menu_actions() { @@ -276,33 +262,8 @@ void Window::set_menu_actions() { } }); - /* - - menu.action_group->add(Gtk::Action::create("EditCopy", "Copy"), Gtk::AccelKey(key_map["edit_copy"]), [this]() { - auto widget=get_focus(); - if(auto entry=dynamic_cast(widget)) - entry->copy_clipboard(); - else if(auto text_view=dynamic_cast(widget)) - text_view->get_buffer()->copy_clipboard(Gtk::Clipboard::get()); - }); - menu.action_group->add(Gtk::Action::create("EditCut", "Cut"), Gtk::AccelKey(key_map["edit_cut"]), [this]() { - auto widget=get_focus(); - if(auto entry=dynamic_cast(widget)) - entry->cut_clipboard(); - else if(notebook.get_current_page()!=-1) - notebook.get_current_view()->get_buffer()->cut_clipboard(Gtk::Clipboard::get()); - }); - menu.action_group->add(Gtk::Action::create("EditPaste", "Paste"), Gtk::AccelKey(key_map["edit_paste"]), [this]() { - auto widget=get_focus(); - if(auto entry=dynamic_cast(widget)) - entry->paste_clipboard(); - else if(notebook.get_current_page()!=-1) - notebook.get_current_view()->paste(); - }); - menu.action_group->add(Gtk::Action::create("EditFind", "Find"), Gtk::AccelKey(key_map["edit_find"]), [this]() { - search_and_replace_entry(); - }); - menu.action_group->add(Gtk::Action::create("EditUndo", "Undo"), Gtk::AccelKey(key_map["edit_undo"]), [this]() { + + menu->add_action("edit_undo", [this]() { if(notebook.get_current_page()!=-1) { auto undo_manager = notebook.get_current_view()->get_source_buffer()->get_undo_manager(); if (undo_manager->can_undo()) { @@ -311,7 +272,7 @@ void Window::set_menu_actions() { } } }); - menu.action_group->add(Gtk::Action::create("EditRedo", "Redo"), Gtk::AccelKey(key_map["edit_redo"]), [this]() { + menu->add_action("edit_redo", [this]() { if(notebook.get_current_page()!=-1) { auto undo_manager = notebook.get_current_view()->get_source_buffer()->get_undo_manager(); if(undo_manager->can_redo()) { @@ -320,32 +281,59 @@ void Window::set_menu_actions() { } } }); - - menu.action_group->add(Gtk::Action::create("SourceSpellCheck", "Spell Check")); - menu.action_group->add(Gtk::Action::create("SourceSpellCheckBuffer", "Spell Check Buffer"), Gtk::AccelKey(key_map["source_spellcheck"]), [this]() { + + menu->add_action("edit_cut", [this]() { + auto widget=get_focus(); + if(auto entry=dynamic_cast(widget)) + entry->cut_clipboard(); + else if(notebook.get_current_page()!=-1) + notebook.get_current_view()->get_buffer()->cut_clipboard(Gtk::Clipboard::get()); + }); + menu->add_action("edit_copy", [this]() { + auto widget=get_focus(); + if(auto entry=dynamic_cast(widget)) + entry->copy_clipboard(); + else if(auto text_view=dynamic_cast(widget)) + text_view->get_buffer()->copy_clipboard(Gtk::Clipboard::get()); + }); + menu->add_action("edit_paste", [this]() { + auto widget=get_focus(); + if(auto entry=dynamic_cast(widget)) + entry->paste_clipboard(); + else if(notebook.get_current_page()!=-1) + notebook.get_current_view()->paste(); + }); + + menu->add_action("edit_find", [this]() { + search_and_replace_entry(); + }); + + + menu->add_action("source_spellcheck", [this]() { if(notebook.get_current_page()!=-1) notebook.get_current_view()->spellcheck(); }); - menu.action_group->add(Gtk::Action::create("SourceSpellCheckClear", "Clear Spelling Errors"), Gtk::AccelKey(key_map["source_spellcheck_clear"]), [this]() { + menu->add_action("source_spellcheck_clear", [this]() { if(notebook.get_current_page()!=-1) notebook.get_current_view()->remove_spellcheck_errors(); }); - menu.action_group->add(Gtk::Action::create("SourceSpellCheckNextError", "Go to next Spelling Error"), Gtk::AccelKey(key_map["source_spellcheck_next_error"]), [this]() { + menu->add_action("source_spellcheck_next_error", [this]() { if(notebook.get_current_page()!=-1) notebook.get_current_view()->goto_next_spellcheck_error(); }); - menu.action_group->add(Gtk::Action::create("SourceIndentation", "Indentation")); - menu.action_group->add(Gtk::Action::create("SourceIndentationSetBufferTab", "Set Current Buffer Tab"), Gtk::AccelKey(key_map["source_indentation_set_buffer_tab"]), [this]() { + + menu->add_action("source_indentation_set_buffer_tab", [this]() { set_tab_entry(); }); - menu.action_group->add(Gtk::Action::create("SourceIndentationAutoIndentBuffer", "Auto-Indent Current Buffer"), Gtk::AccelKey(key_map["source_indentation_auto_indent_buffer"]), [this]() { + menu->add_action("source_indentation_auto_indent_buffer", [this]() { if(notebook.get_current_page()!=-1 && notebook.get_current_view()->auto_indent) notebook.get_current_view()->auto_indent(); }); - menu.action_group->add(Gtk::Action::create("SourceGotoLine", "Go to Line"), Gtk::AccelKey(key_map["source_goto_line"]), [this]() { + + menu->add_action("source_goto_line", [this]() { goto_line_entry(); }); - menu.action_group->add(Gtk::Action::create("SourceCenterCursor", "Center Cursor"), Gtk::AccelKey(key_map["source_center_cursor"]), [this]() { + menu->add_action("source_center_cursor", [this]() { if(notebook.get_current_page()!=-1) { while(gtk_events_pending()) gtk_main_iteration(); @@ -353,44 +341,8 @@ void Window::set_menu_actions() { notebook.get_current_view()->scroll_to(notebook.get_current_view()->get_buffer()->get_insert(), 0.0, 1.0, 0.5); } }); - menu.action_group->add(Gtk::Action::create("SourceGotoDeclaration", "Go to Declaration"), Gtk::AccelKey(key_map["source_goto_declaration"]), [this]() { - if(notebook.get_current_page()!=-1) { - if(notebook.get_current_view()->get_declaration_location) { - auto location=notebook.get_current_view()->get_declaration_location(); - if(location.first.size()>0) { - notebook.open(location.first); - auto line=static_cast(location.second.line)-1; - auto index=static_cast(location.second.index)-1; - auto buffer=notebook.get_current_view()->get_buffer(); - line=std::min(line, buffer->get_line_count()-1); - if(line>=0) { - auto iter=buffer->get_iter_at_line(line); - while(!iter.ends_line()) - iter.forward_char(); - auto end_line_index=iter.get_line_index(); - index=std::min(index, end_line_index); - buffer->place_cursor(buffer->get_iter_at_line_index(line, index)); - - while(gtk_events_pending()) - gtk_main_iteration(); - if(notebook.get_current_page()!=-1) - notebook.get_current_view()->scroll_to(notebook.get_current_view()->get_buffer()->get_insert(), 0.0, 1.0, 0.5); - } - } - } - } - }); - menu.action_group->add(Gtk::Action::create("SourceGotoMethod", "Go to Method"), Gtk::AccelKey(key_map["source_goto_method"]), [this]() { - if(notebook.get_current_page()!=-1) { - if(notebook.get_current_view()->goto_method) { - notebook.get_current_view()->goto_method(); - } - } - }); - menu.action_group->add(Gtk::Action::create("SourceRename", "Rename"), Gtk::AccelKey(key_map["source_rename"]), [this]() { - rename_token_entry(); - }); - menu.action_group->add(Gtk::Action::create("SourceFindDocumentation", "Find Documentation"), Gtk::AccelKey(key_map["source_find_documentation"]), [this]() { + + menu->add_action("source_find_documentation", [this]() { if(notebook.get_current_page()!=-1) { if(notebook.get_current_view()->get_token_data) { auto data=notebook.get_current_view()->get_token_data(); @@ -430,22 +382,62 @@ void Window::set_menu_actions() { } } }); - menu.action_group->add(Gtk::Action::create("SourceGotoNextDiagnostic", "Go to next Diagnostic"), Gtk::AccelKey(key_map["source_goto_next_diagnostic"]), [this]() { + + menu->add_action("source_goto_declaration", [this]() { + if(notebook.get_current_page()!=-1) { + if(notebook.get_current_view()->get_declaration_location) { + auto location=notebook.get_current_view()->get_declaration_location(); + if(location.first.size()>0) { + notebook.open(location.first); + auto line=static_cast(location.second.line)-1; + auto index=static_cast(location.second.index)-1; + auto buffer=notebook.get_current_view()->get_buffer(); + line=std::min(line, buffer->get_line_count()-1); + if(line>=0) { + auto iter=buffer->get_iter_at_line(line); + while(!iter.ends_line()) + iter.forward_char(); + auto end_line_index=iter.get_line_index(); + index=std::min(index, end_line_index); + buffer->place_cursor(buffer->get_iter_at_line_index(line, index)); + + while(gtk_events_pending()) + gtk_main_iteration(); + if(notebook.get_current_page()!=-1) + notebook.get_current_view()->scroll_to(notebook.get_current_view()->get_buffer()->get_insert(), 0.0, 1.0, 0.5); + } + } + } + } + }); + menu->add_action("source_goto_method", [this]() { + if(notebook.get_current_page()!=-1) { + if(notebook.get_current_view()->goto_method) { + notebook.get_current_view()->goto_method(); + } + } + }); + menu->add_action("source_rename", [this]() { + rename_token_entry(); + }); + + menu->add_action("source_goto_next_diagnostic", [this]() { if(notebook.get_current_page()!=-1) { if(notebook.get_current_view()->goto_next_diagnostic) { notebook.get_current_view()->goto_next_diagnostic(); } } }); - menu.action_group->add(Gtk::Action::create("SourceApplyFixIts", "Apply Fix-Its"), Gtk::AccelKey(key_map["source_apply_fix_its"]), [this]() { + menu->add_action("source_apply_fix_its", [this]() { if(notebook.get_current_page()!=-1) { if(notebook.get_current_view()->apply_fix_its) { notebook.get_current_view()->apply_fix_its(); } } }); - - menu.action_group->add(Gtk::Action::create("ProjectCompileAndRun", "Compile and Run"), Gtk::AccelKey(key_map["compile_and_run"]), [this]() { + + + menu->add_action("compile_and_run", [this]() { if(notebook.get_current_page()==-1 || compiling) return; CMake cmake(notebook.get_current_view()->file_path); @@ -485,7 +477,7 @@ void Window::set_menu_actions() { } } }); - menu.action_group->add(Gtk::Action::create("ProjectCompile", "Compile"), Gtk::AccelKey(key_map["compile"]), [this]() { + menu->add_action("compile", [this]() { if(notebook.get_current_page()==-1 || compiling) return; CMake cmake(notebook.get_current_view()->file_path); @@ -497,7 +489,8 @@ void Window::set_menu_actions() { }); } }); - menu.action_group->add(Gtk::Action::create("ProjectRunCommand", "Run Command"), Gtk::AccelKey(key_map["run_command"]), [this]() { + + menu->add_action("run_command", [this]() { entry_box.clear(); entry_box.labels.emplace_back(); auto label_it=entry_box.labels.begin(); @@ -518,7 +511,7 @@ void Window::set_menu_actions() { else run_path=Singleton::directories()->current_path; Singleton::terminal()->async_print("Running: "+content+'\n'); - + Singleton::terminal()->async_execute(content, run_path, [this, content](int exit_code){ Singleton::terminal()->async_print(content+" returned: "+std::to_string(exit_code)+'\n'); }); @@ -532,29 +525,21 @@ void Window::set_menu_actions() { }); entry_box.show(); }); - menu.action_group->add(Gtk::Action::create("ProjectKillLastRunning", "Kill Last Process"), Gtk::AccelKey(key_map["kill_last_running"]), [this]() { + + menu->add_action("kill_last_running", [this]() { Singleton::terminal()->kill_last_async_execute(); }); - menu.action_group->add(Gtk::Action::create("ProjectForceKillLastRunning", "Force Kill Last Process"), Gtk::AccelKey(key_map["force_kill_last_running"]), [this]() { + menu->add_action("force_kill_last_running", [this]() { Singleton::terminal()->kill_last_async_execute(true); }); - menu.action_group->add(Gtk::Action::create("WindowCloseTab", "Close Tab"), Gtk::AccelKey(key_map["close_tab"]), [this]() { - notebook.close_current_page(); - if(notebook.get_current_page()!=-1) { - notebook.get_current_view()->set_status(notebook.get_current_view()->status); - notebook.get_current_view()->set_info(notebook.get_current_view()->info); - } - else { - Singleton::status()->set_text(""); - Singleton::info()->set_text(""); - } - }); - menu.action_group->add(Gtk::Action::create("WindowNextTab", "Next Tab"), Gtk::AccelKey(key_map["next_tab"]), [this]() { + + + menu->add_action("next_tab", [this]() { if(notebook.get_current_page()!=-1) { notebook.open(notebook.get_view((notebook.get_current_page()+1)%notebook.size())->file_path); } }); - menu.action_group->add(Gtk::Action::create("WindowPreviousTab", "Previous Tab"), Gtk::AccelKey(key_map["previous_tab"]), [this]() { + menu->add_action("previous_tab", [this]() { if(notebook.get_current_page()!=-1) { int previous_page=notebook.get_current_page()-1; if(previous_page<0) @@ -562,7 +547,31 @@ void Window::set_menu_actions() { notebook.open(notebook.get_view(previous_page)->file_path); } }); - */ + menu->add_action("close_tab", [this]() { + notebook.close_current_page(); + if(notebook.get_current_page()!=-1) { + notebook.get_current_view()->set_status(notebook.get_current_view()->status); + notebook.get_current_view()->set_info(notebook.get_current_view()->info); + } + else { + Singleton::status()->set_text(""); + Singleton::info()->set_text(""); + + activate_menu_items(false); + } + }); + activate_menu_items(false); +} + +void Window::activate_menu_items(bool activate) { + auto menu = Singleton::menu(); + menu->actions["source_indentation_auto_indent_buffer"]->set_enabled(activate ? static_cast(notebook.get_current_view()->auto_indent) : false); + menu->actions["source_find_documentation"]->set_enabled(activate ? static_cast(notebook.get_current_view()->get_token_data) : false); + menu->actions["source_goto_declaration"]->set_enabled(activate ? static_cast(notebook.get_current_view()->get_declaration_location) : false); + menu->actions["source_goto_method"]->set_enabled(activate ? static_cast(notebook.get_current_view()->goto_method) : false); + menu->actions["source_rename"]->set_enabled(activate ? static_cast(notebook.get_current_view()->rename_similar_tokens) : false); + menu->actions["source_goto_next_diagnostic"]->set_enabled(activate ? static_cast(notebook.get_current_view()->goto_next_diagnostic) : false); + menu->actions["source_apply_fix_its"]->set_enabled(activate ? static_cast(notebook.get_current_view()->apply_fix_its) : false); } bool Window::on_key_press_event(GdkEventKey *event) { diff --git a/src/window.h b/src/window.h index 7349b04..bb9e6f1 100644 --- a/src/window.h +++ b/src/window.h @@ -18,7 +18,6 @@ public: std::string version; std::pair default_size; }; - void set_menu_actions(); protected: bool on_key_press_event(GdkEventKey *event); @@ -36,6 +35,8 @@ private: std::atomic compiling; void configure(); + void set_menu_actions(); + void activate_menu_items(bool activate=true); void hide(); void search_and_replace_entry(); void set_tab_entry();