mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
ChanViewer: Show thread subjects in the catalog view
This commit is contained in:
parent
103c2749ce
commit
a416390622
3 changed files with 9 additions and 2 deletions
|
@ -66,6 +66,8 @@ String ThreadCatalogModel::column_name(int column) const
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case Column::ThreadNumber:
|
case Column::ThreadNumber:
|
||||||
return "#";
|
return "#";
|
||||||
|
case Column::Subject:
|
||||||
|
return "Subject";
|
||||||
case Column::Text:
|
case Column::Text:
|
||||||
return "Text";
|
return "Text";
|
||||||
case Column::ReplyCount:
|
case Column::ReplyCount:
|
||||||
|
@ -84,8 +86,10 @@ GModel::ColumnMetadata ThreadCatalogModel::column_metadata(int column) const
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case Column::ThreadNumber:
|
case Column::ThreadNumber:
|
||||||
return { 70, TextAlignment::CenterRight };
|
return { 70, TextAlignment::CenterRight };
|
||||||
|
case Column::Subject:
|
||||||
|
return { 170, TextAlignment::CenterLeft };
|
||||||
case Column::Text:
|
case Column::Text:
|
||||||
return { 290, TextAlignment::CenterLeft };
|
return { 270, TextAlignment::CenterLeft };
|
||||||
case Column::ReplyCount:
|
case Column::ReplyCount:
|
||||||
return { 45, TextAlignment::CenterRight };
|
return { 45, TextAlignment::CenterRight };
|
||||||
case Column::ImageCount:
|
case Column::ImageCount:
|
||||||
|
@ -104,6 +108,8 @@ GVariant ThreadCatalogModel::data(const GModelIndex& index, Role role) const
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case Column::ThreadNumber:
|
case Column::ThreadNumber:
|
||||||
return thread.get("no").to_u32();
|
return thread.get("no").to_u32();
|
||||||
|
case Column::Subject:
|
||||||
|
return thread.get("sub").to_string();
|
||||||
case Column::Text:
|
case Column::Text:
|
||||||
return thread.get("com").to_string();
|
return thread.get("com").to_string();
|
||||||
case Column::ReplyCount:
|
case Column::ReplyCount:
|
||||||
|
|
|
@ -7,6 +7,7 @@ class ThreadCatalogModel final : public GModel {
|
||||||
public:
|
public:
|
||||||
enum Column {
|
enum Column {
|
||||||
ThreadNumber,
|
ThreadNumber,
|
||||||
|
Subject,
|
||||||
Text,
|
Text,
|
||||||
ReplyCount,
|
ReplyCount,
|
||||||
ImageCount,
|
ImageCount,
|
||||||
|
|
|
@ -11,7 +11,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto* window = new GWindow;
|
auto* window = new GWindow;
|
||||||
window->set_title("ChanViewer");
|
window->set_title("ChanViewer");
|
||||||
window->set_rect(100, 100, 640, 480);
|
window->set_rect(100, 100, 800, 500);
|
||||||
window->set_icon(load_png("/res/icons/16x16/app-chanviewer.png"));
|
window->set_icon(load_png("/res/icons/16x16/app-chanviewer.png"));
|
||||||
|
|
||||||
auto* widget = new GWidget;
|
auto* widget = new GWidget;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue