Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageListView and pinned messages #506

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

melix99
Copy link
Collaborator

@melix99 melix99 commented Mar 14, 2023

No description provided.

Comment on lines 55 to 65
fn show_message_menu(&self, x: i32, y: i32) {
let obj = self.obj();
let chat_history = obj.ancestor(ChatHistory::static_type()).unwrap();
let menu = chat_history
.downcast_ref::<ChatHistory>()
.unwrap()
.message_menu();

menu.set_pointing_to(Some(&gdk::Rectangle::new(x, y, 0, 0)));
menu.unparent();
menu.set_parent(&*obj);
menu.popup();
// let obj = self.obj();
// let chat_history = obj.ancestor(ChatHistory::static_type()).unwrap();
// let menu = chat_history
// .downcast_ref::<ChatHistory>()
// .unwrap()
// .message_menu();

// menu.set_pointing_to(Some(&gdk::Rectangle::new(x, y, 0, 0)));
// menu.unparent();
// menu.set_parent(&*obj);
// menu.popup();
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to handle message menus in a way that's not dependent on ChatHistory anymore.

@melix99 melix99 added this to the Telegrand 0.1 milestone Mar 22, 2023
This a new major change to the chat history. We now have a new widget
component, called MessageListView, which can display messages... in a
list view. For now it's basically the same as the internal list view in
ChatHistory, but in the future it will support showing messages from
other contexts, like pinned messages history, reply threads, post
comments, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant