feat(misc): a bunch of crude UI/UX tweaks

- display add time for later use
- basic keyboard navigation support
- remember last-used server address
- show connection error when attempt to connect to server
This commit is contained in:
2024-11-15 20:58:03 +08:00
parent 1f7adc2a3a
commit edb3338bc4
8 changed files with 59 additions and 8 deletions

View File

@ -8,6 +8,7 @@ ComicItem::ComicItem(QJsonObject jsonObj, const QString &name)
setData(jsonObj["num_pages"].toInt(), PageCountRole);
setData(jsonObj["current_page"].toInt(), CurrentPageRole);
setData(jsonObj["type"].toInt(), TypeRole);
setData(jsonObj["added"].toInteger(), AddedTimeRole);
}
QHash<int, QByteArray> ComicItem::roleNames()
@ -19,5 +20,6 @@ QHash<int, QByteArray> ComicItem::roleNames()
{ComicItem::PageCountRole, "pageCount"},
{ComicItem::CurrentPageRole, "currentPage"},
{ComicItem::TypeRole, "type"},
{ComicItem::AddedTimeRole, "addedTime"},
};
}

View File

@ -14,6 +14,7 @@ public:
PageCountRole,
CurrentPageRole,
TypeRole,
AddedTimeRole,
};
Q_ENUM(Roles)