From 70bb63d20fc65266c8e5de894f5fff6acd1b5d3d Mon Sep 17 00:00:00 2001 From: apa420 Date: Tue, 11 Jun 2019 22:54:20 +0200 Subject: [PATCH] Added option for shift, used clang and made setting uneditable --- src/widgets/helper/ChannelView.cpp | 24 ++++++++++++++++++----- src/widgets/settingspages/GeneralPage.cpp | 7 +++---- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 9af6a8ca5..36f8dd8ec 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -15,8 +15,8 @@ #include "providers/twitch/TwitchServer.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" -#include "singletons/WindowManager.hpp" #include "singletons/TooltipPreviewImage.hpp" +#include "singletons/WindowManager.hpp" #include "util/DistanceBetweenPoints.hpp" #include "util/IncognitoBrowser.hpp" #include "widgets/Scrollbar.hpp" @@ -1220,10 +1220,24 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) else { auto &tooltipPreviewImage = TooltipPreviewImage::getInstance(); - auto emoteElement = dynamic_cast(&hoverLayoutElement->getCreator()); - if (emoteElement && getSettings()->emotesTooltipPreview.getValue()) { - tooltipPreviewImage.setImage(emoteElement->getEmote()->images.getImage(3.0)); - } else { + auto emoteElement = dynamic_cast( + &hoverLayoutElement->getCreator()); + + if (emoteElement && getSettings()->emotesTooltipPreview.getValue()) + { + if (event->modifiers() == Qt::ShiftModifier || + getSettings()->emotesTooltipPreview.getValue() == 1) + { + tooltipPreviewImage.setImage( + emoteElement->getEmote()->images.getImage(3.0)); + } + else + { + tooltipPreviewImage.setImage(nullptr); + } + } + else + { tooltipPreviewImage.setImage(nullptr); } diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index 914f9eb70..32414a7f9 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -272,10 +272,9 @@ void GeneralPage::initLayout(SettingsLayout &layout) layout.addCheckbox("Show live indicator in tabs", s.showTabLive); layout.addDropdown( "Show emote preview in tooltip on hover", - {"Don't show", "Always show"}, - s.emotesTooltipPreview, - [](int index) { return index; }, - [](auto args) { return args.index; }); + {"Don't show", "Always show", "Hold shift"}, s.emotesTooltipPreview, + [](int index) { return index; }, [](auto args) { return args.index; }, + false); layout.addSpacing(16); layout.addSeperator();