Skip to content

Commit

Permalink
feat(paints): add setting to disable paint shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Nov 9, 2024
1 parent 69a468d commit 689235b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/seventv/paints/Paint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Application.hpp"
#include "common/Literals.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"

#include <private/qpixmapfilter_p.h>
Expand Down Expand Up @@ -47,7 +48,8 @@ QPixmap Paint::getPixmap(const QString &text, const QFont &font,
QTextOption(Qt::AlignLeft | Qt::AlignTop));
pixmapPainter.end();

if (!this->getDropShadows().empty())
if (!this->getDropShadows().empty() &&
getSettings()->displaySevenTVPaintShadows)
{
QPixmap outMap(size * dpr);
outMap.setDevicePixelRatio(dpr);
Expand Down
2 changes: 2 additions & 0 deletions src/singletons/Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ class Settings
BoolSetting enableSmoothScrollingNewMessages = {
"/appearance/smoothScrollingNewMessages", false};
BoolSetting displaySevenTVPaints = {"/misc/displaySevenTVPaints", true};
BoolSetting displaySevenTVPaintShadows = {
"/misc/displaySevenTVPaintShadows", true};
BoolSetting boldUsernames = {"/appearance/messages/boldUsernames", true};
BoolSetting colorUsernames = {"/appearance/messages/colorUsernames", true};
BoolSetting findAllUsernames = {"/appearance/messages/findAllUsernames",
Expand Down
2 changes: 2 additions & 0 deletions src/widgets/settingspages/GeneralPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,8 @@ void GeneralPage::initLayout(GeneralPageView &layout)
"Automatically close reply thread popup when it loses focus",
s.autoCloseThreadPopup);
layout.addCheckbox("Display 7TV Paints", s.displaySevenTVPaints);
layout.addCheckbox("Display 7TV Paint Shadows",
s.displaySevenTVPaintShadows);
layout.addCheckbox("Lowercase domains (anti-phishing)", s.lowercaseDomains,
false,
"Make all clickable links lowercase to deter "
Expand Down

0 comments on commit 689235b

Please sign in to comment.