From 4e4986f6709cfc7f8e4cae734e8579695f3c07b4 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 31 Jul 2022 17:23:00 -0400 Subject: grey out leave button if user owns the guild --- src/components/channels.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/channels.cpp b/src/components/channels.cpp index 0a49701..497c021 100644 --- a/src/components/channels.cpp +++ b/src/components/channels.cpp @@ -911,10 +911,15 @@ void ChannelList::OnGuildSubmenuPopup() { const auto iter = m_model->get_iter(m_path_for_menu); if (!iter) return; const auto id = static_cast((*iter)[m_columns.m_id]); - if (Abaddon::Get().GetDiscordClient().IsGuildMuted(id)) + auto &discord = Abaddon::Get().GetDiscordClient(); + if (discord.IsGuildMuted(id)) m_menu_guild_toggle_mute.set_label("Unmute"); else m_menu_guild_toggle_mute.set_label("Mute"); + + const auto guild = discord.GetGuild(id); + const auto self_id = discord.GetUserData().ID; + m_menu_guild_leave.set_sensitive(!(guild.has_value() && guild->OwnerID == self_id)); } void ChannelList::OnCategorySubmenuPopup() { -- cgit v1.2.3 From 319f9c392c008b4474b88ba3757105892b0e3020 Mon Sep 17 00:00:00 2001 From: dragontamer8740 Date: Fri, 5 Aug 2022 00:22:59 -0400 Subject: fixed text input box to not resize when typing (#89) --- src/components/chatinput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index c3eca32..3e1db15 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -5,7 +5,7 @@ ChatInput::ChatInput() { set_propagate_natural_height(true); set_min_content_height(20); set_max_content_height(250); - set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + set_policy(Gtk::POLICY_EXTERNAL, Gtk::POLICY_AUTOMATIC); // hack auto cb = [this](GdkEventKey *e) -> bool { -- cgit v1.2.3