From 1d1bd7e3454b58ddf3b4d803bff8e9ed24ee4a22 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 21 Jan 2024 16:27:42 -0500 Subject: [PATCH] Revert "add settings for channel list scrollbar policies" This reverts commit d7bee05ee92bf14c1344d336cfa5398815e8ccc9. --- src/components/channellist/channellist.cpp | 4 +--- src/settings.cpp | 2 -- src/settings.hpp | 2 -- src/util.cpp | 8 -------- src/util.hpp | 3 --- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/components/channellist/channellist.cpp b/src/components/channellist/channellist.cpp index 2bb2f118..1cdf6198 100644 --- a/src/components/channellist/channellist.cpp +++ b/src/components/channellist/channellist.cpp @@ -1,15 +1,13 @@ #include "channellist.hpp" #include "abaddon.hpp" -#include "util.hpp" ChannelList::ChannelList() { ConnectSignals(); m_guilds.set_halign(Gtk::ALIGN_START); - m_guilds_scroll.set_policy(Gtk::POLICY_NEVER, util::TranslateScrollPolicy(Abaddon::Get().GetSettings().ClassicGuildScrollPolicy)); - m_tree.set_policy(Gtk::POLICY_AUTOMATIC, util::TranslateScrollPolicy(Abaddon::Get().GetSettings().ClassicChannelScrollPolicy)); + m_guilds_scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); m_guilds.signal_guild_selected().connect([this](Snowflake guild_id) { m_tree.SetSelectedGuild(guild_id); diff --git a/src/settings.cpp b/src/settings.cpp index 0b1ef49f..654a726f 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -113,8 +113,6 @@ void SettingsManager::DefineSettings() { AddSetting("style", "mentionbadgecolor", "rgba(184, 37, 37, 0)"s, &Settings::MentionBadgeColor); AddSetting("style", "mentionbadgetextcolor", "rgba(251, 251, 251, 0)"s, &Settings::MentionBadgeTextColor); AddSetting("style", "unreadcolor", "rgba(255, 255, 255, 0)"s, &Settings::UnreadIndicatorColor); - AddSetting("style", "classic_guild_scroll_policy", "automatic"s, &Settings::ClassicGuildScrollPolicy); - AddSetting("style", "classic_channel_scroll_policy", "automatic"s, &Settings::ClassicChannelScrollPolicy); #ifdef _WIN32 AddSetting("notifications", "enabled", false, &Settings::NotificationsEnabled); diff --git a/src/settings.hpp b/src/settings.hpp index d29c623f..df723fcf 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -44,8 +44,6 @@ class SettingsManager { std::string MentionBadgeColor; std::string MentionBadgeTextColor; std::string UnreadIndicatorColor; - std::string ClassicGuildScrollPolicy; - std::string ClassicChannelScrollPolicy; // [notifications] bool NotificationsEnabled; diff --git a/src/util.cpp b/src/util.cpp index d0d6e246..09bb368a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -228,11 +228,3 @@ uint64_t util::TimeToEpoch(int year, int month, int day, int hour, int minute, i secs += seconds; return secs; } - -Gtk::PolicyType util::TranslateScrollPolicy(const std::string &str) { - if (str == "never") return Gtk::POLICY_NEVER; - if (str == "automatic") return Gtk::POLICY_AUTOMATIC; - if (str == "always") return Gtk::POLICY_ALWAYS; - if (str == "external") return Gtk::POLICY_EXTERNAL; - return Gtk::POLICY_AUTOMATIC; -} diff --git a/src/util.hpp b/src/util.hpp index f839eca1..fc9568b4 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -14,7 +14,6 @@ #include #include -#include #include namespace Glib { @@ -39,8 +38,6 @@ bool IsFolder(std::string_view path); bool IsFile(std::string_view path); uint64_t TimeToEpoch(int year, int month, int day, int hour, int minute, int seconds); - -Gtk::PolicyType TranslateScrollPolicy(const std::string &str); } // namespace util void LaunchBrowser(const Glib::ustring &url);