1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-24 13:27:45 +00:00
astra/src/bannerwidget.cpp
Joshua Goins ee21693f2c Improve news banner
Now it properly "slideshows" just like the real client, instead of being
a static image like it was before. The banners are now clickable, but
there's still a bug causing the controls to be reloaded twice on startup
- delaying the first animation.
2022-04-17 21:17:58 -04:00

17 lines
356 B
C++

#include "bannerwidget.h"
#include <QDebug>
#include <QDesktopServices>
BannerWidget::BannerWidget() : QLabel() {
setCursor(Qt::CursorShape::PointingHandCursor);
}
void BannerWidget::mousePressEvent(QMouseEvent* event) {
qDebug() << "Clicked!";
QDesktopServices::openUrl(url);
}
void BannerWidget::setUrl(QUrl url) {
this->url = url;
}