Skip to content

Commit

Permalink
Revert "add settings for channel list scrollbar policies"
Browse files Browse the repository at this point in the history
This reverts commit d7bee05.
  • Loading branch information
ouwou committed Jan 21, 2024
1 parent d7bee05 commit 1d1bd7e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 18 deletions.
4 changes: 1 addition & 3 deletions src/components/channellist/channellist.cpp
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class SettingsManager {
std::string MentionBadgeColor;
std::string MentionBadgeTextColor;
std::string UnreadIndicatorColor;
std::string ClassicGuildScrollPolicy;
std::string ClassicChannelScrollPolicy;

// [notifications]
bool NotificationsEnabled;
Expand Down
8 changes: 0 additions & 8 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 0 additions & 3 deletions src/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <optional>
#include <type_traits>

#include <gtkmm/enums.h>
#include <sigc++/slot.h>

namespace Glib {
Expand All @@ -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);
Expand Down

0 comments on commit 1d1bd7e

Please sign in to comment.