From 3ea496a99b764abe8e9c0436d3e8612d809c2f5a Mon Sep 17 00:00:00 2001 From: apa420 <17131426+apa420@users.noreply.github.com> Date: Fri, 10 May 2019 22:37:44 +0200 Subject: [PATCH] Added boldness adjustment for fonts (#1057) * Added boldness adjustment for fonts * Moved setting and changed description of it --- src/singletons/Settings.hpp | 7 +++---- src/widgets/settingspages/GeneralPage.cpp | 10 +++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 6c4ca3506..eef7a96f2 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -46,7 +46,7 @@ public: "/appearance/messages/collapseMessagesMinLines", 0}; BoolSetting alternateMessages = { "/appearance/messages/alternateMessageBackground", false}; - IntSetting boldScale = {"/appearance/boldScale", 57}; + FloatSetting boldScale = {"/appearance/boldScale", 50}; BoolSetting showTabCloseButton = {"/appearance/showTabCloseButton", true}; BoolSetting showTabLive = {"/appearance/showTabLiveButton", false}; BoolSetting hidePreferencesButton = {"/appearance/hidePreferencesButton", @@ -173,9 +173,8 @@ public: "qrc:/sounds/ping3.wav"}; BoolSetting notificationToast = {"/notifications/enableToast", false}; - IntSetting openFromToast = { - "/notifications/openFromToast", - static_cast(ToastReaction::OpenInBrowser)}; + IntSetting openFromToast = {"/notifications/openFromToast", + static_cast(ToastReaction::OpenInBrowser)}; /// External tools // Streamlink diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index ee012c21a..8e4484796 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -254,9 +254,17 @@ void GeneralPage::initLayout(SettingsLayout &layout) layout.addTitle("Miscellaneous"); layout.addCheckbox("Show joined users (< 1000 chatters)", s.showJoins); layout.addCheckbox("Show parted users (< 1000 chatters)", s.showParts); - layout.addDropdown("Boldness", {"Not implemented"}); layout.addCheckbox("Lowercase domains", s.lowercaseDomains); layout.addCheckbox("Bold @usernames", s.boldUsernames); + layout.addDropdown( + "Username font weight", {"0", "25", "Default", "75", "100"}, s.boldScale, + [](auto val) { + if (val == 50) + return QString("Default"); + else + return QString::number(val); + }, + [](auto args) { return fuzzyToFloat(args.value, 50.f); }); layout.addCheckbox("Show link info when hovering", s.linkInfoTooltip); layout.addCheckbox("Double click links to open", s.linksDoubleClickOnly); layout.addCheckbox("Unshorten links", s.unshortLinks);