diff --git a/TODO.md b/TODO.md index 289e7c5..cd9f0d1 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,7 @@ ## Before releasing v0.1.0 - [x] In BoardCanvas search for a workaround of the dynamic allocation of adata.buffer (on canvas resize) - - [ ] Bind the chess game editor settings to EditorPrefs.hpp + - [x] Bind the chess game editor settings to EditorPrefs.hpp - [x] Ask before closing MainWindow/Tabs if anything is not saved - [x] Disable the save button in GameTab after saving (and re-enable it on new changes) - [ ] Make PGNGameBase use GotoNextGame() instead of ParseNextGame() in the NextGame() method to improve performance diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp index b728d91..0e413c8 100644 --- a/src/game_tab/right_panel/editor/EditorCanvas.cpp +++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp @@ -8,10 +8,10 @@ EditorCanvas::EditorCanvas(wxFrame *parent, std::shared_ptr game) // Theme: default_font=wxFont(*wxNORMAL_FONT).MakeBold(); - color_scrollbar_bg=wxColour(243,243,243); - color_scrollbar=*wxLIGHT_GREY; - color_margin=wxColour(243,243,243); - color_comments_bg=wxColour(255, 255, 204); + color_scrollbar_bg=wxColour("#FFFFFF"); + color_scrollbar=wxColour("#838383"); + color_margin=wxColour("#F3F3F3"); + color_comments_bg=wxColour("#ffffcc"); color_current_move_bg=wxColour(216, 216, 216); color_menu_item_bg=wxColour(216, 216, 216); // The following should be called when using an EVT_PAINT handler @@ -233,6 +233,10 @@ void EditorCanvas::ApplyPreferences(){ CGEditor::status.MoveHeight=conf->Read("row_size", 50); CGEditor::status.MoveWidth=conf->Read("col_size", 100); CGEditor::status.UseMoveIcons=conf->Read("show_move_icons", true); + color_margin=wxColour(conf->Read("color_margin", "#F3F3F3")); + color_scrollbar=wxColour(conf->Read("color_scrollbar", "#838383")); + color_scrollbar_bg=wxColour(conf->Read("color_scrollbarbg", "#FFFFFF")); + color_comments_bg=wxColour(conf->Read("color_commentbg", "#ffffcc")); CONFIG_CLOSE(conf); Refresh(); } diff --git a/src/preferences/EditorPrefs.hpp b/src/preferences/EditorPrefs.hpp index 4287410..d1c48d9 100644 --- a/src/preferences/EditorPrefs.hpp +++ b/src/preferences/EditorPrefs.hpp @@ -21,6 +21,10 @@ public: row_size->SetValue(config->Read("editor/row_size", 50)); col_size->SetValue(config->Read("editor/col_size", 100)); show_move_icons->SetValue(config->Read("editor/show_move_icons", true)); + color_margin->SetColour(wxColour(config->Read("editor/color_margin", "#F3F3F3"))); + color_scrollbar->SetColour(wxColour(config->Read("editor/color_scrollbar", "#838383"))); + color_scrollbarbg->SetColour(wxColour(config->Read("editor/color_scrollbarbg", "#FFFFFF"))); + color_commentbg->SetColour(wxColour(config->Read("editor/color_commentbg", "#ffffcc"))); CONFIG_CLOSE(config); return true; } @@ -30,6 +34,10 @@ public: config->Write("editor/row_size", row_size->GetValue()); config->Write("editor/col_size", col_size->GetValue()); config->Write("editor/show_move_icons", show_move_icons->GetValue()); + config->Write("editor/color_margin", color_margin->GetColour().GetAsString()); + config->Write("editor/color_scrollbar", color_scrollbar->GetColour().GetAsString()); + config->Write("editor/color_scrollbarbg", color_scrollbarbg->GetColour().GetAsString()); + config->Write("editor/color_commentbg", color_commentbg->GetColour().GetAsString()); CONFIG_CLOSE(config); }