mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-13 20:18:50 +03:00
add notice for archived threads at top of chatwindow
This commit is contained in:
@@ -31,6 +31,11 @@ ChatWindow::ChatWindow() {
|
||||
m_main->set_hexpand(true);
|
||||
m_main->set_vexpand(true);
|
||||
|
||||
m_topic.get_style_context()->add_class("channel-topic");
|
||||
m_topic.add(m_topic_text);
|
||||
m_topic_text.set_halign(Gtk::ALIGN_START);
|
||||
m_topic_text.show();
|
||||
|
||||
m_input->signal_submit().connect(sigc::mem_fun(*this, &ChatWindow::OnInputSubmit));
|
||||
m_input->signal_escape().connect([this]() {
|
||||
if (m_is_replying)
|
||||
@@ -84,6 +89,7 @@ ChatWindow::ChatWindow() {
|
||||
m_meta->add(*m_input_indicator);
|
||||
m_meta->add(*m_rate_limit_indicator);
|
||||
//m_scroll->add(*m_list);
|
||||
m_main->add(m_topic);
|
||||
m_main->add(*m_chat);
|
||||
m_main->add(m_completer);
|
||||
m_main->add(*m_input);
|
||||
@@ -140,6 +146,11 @@ void ChatWindow::UpdateReactions(Snowflake id) {
|
||||
m_chat->UpdateMessageReactions(id);
|
||||
}
|
||||
|
||||
void ChatWindow::SetTopic(const std::string &text) {
|
||||
m_topic_text.set_text(text);
|
||||
m_topic.set_visible(text.length() > 0);
|
||||
}
|
||||
|
||||
Snowflake ChatWindow::GetActiveChannel() const {
|
||||
return m_active_channel;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public:
|
||||
void InsertChatInput(std::string text);
|
||||
Snowflake GetOldestListedMessage(); // oldest message that is currently in the ListBox
|
||||
void UpdateReactions(Snowflake id);
|
||||
void SetTopic(const std::string &text);
|
||||
|
||||
protected:
|
||||
bool m_is_replying = false;
|
||||
@@ -49,6 +50,9 @@ protected:
|
||||
//Gtk::ListBox *m_list;
|
||||
//Gtk::ScrolledWindow *m_scroll;
|
||||
|
||||
Gtk::EventBox m_topic; // todo probably make everything else go on the stack
|
||||
Gtk::Label m_topic_text;
|
||||
|
||||
ChatList *m_chat;
|
||||
|
||||
ChatInput *m_input;
|
||||
|
||||
Reference in New Issue
Block a user