Browse Source

Now reconfigures juci when config.json is saved, although could not do this for keybindings due to depricated functions I guess. Also some smaller fixes.

merge-requests/365/head
eidheim 10 years ago
parent
commit
2ad7b432de
  1. 2
      README.md
  2. 2
      src/config.cc
  3. 1
      src/files.h
  4. 8
      src/juci.cc
  5. 9
      src/menu.cc
  6. 1
      src/menu.h
  7. 305
      src/source.cc
  8. 4
      src/source.h
  9. 28
      src/window.cc
  10. 1
      src/window.h

2
README.md

@ -14,7 +14,7 @@ towards libclang with speed in mind.
* Refactoring across files
* Highlighting of similar types
* Spell checking depending on file context
* Basic editor functionallity
* Basic editor functionality
* Write your own plugins in python (disabled at the moment)
## Dependencies ##

2
src/config.cc

@ -80,6 +80,8 @@ void MainConfig::update_config_file() {
if(cfg.count("version")>0)
cfg.find("version")->second.data()=default_cfg.get<std::string>("version");
}
else
return;
}
catch(const std::exception &e) {
cfg_ok=false;

1
src/files.h

@ -47,6 +47,7 @@ const std::string configjson =
" \"open_file\": \"<primary>o\",\n"
" \"save\": \"<primary>s\",\n"
" \"save_as\": \"<primary><shift>s\",\n"
" \"preferences\": \"<primary>comma\",\n"
" \"quit\": \"<primary>q\",\n"
" \"split_window\": \"<primary><alt>s\",\n"
" \"close_tab\": \"<primary>w\",\n"

8
src/juci.cc

@ -1,6 +1,5 @@
#include "juci.h"
#include "singletons.h"
#include "config.h"
#include <iostream>
using namespace std; //TODO: remove
@ -69,12 +68,7 @@ void app::on_activate() {
}
app::app() : Gtk::Application("no.sout.juci", Gio::APPLICATION_NON_UNIQUE | Gio::APPLICATION_HANDLES_COMMAND_LINE) {
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_APPLICATION);
}
int main(int argc, char *argv[]) {

9
src/menu.cc

@ -1,15 +1,14 @@
#include "menu.h"
#include <iostream>
Menu::Menu() : box(Gtk::ORIENTATION_VERTICAL) {
Menu::Menu() {
action_group = Gtk::ActionGroup::create();
ui_manager = Gtk::UIManager::create();
ui_manager->insert_action_group(action_group);
action_group->add(Gtk::Action::create("FileMenu", "File"));
action_group->add(Gtk::Action::create("EditMenu", "Edit"));
action_group->add(Gtk::Action::create("WindowMenu", "_Window"));
action_group->add(Gtk::Action::create("WindowSplitWindow", "Split window"), Gtk::AccelKey(key_map["split_window"]), [this]() {
});
action_group->add(Gtk::Action::create("ProjectMenu", "P_roject"));
action_group->add(Gtk::Action::create("SourceMenu", "_Source"));
action_group->add(Gtk::Action::create("PluginMenu", "_Plugins"));
@ -31,6 +30,8 @@ Menu::Menu() : box(Gtk::ORIENTATION_VERTICAL) {
" <menuitem action=\"FileSave\"/>\n"
" <menuitem action=\"FileSaveAs\"/>\n"
" <separator/>\n"
" <menuitem action=\"Preferences\"/>\n"
" <separator/>\n"
" <menuitem action=\"FileQuit\"/>\n"
" </menu>\n"
" <menu action=\"EditMenu\">\n"
@ -61,7 +62,6 @@ Menu::Menu() : box(Gtk::ORIENTATION_VERTICAL) {
" </menu>\n"
" <menu action=\"WindowMenu\">\n"
" <menuitem action=\"WindowCloseTab\"/>\n"
" <menuitem action=\"WindowSplitWindow\"/>\n"
" </menu>\n"
" <menu action=\"PluginMenu\">\n"
" </menu>\n"
@ -83,5 +83,6 @@ void Menu::build() {
catch (const Glib::Error &ex) {
std::cerr << "building menu failed" << ex.what();
}
ui_manager->insert_action_group(action_group);
}

1
src/menu.h

@ -11,7 +11,6 @@ public:
Gtk::Widget& get_widget();
void build();
Gtk::Box box;
std::unordered_map<std::string, std::string> key_map;
std::string ui_xml;
Glib::RefPtr<Gtk::UIManager> ui_manager;

305
src/source.cc

@ -78,120 +78,24 @@ Source::View::View(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::L
//TODO: (gtkmm's Gtk::Object has connect_property_changed, so subclassing this might be an idea)
g_signal_connect(search_context, "notify::occurrences-count", G_CALLBACK(search_occurrences_updated), this);
//TODO: Move this to notebook? Might take up too much memory doing this for every tab.
auto style_scheme_manager=Gsv::StyleSchemeManager::get_default();
style_scheme_manager->prepend_search_path(Singleton::style_dir());
if(Singleton::Config::source()->style.size()>0) {
auto scheme = style_scheme_manager->get_scheme(Singleton::Config::source()->style);
if(scheme)
get_source_buffer()->set_style_scheme(scheme);
else
Singleton::terminal()->print("Error: Could not find gtksourceview style: "+Singleton::Config::source()->style+'\n');
}
if(Singleton::Config::source()->wrap_lines)
set_wrap_mode(Gtk::WrapMode::WRAP_CHAR);
property_highlight_current_line() = Singleton::Config::source()->highlight_current_line;
property_show_line_numbers() = Singleton::Config::source()->show_line_numbers;
if(Singleton::Config::source()->font.size()>0)
override_font(Pango::FontDescription(Singleton::Config::source()->font));
//Create tags for diagnostic warnings and errors:
auto scheme = get_source_buffer()->get_style_scheme();
auto tag_table=get_buffer()->get_tag_table();
auto style=scheme->get_style("def:warning");
auto diagnostic_tag=get_source_buffer()->create_tag("def:warning");
auto diagnostic_tag_underline=get_source_buffer()->create_tag("def:warning_underline");
if(style && (style->property_foreground_set() || style->property_background_set())) {
Glib::ustring warning_property;
if(style->property_foreground_set()) {
warning_property=style->property_foreground().get_value();
diagnostic_tag->property_foreground() = warning_property;
}
else if(style->property_background_set())
warning_property=style->property_background().get_value();
diagnostic_tag_underline->property_underline()=Pango::Underline::UNDERLINE_ERROR;
auto tag_class=G_OBJECT_GET_CLASS(diagnostic_tag_underline->gobj()); //For older GTK+ 3 versions:
auto param_spec=g_object_class_find_property(tag_class, "underline-rgba");
if(param_spec!=NULL) {
diagnostic_tag_underline->set_property("underline-rgba", Gdk::RGBA(warning_property));
}
}
style=scheme->get_style("def:error");
diagnostic_tag=get_source_buffer()->create_tag("def:error");
diagnostic_tag_underline=get_source_buffer()->create_tag("def:error_underline");
if(style && (style->property_foreground_set() || style->property_background_set())) {
Glib::ustring error_property;
if(style->property_foreground_set()) {
error_property=style->property_foreground().get_value();
diagnostic_tag->property_foreground() = error_property;
}
else if(style->property_background_set())
error_property=style->property_background().get_value();
diagnostic_tag_underline->property_underline()=Pango::Underline::UNDERLINE_ERROR;
auto tag_class=G_OBJECT_GET_CLASS(diagnostic_tag_underline->gobj()); //For older GTK+ 3 versions:
auto param_spec=g_object_class_find_property(tag_class, "underline-rgba");
if(param_spec!=NULL) {
diagnostic_tag_underline->set_property("underline-rgba", Gdk::RGBA(error_property));
}
}
//TODO: clear tag_class and param_spec?
//Add tooltip foreground and background
style = scheme->get_style("def:note");
auto note_tag=get_source_buffer()->create_tag("def:note_background");
if(style->property_background_set()) {
note_tag->property_background()=style->property_background();
}
note_tag=get_source_buffer()->create_tag("def:note");
if(style->property_foreground_set()) {
note_tag->property_foreground()=style->property_foreground();
}
tab_char=Singleton::Config::source()->default_tab_char;
tab_size=Singleton::Config::source()->default_tab_size;
if(Singleton::Config::source()->auto_tab_char_and_size) {
auto tab_char_and_size=find_tab_char_and_size();
if(tab_char_and_size.first!=0) {
if(tab_char!=tab_char_and_size.first || tab_size!=tab_char_and_size.second) {
std::string tab_str;
if(tab_char_and_size.first==' ')
tab_str="<space>";
else
tab_str="<tab>";
Singleton::terminal()->print("Tab char and size for file "+file_path.string()+" set to: "+tab_str+", "+boost::lexical_cast<std::string>(tab_char_and_size.second)+".\n");
}
tab_char=tab_char_and_size.first;
tab_size=tab_char_and_size.second;
}
}
for(unsigned c=0;c<tab_size;c++)
tab+=tab_char;
tabs_regex=std::regex(std::string("^(")+tab_char+"*)(.*)$");
if(spellcheck_config==NULL) {
get_buffer()->create_tag("def:warning");
get_buffer()->create_tag("def:warning_underline");
get_buffer()->create_tag("def:error");
get_buffer()->create_tag("def:error_underline");
get_buffer()->create_tag("def:note_background");
get_buffer()->create_tag("def:note");
if(spellcheck_config==NULL)
spellcheck_config=new_aspell_config();
if(Singleton::Config::source()->spellcheck_language.size()>0)
aspell_config_replace(spellcheck_config, "lang", Singleton::Config::source()->spellcheck_language.c_str());
}
spellcheck_possible_err=new_aspell_speller(spellcheck_config);
spellcheck_checker=NULL;
if (aspell_error_number(spellcheck_possible_err) != 0)
std::cerr << "Spell check error: " << aspell_error_message(spellcheck_possible_err) << std::endl;
else {
spellcheck_checker = to_aspell_speller(spellcheck_possible_err);
auto tag=get_buffer()->create_tag("spellcheck_error");
tag->property_underline()=Pango::Underline::UNDERLINE_ERROR;
configure();
get_buffer()->signal_changed().connect([this](){
if(spellcheck_checker==NULL)
return;
delayed_spellcheck_suggestions_connection.disconnect();
auto iter=get_buffer()->get_insert()->get_iter();
@ -225,8 +129,25 @@ Source::View::View(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::L
delayed_spellcheck_error_clear.disconnect();
delayed_spellcheck_error_clear=Glib::signal_timeout().connect([this]() {
auto iter=get_buffer()->begin();
bool spell_check=get_source_buffer()->iter_has_context_class(iter, "string") || get_source_buffer()->iter_has_context_class(iter, "comment");
Gtk::TextIter begin_no_spellcheck_iter;
if(spellcheck_all) {
bool spell_check=!get_source_buffer()->iter_has_context_class(iter, "no-spell-check");
if(!spell_check)
begin_no_spellcheck_iter=iter;
while(iter!=get_buffer()->end()) {
if(!get_source_buffer()->iter_forward_to_context_class_toggle(iter, "no-spell-check"))
iter=get_buffer()->end();
spell_check=!spell_check;
if(!spell_check)
begin_no_spellcheck_iter=iter;
else
get_buffer()->remove_tag_by_name("spellcheck_error", begin_no_spellcheck_iter, iter);
}
return false;
}
bool spell_check=get_source_buffer()->iter_has_context_class(iter, "string") || get_source_buffer()->iter_has_context_class(iter, "comment");
if(!spell_check)
begin_no_spellcheck_iter=iter;
while(iter!=get_buffer()->end()) {
@ -252,6 +173,9 @@ Source::View::View(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::L
});
get_buffer()->signal_mark_set().connect([this](const Gtk::TextBuffer::iterator& iter, const Glib::RefPtr<Gtk::TextBuffer::Mark>& mark) {
if(spellcheck_checker==NULL)
return;
if(mark->get_name()=="insert") {
if(spellcheck_suggestions_dialog_shown)
spellcheck_suggestions_dialog->hide();
@ -290,7 +214,6 @@ Source::View::View(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::L
}, 500);
}
});
}
get_buffer()->signal_changed().connect([this](){
set_info(info);
@ -299,6 +222,120 @@ Source::View::View(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::L
set_tooltip_events();
}
void Source::View::configure() {
//TODO: Move this to notebook? Might take up too much memory doing this for every tab.
auto style_scheme_manager=Gsv::StyleSchemeManager::get_default();
style_scheme_manager->prepend_search_path(Singleton::style_dir());
if(Singleton::Config::source()->style.size()>0) {
auto scheme = style_scheme_manager->get_scheme(Singleton::Config::source()->style);
if(scheme)
get_source_buffer()->set_style_scheme(scheme);
else
Singleton::terminal()->print("Error: Could not find gtksourceview style: "+Singleton::Config::source()->style+'\n');
}
if(Singleton::Config::source()->wrap_lines)
set_wrap_mode(Gtk::WrapMode::WRAP_CHAR);
else
set_wrap_mode(Gtk::WrapMode::WRAP_NONE);
property_highlight_current_line() = Singleton::Config::source()->highlight_current_line;
property_show_line_numbers() = Singleton::Config::source()->show_line_numbers;
if(Singleton::Config::source()->font.size()>0)
override_font(Pango::FontDescription(Singleton::Config::source()->font));
//Create tags for diagnostic warnings and errors:
auto scheme = get_source_buffer()->get_style_scheme();
auto tag_table=get_buffer()->get_tag_table();
auto style=scheme->get_style("def:warning");
auto diagnostic_tag=get_buffer()->get_tag_table()->lookup("def:warning");
auto diagnostic_tag_underline=get_buffer()->get_tag_table()->lookup("def:warning_underline");
if(style && (style->property_foreground_set() || style->property_background_set())) {
Glib::ustring warning_property;
if(style->property_foreground_set()) {
warning_property=style->property_foreground().get_value();
diagnostic_tag->property_foreground() = warning_property;
}
else if(style->property_background_set())
warning_property=style->property_background().get_value();
diagnostic_tag_underline->property_underline()=Pango::Underline::UNDERLINE_ERROR;
auto tag_class=G_OBJECT_GET_CLASS(diagnostic_tag_underline->gobj()); //For older GTK+ 3 versions:
auto param_spec=g_object_class_find_property(tag_class, "underline-rgba");
if(param_spec!=NULL) {
diagnostic_tag_underline->set_property("underline-rgba", Gdk::RGBA(warning_property));
}
}
style=scheme->get_style("def:error");
diagnostic_tag=get_buffer()->get_tag_table()->lookup("def:error");
diagnostic_tag_underline=get_buffer()->get_tag_table()->lookup("def:error_underline");
if(style && (style->property_foreground_set() || style->property_background_set())) {
Glib::ustring error_property;
if(style->property_foreground_set()) {
error_property=style->property_foreground().get_value();
diagnostic_tag->property_foreground() = error_property;
}
else if(style->property_background_set())
error_property=style->property_background().get_value();
diagnostic_tag_underline->property_underline()=Pango::Underline::UNDERLINE_ERROR;
auto tag_class=G_OBJECT_GET_CLASS(diagnostic_tag_underline->gobj()); //For older GTK+ 3 versions:
auto param_spec=g_object_class_find_property(tag_class, "underline-rgba");
if(param_spec!=NULL) {
diagnostic_tag_underline->set_property("underline-rgba", Gdk::RGBA(error_property));
}
}
//TODO: clear tag_class and param_spec?
//Add tooltip foreground and background
style = scheme->get_style("def:note");
auto note_tag=get_buffer()->get_tag_table()->lookup("def:note_background");
if(style->property_background_set()) {
note_tag->property_background()=style->property_background();
}
note_tag=get_buffer()->get_tag_table()->lookup("def:note");
if(style->property_foreground_set()) {
note_tag->property_foreground()=style->property_foreground();
}
if(Singleton::Config::source()->spellcheck_language.size()>0)
aspell_config_replace(spellcheck_config, "lang", Singleton::Config::source()->spellcheck_language.c_str());
spellcheck_possible_err=new_aspell_speller(spellcheck_config);
if(spellcheck_checker!=NULL)
delete_aspell_speller(spellcheck_checker);
spellcheck_checker=NULL;
if (aspell_error_number(spellcheck_possible_err) != 0)
std::cerr << "Spell check error: " << aspell_error_message(spellcheck_possible_err) << std::endl;
else
spellcheck_checker = to_aspell_speller(spellcheck_possible_err);
get_buffer()->remove_tag_by_name("spellcheck_error", get_buffer()->begin(), get_buffer()->end());
tab_char=Singleton::Config::source()->default_tab_char;
tab_size=Singleton::Config::source()->default_tab_size;
if(Singleton::Config::source()->auto_tab_char_and_size) {
auto tab_char_and_size=find_tab_char_and_size();
if(tab_char_and_size.first!=0) {
if(tab_char!=tab_char_and_size.first || tab_size!=tab_char_and_size.second) {
std::string tab_str;
if(tab_char_and_size.first==' ')
tab_str="<space>";
else
tab_str="<tab>";
Singleton::terminal()->print("Tab char and size for file "+file_path.string()+" set to: "+tab_str+", "+boost::lexical_cast<std::string>(tab_char_and_size.second)+".\n");
}
tab_char=tab_char_and_size.first;
tab_size=tab_char_and_size.second;
}
}
tab.clear();
for(unsigned c=0;c<tab_size;c++)
tab+=tab_char;
tabs_regex=std::regex(std::string("^(")+tab_char+"*)(.*)$");
}
void Source::View::set_tooltip_events() {
signal_motion_notify_event().connect([this](GdkEventMotion* event) {
if(on_motion_last_x!=event->x || on_motion_last_y!=event->y) {
@ -981,27 +1018,14 @@ clang::Index Source::ClangViewParse::clang_index(0, 0);
Source::ClangViewParse::ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path, Glib::RefPtr<Gsv::Language> language):
Source::View(file_path, language), project_path(project_path), parse_error(false) {
DEBUG("start");
auto scheme = get_source_buffer()->get_style_scheme();
auto tag_table=get_buffer()->get_tag_table();
for (auto &item : Singleton::Config::source()->clang_types) {
if(!tag_table->lookup(item.second)) {
auto style = scheme->get_style(item.second);
auto tag = get_source_buffer()->create_tag(item.second);
if (style) {
if (style->property_foreground_set())
tag->property_foreground() = style->property_foreground();
if (style->property_background_set())
tag->property_background() = style->property_background();
if (style->property_strikethrough_set())
tag->property_strikethrough() = style->property_strikethrough();
// // if (style->property_bold_set()) tag->property_weight() = style->property_bold();
// // if (style->property_italic_set()) tag->property_italic() = style->property_italic();
// // if (style->property_line_background_set()) tag->property_line_background() = style->property_line_background();
// // if (style->property_underline_set()) tag->property_underline() = style->property_underline();
} else
INFO("Style " + item.second + " not found in " + scheme->get_name());
get_buffer()->create_tag(item.second);
}
}
configure();
parsing_in_progress=Singleton::terminal()->print_in_progress("Parsing "+file_path.string());
//GTK-calls must happen in main thread, so the parse_thread
@ -1043,10 +1067,37 @@ Source::View(file_path, language), project_path(project_path), parse_error(false
diagnostic_tooltips.hide();
});
DEBUG("end");
}
void Source::ClangViewParse::configure() {
Source::View::configure();
auto scheme = get_source_buffer()->get_style_scheme();
auto tag_table=get_buffer()->get_tag_table();
for (auto &item : Singleton::Config::source()->clang_types) {
auto tag = get_buffer()->get_tag_table()->lookup(item.second);
if(tag) {
auto style = scheme->get_style(item.second);
if (style) {
if (style->property_foreground_set())
tag->property_foreground() = style->property_foreground();
if (style->property_background_set())
tag->property_background() = style->property_background();
if (style->property_strikethrough_set())
tag->property_strikethrough() = style->property_strikethrough();
// // if (style->property_bold_set()) tag->property_weight() = style->property_bold();
// // if (style->property_italic_set()) tag->property_italic() = style->property_italic();
// // if (style->property_line_background_set()) tag->property_line_background() = style->property_line_background();
// // if (style->property_underline_set()) tag->property_underline() = style->property_underline();
} else
INFO("Style " + item.second + " not found in " + scheme->get_name());
}
}
bracket_regex=std::regex(std::string("^(")+tab_char+"*).*\\{ *$");
no_bracket_statement_regex=std::regex(std::string("^(")+tab_char+"*)(if|for|else if|catch|while) *\\(.*[^;}] *$");
no_bracket_no_para_statement_regex=std::regex(std::string("^(")+tab_char+"*)(else|try|do) *$");
DEBUG("end");
}
Source::ClangViewParse::~ClangViewParse() {

4
src/source.h

@ -55,6 +55,8 @@ namespace Source {
View(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language);
~View();
virtual void configure();
void search_highlight(const std::string &text, bool case_sensitive, bool regex);
std::function<void(int number)> update_search_occurrences;
void search_forward();
@ -141,6 +143,8 @@ namespace Source {
public:
ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path, Glib::RefPtr<Gsv::Language> language);
~ClangViewParse();
void configure();
boost::filesystem::path project_path;
void start_reparse();
bool reparse_needed=false;

28
src/window.cc

@ -37,9 +37,14 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil
set_events(Gdk::POINTER_MOTION_MASK|Gdk::FOCUS_CHANGE_MASK|Gdk::SCROLL_MASK);
add(box);
generate_keybindings();
configure();
//PluginApi(&this->notebook, &this->menu);
//TODO: Do not use deprecated ui_manager? And make menu shortcuts update when config.json is saved (in configure())
generate_keybindings();
create_menu();
menu.build();
add_accel_group(menu.ui_manager->get_accel_group());
box.pack_start(menu.get_widget(), Gtk::PACK_SHRINK);
directory_and_notebook_panes.pack1(directories, Gtk::SHRINK);
@ -135,6 +140,15 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil
DEBUG("end");
} // Window constructor
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_APPLICATION);
}
void Window::create_menu() {
menu.action_group->add(Gtk::Action::create("FileQuit", "Quit juCi++"), Gtk::AccelKey(menu.key_map["quit"]), [this]() {
hide();
@ -158,9 +172,19 @@ void Window::create_menu() {
menu.action_group->add(Gtk::Action::create("FileSaveAs", "Save As"), Gtk::AccelKey(menu.key_map["save_as"]), [this]() {
save_file_dialog();
});
menu.action_group->add(Gtk::Action::create("Preferences", "Preferences..."), Gtk::AccelKey(menu.key_map["preferences"]), [this]() {
notebook.open(Singleton::config_dir()+"config.json");
});
menu.action_group->add(Gtk::Action::create("FileSave", "Save"), Gtk::AccelKey(menu.key_map["save"]), [this]() {
notebook.save_current();
if(notebook.get_current_page()!=-1) {
if(notebook.get_current_view()->file_path==Singleton::config_dir()+"config.json") {
configure();
for(int c=0;c<notebook.size();c++)
notebook.get_view(c)->configure();
}
}
});
menu.action_group->add(Gtk::Action::create("EditCopy", "Copy"), Gtk::AccelKey(menu.key_map["edit_copy"]), [this]() {
@ -335,8 +359,6 @@ void Window::create_menu() {
about.show();
about.present();
});
add_accel_group(menu.ui_manager->get_accel_group());
menu.build();
}
bool Window::on_key_press_event(GdkEventKey *event) {

1
src/window.h

@ -39,6 +39,7 @@ private:
Menu menu;
std::atomic<bool> compiling;
void configure();
void create_menu();
void hide();
void new_file_dialog();

Loading…
Cancel
Save