소스 검색

ChanViewer: Show the time of each post in the thread catalog

Andreas Kling 6 년 전
부모
커밋
e38f78faf5
2개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      Applications/ChanViewer/ThreadCatalogModel.cpp
  2. 1 0
      Applications/ChanViewer/ThreadCatalogModel.h

+ 7 - 1
Applications/ChanViewer/ThreadCatalogModel.cpp

@@ -68,6 +68,8 @@ String ThreadCatalogModel::column_name(int column) const
         return "Replies";
     case Column::ImageCount:
         return "Images";
+    case Column::PostTime:
+        return "Time";
     default:
         ASSERT_NOT_REACHED();
     }
@@ -79,11 +81,13 @@ GModel::ColumnMetadata ThreadCatalogModel::column_metadata(int column) const
     case Column::ThreadNumber:
         return { 70, TextAlignment::CenterRight };
     case Column::Text:
-        return { 200, TextAlignment::CenterLeft };
+        return { 290, TextAlignment::CenterLeft };
     case Column::ReplyCount:
         return { 45, TextAlignment::CenterRight };
     case Column::ImageCount:
         return { 40, TextAlignment::CenterRight };
+    case Column::PostTime:
+        return { 120, TextAlignment::CenterLeft };
     default:
         ASSERT_NOT_REACHED();
     }
@@ -102,6 +106,8 @@ GVariant ThreadCatalogModel::data(const GModelIndex& index, Role role) const
             return thread.get("replies").to_u32();
         case Column::ImageCount:
             return thread.get("images").to_u32();
+        case Column::PostTime:
+            return thread.get("now").to_string();
         default:
             ASSERT_NOT_REACHED();
         }

+ 1 - 0
Applications/ChanViewer/ThreadCatalogModel.h

@@ -10,6 +10,7 @@ public:
         Text,
         ReplyCount,
         ImageCount,
+        PostTime,
         __Count,
     };