diff --git a/src/view/AccountPanel.cpp b/src/view/AccountPanel.cpp index eff6f38..7f4570f 100644 --- a/src/view/AccountPanel.cpp +++ b/src/view/AccountPanel.cpp @@ -277,9 +277,15 @@ void AccountPanel::LoadYear(int year, bool showMonth) _wxUI->Layout(); } -#define SET_ROW_COLOR(row, color) for(int i=0; iSetCellBackgroundColour(row, i, color); \ + _grid->SetCellBackgroundColour(row, i, backcolor); \ + _grid->SetCellTextColour(row, i, forecolor); \ + } + +#define SET_ROW_FONT(row, font) for(int i=0; iSetCellFont(row, i, font); \ } void AccountPanel::ShowMonth(int month, int year) @@ -667,7 +673,8 @@ void AccountPanel::OnOperationModified(wxGridEvent& event) color.Set(r, g, b, color.Alpha()); } - SET_ROW_COLOR(event.GetRow(), color); + SET_ROW_COLOR(event.GetRow(), color, user->GetCategory(new_op.category).forecolor); + SET_ROW_FONT(event.GetRow(), user->GetCategoryFont(new_op.category)); } if (col == DELETE) @@ -733,6 +740,12 @@ void AccountPanel::OnOperationModified(wxGridEvent& event) if (i == CATEGORY) continue; _grid->SetCellValue(event.GetRow(), i, wxT("")); } + + DEFAULT_FONT(font); + + SET_ROW_COLOR(row, OWN_GREEN, *wxBLACK); + SET_ROW_FONT(row, font); + new_op.id = _kiss->AddOperation(new_op); } // Modify an operation @@ -783,6 +796,12 @@ void AccountPanel::OnOperationModified(wxGridEvent& event) { _grid->SetCellValue(event.GetRow(), i, wxT("")); } + + DEFAULT_FONT(font); + + SET_ROW_COLOR(event.GetRow(), OWN_GREEN, *wxBLACK); + SET_ROW_FONT(event.GetRow(), font); + new_op.id = _kiss->AddOperation(new_op); } @@ -806,6 +825,7 @@ void AccountPanel::OnOperationModified(wxGridEvent& event) } _curOperations->insert(_curOperations->begin()+i ,new_op); + i++; // For header if (!fix_op) i++; InsertOperation(user, &new_op, i, fix_op);