mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:52:44 +00:00 
			
		
		
		
	ChanViewer: Show the time of each post in the thread catalog
This commit is contained in:
		
							parent
							
								
									030891531b
								
							
						
					
					
						commit
						e38f78faf5
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		|  | @ -68,6 +68,8 @@ String ThreadCatalogModel::column_name(int column) const | ||||||
|         return "Replies"; |         return "Replies"; | ||||||
|     case Column::ImageCount: |     case Column::ImageCount: | ||||||
|         return "Images"; |         return "Images"; | ||||||
|  |     case Column::PostTime: | ||||||
|  |         return "Time"; | ||||||
|     default: |     default: | ||||||
|         ASSERT_NOT_REACHED(); |         ASSERT_NOT_REACHED(); | ||||||
|     } |     } | ||||||
|  | @ -79,11 +81,13 @@ GModel::ColumnMetadata ThreadCatalogModel::column_metadata(int column) const | ||||||
|     case Column::ThreadNumber: |     case Column::ThreadNumber: | ||||||
|         return { 70, TextAlignment::CenterRight }; |         return { 70, TextAlignment::CenterRight }; | ||||||
|     case Column::Text: |     case Column::Text: | ||||||
|         return { 200, TextAlignment::CenterLeft }; |         return { 290, TextAlignment::CenterLeft }; | ||||||
|     case Column::ReplyCount: |     case Column::ReplyCount: | ||||||
|         return { 45, TextAlignment::CenterRight }; |         return { 45, TextAlignment::CenterRight }; | ||||||
|     case Column::ImageCount: |     case Column::ImageCount: | ||||||
|         return { 40, TextAlignment::CenterRight }; |         return { 40, TextAlignment::CenterRight }; | ||||||
|  |     case Column::PostTime: | ||||||
|  |         return { 120, TextAlignment::CenterLeft }; | ||||||
|     default: |     default: | ||||||
|         ASSERT_NOT_REACHED(); |         ASSERT_NOT_REACHED(); | ||||||
|     } |     } | ||||||
|  | @ -102,6 +106,8 @@ GVariant ThreadCatalogModel::data(const GModelIndex& index, Role role) const | ||||||
|             return thread.get("replies").to_u32(); |             return thread.get("replies").to_u32(); | ||||||
|         case Column::ImageCount: |         case Column::ImageCount: | ||||||
|             return thread.get("images").to_u32(); |             return thread.get("images").to_u32(); | ||||||
|  |         case Column::PostTime: | ||||||
|  |             return thread.get("now").to_string(); | ||||||
|         default: |         default: | ||||||
|             ASSERT_NOT_REACHED(); |             ASSERT_NOT_REACHED(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -10,6 +10,7 @@ public: | ||||||
|         Text, |         Text, | ||||||
|         ReplyCount, |         ReplyCount, | ||||||
|         ImageCount, |         ImageCount, | ||||||
|  |         PostTime, | ||||||
|         __Count, |         __Count, | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling