aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/right_panel')
-rw-r--r--src/game_tab/right_panel/GameTabRightPanel.cpp2
-rw-r--r--src/game_tab/right_panel/editor/EditorCanvas.cpp12
-rw-r--r--src/game_tab/right_panel/editor/EditorCanvas.hpp2
3 files changed, 12 insertions, 4 deletions
diff --git a/src/game_tab/right_panel/GameTabRightPanel.cpp b/src/game_tab/right_panel/GameTabRightPanel.cpp
index dd0ebca..7aa8bbd 100644
--- a/src/game_tab/right_panel/GameTabRightPanel.cpp
+++ b/src/game_tab/right_panel/GameTabRightPanel.cpp
@@ -156,8 +156,8 @@ void GameTabRightPanel::ApplyPreferences() {
engine_list->Append(engine_name);
} while (conf->GetNextGroup(engine_name, index));
}
-
CONFIG_CLOSE(conf);
+ editor_canvas->ApplyPreferences();
}
void GameTabRightPanel::RefreshTagsList() {
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp
index 19d81ec..b728d91 100644
--- a/src/game_tab/right_panel/editor/EditorCanvas.cpp
+++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp
@@ -31,8 +31,6 @@ void EditorCanvas::OnPaint(wxPaintEvent &event) {
wxSize sz = GetClientSize();
CGEditor::status.CanvasWidth = sz.GetWidth();
CGEditor::status.CanvasHeight = sz.GetHeight();
- CGEditor::status.UseMoveIcons =
- true; // Piece image should be drawn before the move ?
const wxPoint pt = wxGetMousePosition();
CGEditor::status.MouseX = pt.x - this->GetScreenPosition().x;
@@ -229,5 +227,15 @@ void EditorCanvas::SetMoves(HalfMove *moves, HalfMove *current) {
Refresh();
}
+void EditorCanvas::ApplyPreferences(){
+ CONFIG_OPEN(conf);
+ conf->SetPath("editor/");
+ 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);
+ CONFIG_CLOSE(conf);
+ Refresh();
+}
+
wxBEGIN_EVENT_TABLE(EditorCanvas, wxPanel) EVT_PAINT(EditorCanvas::OnPaint)
EVT_MOUSE_EVENTS(EditorCanvas::MouseEvent) wxEND_EVENT_TABLE()
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.hpp b/src/game_tab/right_panel/editor/EditorCanvas.hpp
index 740a6a1..7fea474 100644
--- a/src/game_tab/right_panel/editor/EditorCanvas.hpp
+++ b/src/game_tab/right_panel/editor/EditorCanvas.hpp
@@ -31,6 +31,6 @@ public:
void DrawElement(const cgeditor::Element &e);
void HandleEvent(const cgeditor::Event &e);
void SetMoves(HalfMove *moves, HalfMove *current);
-
+ void ApplyPreferences();
DECLARE_EVENT_TABLE()
};