Closed melix99 closed 3 years ago
Quick update on the Content widget (for how I'm implementing it).
First of all, it is no longer a GtkStack, but it's just a normal AdwBin with a child widget: the ContentChatHistory. The ContentChatHistory is basically the widget that contains both the message list and the "send message area". The idea is to have a selected-chat GObject parameter that's shared between the Sidebar and the ContentChatHistory to know which chat to show in the ContentChatHistory widget.
For now my target is to implement a basic ContentChatHistory that can show the last 20 messages. Then, the next challenge is to dynamically load older messages using the scroll value of the GtkScrolledWindow.
Closing this as the new app structure is implemented in the rewrite branch.
We need a basic app structure (or hierarchy) to better visualize and organize the project. I recently saw this blog post of a Fractal core contributor that talks about the structure of Fractal's rewrite in gtk4-rs and, since that project is pretty similar to Telegrand, I think that we can use a similar structure and design.
So, a basic hierarchy for Telegrand would look like this:
Then for the Session:
Then we would also define the relative GObjects, but that's pretty easy as they should be wrappers around TDLib's objects. The only problem is assuring that the objects are updated when we receive the relative update events. We receive updates from the receive() function that we will have in the Window object so, when we receive an update, the idea is to dispatch the updated object to the relative GObject though (probably) functions and maybe using hashmaps to find the correct GObject by an identifier. Obviously this doesn't sound too great so I'm really looking for a better solution, if you have one please don't be afraid to comment!