diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-12 00:34:30 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-12 00:34:30 -0500 |
commit | 8e972e1334f51512d4e374cca611abfa0753d1f1 (patch) | |
tree | 258a0a683c51ecef4a3500889206cb463e6a703c /windows/guildsettings | |
parent | 921a3c25f8846c3a896745e87f554c7af807a1ad (diff) | |
download | abaddon-portaudio-8e972e1334f51512d4e374cca611abfa0753d1f1.tar.gz abaddon-portaudio-8e972e1334f51512d4e374cca611abfa0753d1f1.zip |
hide guild info panes if you dont have perms for it
add note to bans panel since you can sorta see bans without perms
Diffstat (limited to 'windows/guildsettings')
-rw-r--r-- | windows/guildsettings/banspane.cpp | 15 | ||||
-rw-r--r-- | windows/guildsettings/banspane.hpp | 5 |
2 files changed, 17 insertions, 3 deletions
diff --git a/windows/guildsettings/banspane.cpp b/windows/guildsettings/banspane.cpp index fb4b42b..517ae09 100644 --- a/windows/guildsettings/banspane.cpp +++ b/windows/guildsettings/banspane.cpp @@ -5,7 +5,8 @@ // dont care to figure out why this happens cuz it doesnt seem to break anything GuildSettingsBansPane::GuildSettingsBansPane(Snowflake id) - : GuildID(id) + : Gtk::Box(Gtk::ORIENTATION_VERTICAL) + , GuildID(id) , m_menu_unban("Unban") , m_menu_copy_id("Copy ID") , m_model(Gtk::ListStore::create(m_columns)) { @@ -26,6 +27,12 @@ GuildSettingsBansPane::GuildSettingsBansPane(Snowflake id) } else { for (const auto &ban : discord.GetBansInGuild(id)) OnGuildBanFetch(ban); + + m_no_perms_note = Gtk::manage(new Gtk::Label("You do not have permission to see bans. However, bans made while you are connected will appear here")); + m_no_perms_note->set_single_line_mode(true); + m_no_perms_note->set_ellipsize(Pango::ELLIPSIZE_END); + m_no_perms_note->set_halign(Gtk::ALIGN_START); + add(*m_no_perms_note); } m_menu_unban.signal_activate().connect(sigc::mem_fun(*this, &GuildSettingsBansPane::OnMenuUnban)); @@ -37,7 +44,11 @@ GuildSettingsBansPane::GuildSettingsBansPane(Snowflake id) m_view.signal_button_press_event().connect(sigc::mem_fun(*this, &GuildSettingsBansPane::OnTreeButtonPress), false); m_view.show(); - add(m_view); + + m_scroll.set_propagate_natural_height(true); + m_scroll.add(m_view); + add(m_scroll); + show_all_children(); m_view.set_model(m_model); m_view.append_column("User", m_columns.m_col_user); diff --git a/windows/guildsettings/banspane.hpp b/windows/guildsettings/banspane.hpp index c3e1933..f492226 100644 --- a/windows/guildsettings/banspane.hpp +++ b/windows/guildsettings/banspane.hpp @@ -3,7 +3,7 @@ #include "../../discord/snowflake.hpp" #include "../../discord/ban.hpp" -class GuildSettingsBansPane : public Gtk::ScrolledWindow { +class GuildSettingsBansPane : public Gtk::Box { public: GuildSettingsBansPane(Snowflake id); @@ -16,6 +16,9 @@ private: void OnBanRemove(Snowflake guild_id, Snowflake user_id); void OnBanAdd(Snowflake guild_id, Snowflake user_id); + Gtk::Label *m_no_perms_note = nullptr; + + Gtk::ScrolledWindow m_scroll; Gtk::TreeView m_view; Snowflake GuildID; |