Browse Source

Removed old TODOs.

merge-requests/365/head
eidheim 11 years ago
parent
commit
83e72ced0e
  1. 7
      juci/notebook.cc
  2. 1
      juci/source.cc

7
juci/notebook.cc

@ -47,11 +47,6 @@ void Notebook::Controller::CreateKeybindings() {
menu->action_group->add(Gtk::Action::create("WindowCloseTab", "Close tab"), Gtk::AccelKey(menu->key_map["close_tab"]), [this]() { menu->action_group->add(Gtk::Action::create("WindowCloseTab", "Close tab"), Gtk::AccelKey(menu->key_map["close_tab"]), [this]() {
OnCloseCurrentPage(); OnCloseCurrentPage();
}); });
//TODO: Wrap search in a class (together with replace) and make Source::View::search method (now it will probably crash if searching without tabs)
//TODO: Do not update search/highlighting if searching for same string
//TODO: Add custom style to search matches (gtk_source_search_context_set_match_style) and read this from config.json
//TODO: Also update matches while writing in the search field
//TODO: Also update cursor position
menu->action_group->add(Gtk::Action::create("EditFind", "Find"), Gtk::AccelKey(menu->key_map["edit_find"]), [this]() { menu->action_group->add(Gtk::Action::create("EditFind", "Find"), Gtk::AccelKey(menu->key_map["edit_find"]), [this]() {
entry_box.clear(); entry_box.clear();
entry_box.entries.emplace_back(last_search, [this](const std::string& content){ entry_box.entries.emplace_back(last_search, [this](const std::string& content){
@ -62,7 +57,7 @@ void Notebook::Controller::CreateKeybindings() {
search_entry_it->set_placeholder_text("Find"); search_entry_it->set_placeholder_text("Find");
if(CurrentPage()!=-1) if(CurrentPage()!=-1)
CurrentSourceView()->search_highlight(search_entry_it->get_text()); CurrentSourceView()->search_highlight(search_entry_it->get_text());
search_entry_it->signal_key_press_event().connect([this, search_entry_it](GdkEventKey* event){ search_entry_it->signal_key_press_event().connect([this](GdkEventKey* event){
if(event->keyval==GDK_KEY_Return && event->state==GDK_SHIFT_MASK) { if(event->keyval==GDK_KEY_Return && event->state==GDK_SHIFT_MASK) {
if(CurrentPage()!=-1) if(CurrentPage()!=-1)
CurrentSourceView()->search_backward(); CurrentSourceView()->search_backward();

1
juci/source.cc

@ -64,6 +64,7 @@ file_path(file_path), project_path(project_path) {
search_context = gtk_source_search_context_new(get_source_buffer()->gobj(), search_settings); search_context = gtk_source_search_context_new(get_source_buffer()->gobj(), search_settings);
//TODO: why does this not work?: Might be best to use the styles from sourceview. These has to be read from file, search-matches got style "search-match" //TODO: why does this not work?: Might be best to use the styles from sourceview. These has to be read from file, search-matches got style "search-match"
//TODO: in header if trying again: GtkSourceStyle* search_match_style; //TODO: in header if trying again: GtkSourceStyle* search_match_style;
//TODO: We can drop this, only work on newer versions of gtksourceview.
//search_match_style=(GtkSourceStyle*)g_object_new(GTK_SOURCE_TYPE_STYLE, "background-set", 1, "background", "#00FF00", NULL); //search_match_style=(GtkSourceStyle*)g_object_new(GTK_SOURCE_TYPE_STYLE, "background-set", 1, "background", "#00FF00", NULL);
//gtk_source_search_context_set_match_style(search_context, search_match_style); //gtk_source_search_context_set_match_style(search_context, search_match_style);
} }

Loading…
Cancel
Save