summaryrefslogtreecommitdiff
path: root/components/channels.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-11-10 01:38:44 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2020-11-10 01:38:44 -0500
commiteb0feef51166eeabd58993c484e85e0739285aa1 (patch)
tree200c93680df8ecbcf127cc59e2f940e9f8af4b90 /components/channels.hpp
parent823e1786e016a0dce58ffda0506608f2a2fce932 (diff)
downloadabaddon-portaudio-eb0feef51166eeabd58993c484e85e0739285aa1.tar.gz
abaddon-portaudio-eb0feef51166eeabd58993c484e85e0739285aa1.zip
use textviews in channel list + parse emojis
Diffstat (limited to 'components/channels.hpp')
-rw-r--r--components/channels.hpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/components/channels.hpp b/components/channels.hpp
index 0326841..485cb5f 100644
--- a/components/channels.hpp
+++ b/components/channels.hpp
@@ -8,6 +8,8 @@
#include <sigc++/sigc++.h>
#include "../discord/discord.hpp"
+static const constexpr int ChannelEmojiSize = 16;
+
class ChannelListRow : public Gtk::ListBoxRow {
public:
bool IsUserCollapsed;
@@ -17,6 +19,8 @@ public:
virtual void Collapse();
virtual void Expand();
+
+ static void MakeReadOnly(Gtk::TextView *tv);
};
class ChannelListRowDMHeader : public ChannelListRow {
@@ -38,7 +42,7 @@ protected:
Gtk::EventBox *m_ev;
Gtk::Box *m_box;
- Gtk::Label *m_lbl;
+ Gtk::TextView *m_lbl;
Gtk::Image *m_icon = nullptr;
};
@@ -53,7 +57,7 @@ protected:
Gtk::EventBox *m_ev;
Gtk::Box *m_box;
- Gtk::Label *m_lbl;
+ Gtk::TextView *m_lbl;
Gtk::Image *m_icon;
};
@@ -67,7 +71,7 @@ public:
protected:
Gtk::EventBox *m_ev;
Gtk::Box *m_box;
- Gtk::Label *m_lbl;
+ Gtk::TextView *m_lbl;
Gtk::Arrow *m_arrow;
};
@@ -78,7 +82,7 @@ public:
protected:
Gtk::EventBox *m_ev;
Gtk::Box *m_box;
- Gtk::Label *m_lbl;
+ Gtk::TextView *m_lbl;
};
class ChannelList {
@@ -133,6 +137,7 @@ protected:
// i would use one map but in really old guilds there can be a channel w/ same id as the guild so this hacky shit has to do
std::unordered_map<Snowflake, ChannelListRow *> m_guild_id_to_row;
std::unordered_map<Snowflake, ChannelListRow *> m_id_to_row;
+ std::unordered_map<Snowflake, ChannelListRow *> m_dm_id_to_row;
void InsertGuildAt(Snowflake id, int pos);
@@ -141,6 +146,8 @@ protected:
void AttachGuildMenuHandler(Gtk::ListBoxRow *row);
void AttachChannelMenuHandler(Gtk::ListBoxRow *row);
+ void CheckBumpDM(Snowflake channel_id);
+
public:
typedef sigc::signal<void, Snowflake> type_signal_action_channel_item_select;
typedef sigc::signal<void, Snowflake> type_signal_action_guild_move_up;