diff --git a/src/singletons/windowmanager.cpp b/src/singletons/windowmanager.cpp index 8478bf9a6..f7734451e 100644 --- a/src/singletons/windowmanager.cpp +++ b/src/singletons/windowmanager.cpp @@ -25,6 +25,9 @@ namespace singletons { using SplitNode = widgets::SplitContainer::Node; using SplitDirection = widgets::SplitContainer::Direction; +const int WindowManager::uiScaleMin = -5; +const int WindowManager::uiScaleMax = 10; + void WindowManager::showSettingsDialog() { QTimer::singleShot(80, [] { widgets::SettingsDialog::showDialog(); }); diff --git a/src/singletons/windowmanager.hpp b/src/singletons/windowmanager.hpp index 7f237568e..c28d9706f 100644 --- a/src/singletons/windowmanager.hpp +++ b/src/singletons/windowmanager.hpp @@ -42,8 +42,8 @@ public: pajlada::Signals::NoArgSignal repaintGifs; pajlada::Signals::Signal layout; - static const int uiScaleMin = -5; - static const int uiScaleMax = 10; + static const int uiScaleMin; + static const int uiScaleMax; static int clampUiScale(int scale); static float getUiScaleValue(); static float getUiScaleValue(int scale); diff --git a/src/util/clamp.hpp b/src/util/clamp.hpp index 66fe46fdc..c392b9d24 100644 --- a/src/util/clamp.hpp +++ b/src/util/clamp.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace chatterino { namespace util { @@ -10,13 +10,7 @@ namespace util { template constexpr const T &clamp(const T &v, const T &lo, const T &hi) { - return clamp(v, lo, hi, std::less<>()); -} - -template -constexpr const T &clamp(const T &v, const T &lo, const T &hi, Compare comp) -{ - return assert(!comp(hi, lo)), comp(v, lo) ? lo : comp(hi, v) ? hi : v; + return assert(!(hi < lo)), (v < lo) ? lo : (hi < v) ? hi : v; } } // namespace util