[EGD-3094] PR changes, added minimalItemsCount calculation to listview.

This commit is contained in:
Przemyslaw Brudny
2020-06-02 16:53:46 +02:00
committed by PrzeBrudny
parent 8e6d4b284e
commit 6821c8a1b3
32 changed files with 242 additions and 247 deletions

View File

@@ -52,16 +52,16 @@ bool NotesModel::updateRecords(std::unique_ptr<std::vector<NotesRecord>> records
return true;
}
int NotesModel::getMinimalItemHeight()
{
// refactor Notes Item!!!
return 146;
}
gui::ListItem *NotesModel::getItem(gui::Order order)
{
auto index = modelIndex;
if (order == gui::Order::Previous) {
index = records.size() - 1 - modelIndex;
}
std::shared_ptr<NotesRecord> note = getRecord(index);
modelIndex++;
std::shared_ptr<NotesRecord> note = getRecord(order);
SettingsRecord &settings = application->getSettings();
@@ -69,11 +69,7 @@ gui::ListItem *NotesModel::getItem(gui::Order order)
return nullptr;
gui::NotesItem *item = new gui::NotesItem(this, !settings.timeFormat12);
if (item != nullptr) {
item->setNote(note);
item->setID(index);
return item;
}
return nullptr;
item->setNote(note);
return item;
}