Merge pull request #1 from apa420/976-apa

Added option for shift, used clang and made setting uneditable
This commit is contained in:
Alexey Kutepov 2019-06-12 04:40:34 +07:00 committed by GitHub
commit 5b0368cc35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 9 deletions

View file

@ -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<const EmoteElement*>(&hoverLayoutElement->getCreator());
if (emoteElement && getSettings()->emotesTooltipPreview.getValue()) {
tooltipPreviewImage.setImage(emoteElement->getEmote()->images.getImage(3.0));
} else {
auto emoteElement = dynamic_cast<const EmoteElement *>(
&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);
}

View file

@ -272,10 +272,9 @@ void GeneralPage::initLayout(SettingsLayout &layout)
layout.addCheckbox("Show live indicator in tabs", s.showTabLive);
layout.addDropdown<int>(
"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();