From 6b24f249f71046c5bc4057fd8d2da7af21e13683 Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 26 May 2018 16:31:43 +0200 Subject: [PATCH] fixed split header tooltips not showing --- src/messages/layouts/messagelayout.cpp | 3 +- src/providers/twitch/twitchchannel.cpp | 5 +++ src/providers/twitch/twitchchannel.hpp | 1 + src/widgets/basewidget.hpp | 2 +- src/widgets/basewindow.cpp | 4 +-- src/widgets/helper/channelview.cpp | 4 +-- src/widgets/helper/splitheader.cpp | 50 ++++++++++++++++---------- src/widgets/helper/splitheader.hpp | 5 +-- 8 files changed, 46 insertions(+), 28 deletions(-) diff --git a/src/messages/layouts/messagelayout.cpp b/src/messages/layouts/messagelayout.cpp index 323f510e1..7be83b95e 100644 --- a/src/messages/layouts/messagelayout.cpp +++ b/src/messages/layouts/messagelayout.cpp @@ -48,7 +48,7 @@ int MessageLayout::getHeight() const // return true if redraw is required bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags) { - BenchmarkGuard benchmark("MessageLayout::layout()"); + // BenchmarkGuard benchmark("MessageLayout::layout()"); auto app = getApp(); @@ -107,7 +107,6 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags) } // return if no layout is required - qDebug() << layoutRequired; if (!layoutRequired) { return false; diff --git a/src/providers/twitch/twitchchannel.cpp b/src/providers/twitch/twitchchannel.cpp index ab663ad36..0243bae4a 100644 --- a/src/providers/twitch/twitchchannel.cpp +++ b/src/providers/twitch/twitchchannel.cpp @@ -325,6 +325,11 @@ void TwitchChannel::refreshLiveStatus() QString::number(diff / 3600) + "h " + QString::number(diff % 3600 / 60) + "m"; channel->streamStatus.rerun = false; + if (stream.HasMember("stream_type")) { + channel->streamStatus.streamType = stream["stream_type"].GetString(); + } else { + channel->streamStatus.streamType = QString(); + } if (stream.HasMember("broadcast_platform")) { const auto &broadcastPlatformValue = stream["broadcast_platform"]; diff --git a/src/providers/twitch/twitchchannel.hpp b/src/providers/twitch/twitchchannel.hpp index 8a8e5727a..52a3e1729 100644 --- a/src/providers/twitch/twitchchannel.hpp +++ b/src/providers/twitch/twitchchannel.hpp @@ -32,6 +32,7 @@ public: QString title; QString game; QString uptime; + QString streamType; }; struct UserState { diff --git a/src/widgets/basewidget.hpp b/src/widgets/basewidget.hpp index 6e6702a01..f69676002 100644 --- a/src/widgets/basewidget.hpp +++ b/src/widgets/basewidget.hpp @@ -18,7 +18,7 @@ class BaseWidget : public QWidget public: explicit BaseWidget(QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags()); - virtual ~BaseWidget(); + virtual ~BaseWidget() override; float getScale() const; pajlada::Signals::Signal scaleChanged; diff --git a/src/widgets/basewindow.cpp b/src/widgets/basewindow.cpp index 139a42e92..2e8abe3be 100644 --- a/src/widgets/basewindow.cpp +++ b/src/widgets/basewindow.cpp @@ -253,8 +253,8 @@ void BaseWindow::leaveEvent(QEvent *) void BaseWindow::moveTo(QWidget *parent, QPoint point) { - point.rx() += 16; - point.ry() += 16; + // point.rx() += 16; + // point.ry() += 16; this->move(point); this->moveIntoDesktopRect(parent); diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index 38c1e9631..3172fc1ce 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -175,7 +175,7 @@ void ChannelView::layoutMessages() void ChannelView::actuallyLayoutMessages(bool causedByScrollbar) { - BenchmarkGuard benchmark("layout messages"); + // BenchmarkGuard benchmark("layout messages"); auto app = getApp(); @@ -579,7 +579,7 @@ bool ChannelView::isPaused() void ChannelView::paintEvent(QPaintEvent * /*event*/) { - BenchmarkGuard benchmark("paint event"); + // BenchmarkGuard benchmark("paint event"); QPainter painter(this); diff --git a/src/widgets/helper/splitheader.cpp b/src/widgets/helper/splitheader.cpp index 904d2af23..f7fb6af19 100644 --- a/src/widgets/helper/splitheader.cpp +++ b/src/widgets/helper/splitheader.cpp @@ -31,7 +31,6 @@ SplitHeader::SplitHeader(Split *_split) , split(_split) { auto app = getApp(); - this->setMouseTracking(true); util::LayoutCreator layoutCreator(this); auto layout = layoutCreator.emplace().withoutMargin(); @@ -53,13 +52,13 @@ SplitHeader::SplitHeader(Split *_split) // channel name label // auto title = layout.emplace