diff --git a/ChangeLog b/ChangeLog index 62f9967..766b41c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ v0.2_dev (29/01/2011) ** User ** Better use of sizers (so better interface!) - No further problems with scrollbar in AccountPanel/SearchPanel when there is a lot of operations + No further problems with scrollbar in AccountPanel/SearchPanel/PreferencesPanel when there is a lot of operations Better fit of interface when displaying grouped operations ** Dev ** @@ -18,3 +18,5 @@ v0.2_dev (29/01/2011) Bug in account creation (readonly fields) Bug in search bad computation of month with start_date and end_date Grouped operations have bad month/year in SearchPanel + Categories fonts not updated for new category --> crash + New category had read only fields in PreferencesPanel diff --git a/src/controller/KissCount.cpp b/src/controller/KissCount.cpp index 4113bc4..3f97e29 100644 --- a/src/controller/KissCount.cpp +++ b/src/controller/KissCount.cpp @@ -230,6 +230,7 @@ wxString KissCount::AddCategory(Category& category) category.id = id; _user->_categories.push_back(category); + _user->_categoriesFonts.push_back(ExtractFont(wxT(""))); return id; } diff --git a/src/view/PreferencesPanel.cpp b/src/view/PreferencesPanel.cpp index 508076f..1829390 100644 --- a/src/view/PreferencesPanel.cpp +++ b/src/view/PreferencesPanel.cpp @@ -52,6 +52,7 @@ PreferencesPanel::PreferencesPanel(KissCount* kiss, wxUI *parent) : KissPanel(ki wxStaticBoxSizer * staticBoxSizer; std::list users; std::list::iterator it; + wxRect rect = wxDisplay().GetGeometry(); SetSizer(vbox); @@ -159,7 +160,10 @@ PreferencesPanel::PreferencesPanel(KissCount* kiss, wxUI *parent) : KissPanel(ki vbox->Add(hbox2, 0, wxALL, 10); Fit(); - SetMinSize(GetSize()); + + SetMinSize(wxSize(rect.width-rect.x-15, rect.height-rect.y-128-25)); + SetMaxSize(wxSize(rect.width-rect.x-15, rect.height-rect.y-128-25)); + SetScrollbars(10, 10, 100/10, 100/10); } KissPanel* PreferencesPanel::CreatePanel() @@ -437,7 +441,7 @@ void PreferencesPanel::OnAccountModified(wxGridEvent& event) _accountsGrid->SetCellValue(0, ACCOUNT_DEFAULT, wxT("1")); } - _wxUI->Layout(); + Fit(); inModification = false; _wxUI->NeedReload(); return; @@ -505,7 +509,7 @@ void PreferencesPanel::OnAccountModified(wxGridEvent& event) AddAccount(row+1, new_account); } - _wxUI->Layout(); + Fit(); _wxUI->NeedReload(); inModification = false; } @@ -680,7 +684,7 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event) _kiss->DeleteCategory(user->_categories[row]); } - _wxUI->Layout(); + Fit(); _wxUI->NeedReload(); inModification = false; return; @@ -716,12 +720,17 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event) _kiss->AddCategory(new_cat); AddCategory(row, new_cat); + _categoriesGrid->SetReadOnly(row, CATEGORY_BACKGROUND_COLOR, false); + _categoriesGrid->SetReadOnly(row, CATEGORY_FOREGROUND_COLOR, false); + _categoriesGrid->SetReadOnly(row, CATEGORY_FONT, false); + _categoriesGrid->SetReadOnly(row, CATEGORY_DELETE, false); + new_cat.id = wxT("0"); _categoriesGrid->AppendRows(); AddCategory(++row, new_cat); } - _wxUI->Layout(); + Fit(); _wxUI->NeedReload(); inModification = false;