Switch some c-style includes to c++-style includes (i.e. stdint.h to
cstdint) Make MessageElement to a class to fit better with the derived classes. Make MessageLayoutElement to a class to fit better with the derived classes. Remove virtual from override functions Replace all instances of boost::signals2 with pajlada::Signals. This lets us properly use clang code model to check for issues. Add missing virtual destructor to AbstractIrcServer Add missing virtual destructor to MessageLayoutElement Remove unused "connectedConnection" connection in TwitchChannel Fix typo in TrimChannelName function Fix typo in MessageParseArgs Replace some raw pointers with unique pointers where it made more sense. This allowed us to remove some manually written destructors whose only purpose was to delete that raw pointer. Reformat: Add namespace comments Reformat: Add empty empty lines between main namespace beginning and end Reformat: Re-order includes Reformat: Fix some includes that used quotes where they should use angle brackets Reformat: Replace some typedef's with using's Filter out more useless warnings
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace Ui {
|
||||
class AccountPopup;
|
||||
}
|
||||
} // namespace Ui
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
@@ -35,7 +35,7 @@ signals:
|
||||
void refreshButtons();
|
||||
|
||||
protected:
|
||||
virtual void scaleChangedEvent(float newDpi) override;
|
||||
void scaleChangedEvent(float newDpi) override;
|
||||
|
||||
private:
|
||||
Ui::AccountPopup *ui;
|
||||
@@ -76,8 +76,8 @@ private:
|
||||
} relationship;
|
||||
|
||||
protected:
|
||||
virtual void focusOutEvent(QFocusEvent *event) override;
|
||||
virtual void showEvent(QShowEvent *event) override;
|
||||
void focusOutEvent(QFocusEvent *event) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
|
||||
@@ -54,5 +54,6 @@ void AccountSwitchPopupWidget::paintEvent(QPaintEvent *event)
|
||||
|
||||
painter.fillRect(this->rect(), QColor(255, 255, 255));
|
||||
}
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -17,8 +17,8 @@ public:
|
||||
void refresh();
|
||||
|
||||
protected:
|
||||
virtual void focusOutEvent(QFocusEvent *event) override final;
|
||||
virtual void paintEvent(QPaintEvent *event) override;
|
||||
void focusOutEvent(QFocusEvent *event) final;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private:
|
||||
struct {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "widgets/basewidget.hpp"
|
||||
#include "debug/log.hpp"
|
||||
#include "singletons/settingsmanager.hpp"
|
||||
#include "singletons/thememanager.hpp"
|
||||
|
||||
@@ -7,7 +8,6 @@
|
||||
#include <QIcon>
|
||||
#include <QLayout>
|
||||
#include <QtGlobal>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
@@ -82,13 +82,13 @@ void BaseWidget::setScaleIndependantHeight(int value)
|
||||
|
||||
void BaseWidget::init()
|
||||
{
|
||||
auto connection = this->themeManager.updated.connect([this]() {
|
||||
pajlada::Signals::Connection connection = this->themeManager.updated.connect([this]() {
|
||||
this->themeRefreshEvent();
|
||||
|
||||
this->update();
|
||||
});
|
||||
|
||||
QObject::connect(this, &QObject::destroyed, [connection] {
|
||||
QObject::connect(this, &QObject::destroyed, [connection]() mutable {
|
||||
connection.disconnect(); //
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
class ThemeManager;
|
||||
}
|
||||
} // namespace singletons
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class BaseWindow;
|
||||
|
||||
class BaseWidget : public QWidget
|
||||
@@ -34,7 +35,7 @@ public:
|
||||
void setScaleIndependantHeight(int value);
|
||||
|
||||
protected:
|
||||
virtual void childEvent(QChildEvent *) override;
|
||||
void childEvent(QChildEvent *) override;
|
||||
|
||||
virtual void scaleChangedEvent(float newScale);
|
||||
virtual void themeRefreshEvent();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "basewindow.hpp"
|
||||
|
||||
#include "debug/log.hpp"
|
||||
#include "singletons/settingsmanager.hpp"
|
||||
#include "util/nativeeventhelper.hpp"
|
||||
#include "widgets/helper/rippleeffectlabel.hpp"
|
||||
@@ -11,10 +12,10 @@
|
||||
#include <QIcon>
|
||||
|
||||
#ifdef USEWINSDK
|
||||
#include <ObjIdl.h>
|
||||
#include <Windows.h>
|
||||
#include <dwmapi.h>
|
||||
#include <gdiplus.h>
|
||||
#include <objidl.h>
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#pragma comment(lib, "Dwmapi.lib")
|
||||
|
||||
|
||||
@@ -9,12 +9,15 @@ class QHBoxLayout;
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
class RippleEffectButton;
|
||||
class RippleEffectLabel;
|
||||
class TitleBarButton;
|
||||
|
||||
class BaseWindow : public BaseWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BaseWindow(singletons::ThemeManager &_themeManager, QWidget *parent,
|
||||
bool enableCustomFrame = false);
|
||||
@@ -60,5 +63,6 @@ private:
|
||||
QWidget *layoutBase;
|
||||
std::vector<RippleEffectButton *> buttons;
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#include <QGraphicsBlurEffect>
|
||||
#include <QPainter>
|
||||
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
@@ -461,7 +461,7 @@ void ChannelView::setSelection(const SelectionItem &start, const SelectionItem &
|
||||
// selections
|
||||
this->selection = Selection(start, end);
|
||||
|
||||
this->selectionChanged();
|
||||
this->selectionChanged.invoke();
|
||||
}
|
||||
|
||||
messages::MessageElement::Flags ChannelView::getFlags() const
|
||||
@@ -729,7 +729,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
|
||||
QPoint relativePos;
|
||||
int messageIndex;
|
||||
|
||||
this->mouseDown(event);
|
||||
this->mouseDown.invoke(event);
|
||||
|
||||
if (!tryGetMessageAt(event->pos(), layout, relativePos, messageIndex)) {
|
||||
setCursor(Qt::ArrowCursor);
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include <QTimer>
|
||||
#include <QWheelEvent>
|
||||
#include <QWidget>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
namespace chatterino {
|
||||
@@ -28,7 +28,7 @@ class ChannelView : public BaseWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ChannelView(BaseWidget *parent = 0);
|
||||
explicit ChannelView(BaseWidget *parent = nullptr);
|
||||
virtual ~ChannelView();
|
||||
|
||||
void queueUpdate();
|
||||
@@ -49,26 +49,26 @@ public:
|
||||
|
||||
void clearMessages();
|
||||
|
||||
boost::signals2::signal<void(QMouseEvent *)> mouseDown;
|
||||
boost::signals2::signal<void()> selectionChanged;
|
||||
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
||||
pajlada::Signals::NoArgSignal selectionChanged;
|
||||
pajlada::Signals::NoArgSignal highlightedMessageReceived;
|
||||
pajlada::Signals::Signal<const messages::Link &> linkClicked;
|
||||
|
||||
protected:
|
||||
virtual void themeRefreshEvent() override;
|
||||
void themeRefreshEvent() override;
|
||||
|
||||
virtual void resizeEvent(QResizeEvent *) override;
|
||||
void resizeEvent(QResizeEvent *) override;
|
||||
|
||||
virtual void paintEvent(QPaintEvent *) override;
|
||||
virtual void wheelEvent(QWheelEvent *event) override;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
|
||||
virtual void enterEvent(QEvent *) override;
|
||||
virtual void leaveEvent(QEvent *) override;
|
||||
void enterEvent(QEvent *) override;
|
||||
void leaveEvent(QEvent *) override;
|
||||
|
||||
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||
|
||||
void handleLinkClick(QMouseEvent *event, const messages::Link &link,
|
||||
messages::MessageLayout *layout);
|
||||
@@ -116,12 +116,12 @@ private:
|
||||
|
||||
messages::LimitedQueue<messages::MessageLayoutPtr> messages;
|
||||
|
||||
boost::signals2::connection messageAppendedConnection;
|
||||
boost::signals2::connection messageAddedAtStartConnection;
|
||||
boost::signals2::connection messageRemovedConnection;
|
||||
boost::signals2::connection messageReplacedConnection;
|
||||
boost::signals2::connection repaintGifsConnection;
|
||||
boost::signals2::connection layoutConnection;
|
||||
pajlada::Signals::Connection messageAppendedConnection;
|
||||
pajlada::Signals::Connection messageAddedAtStartConnection;
|
||||
pajlada::Signals::Connection messageRemovedConnection;
|
||||
pajlada::Signals::Connection messageReplacedConnection;
|
||||
pajlada::Signals::Connection repaintGifsConnection;
|
||||
pajlada::Signals::Connection layoutConnection;
|
||||
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ public:
|
||||
void setBounds(const QRect &rect);
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *) override;
|
||||
virtual void hideEvent(QHideEvent *) override;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
void hideEvent(QHideEvent *) override;
|
||||
|
||||
QPropertyAnimation positionAnimation;
|
||||
QRect desiredGeometry;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
Label::Label(BaseWidget *parent)
|
||||
: BaseWidget(parent)
|
||||
{
|
||||
@@ -74,5 +75,6 @@ void Label::paintEvent(QPaintEvent *)
|
||||
|
||||
painter.drawText(this->rect(), flags, this->text);
|
||||
}
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -29,5 +29,6 @@ private:
|
||||
QString text;
|
||||
FontStyle fontStyle = FontStyle::Medium;
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -144,5 +144,6 @@ void NotebookButton::dropEvent(QDropEvent *event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <QDebug>
|
||||
#include <QLinearGradient>
|
||||
#include <QPainter>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <pajlada/signals/connection.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class Notebook;
|
||||
|
||||
@@ -73,7 +73,7 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
this->keyPressed(event);
|
||||
this->keyPressed.invoke(event);
|
||||
|
||||
if (event->key() == Qt::Key_Backtab) {
|
||||
// Ignore for now. We want to use it for autocomplete later
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <QCompleter>
|
||||
#include <QKeyEvent>
|
||||
#include <QTextEdit>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
class ResizingTextEdit : public QTextEdit
|
||||
{
|
||||
@@ -14,14 +14,14 @@ public:
|
||||
|
||||
bool hasHeightForWidth() const override;
|
||||
|
||||
boost::signals2::signal<void(QKeyEvent *)> keyPressed;
|
||||
pajlada::Signals::Signal<QKeyEvent *> keyPressed;
|
||||
|
||||
void setCompleter(QCompleter *c);
|
||||
QCompleter *getCompleter() const;
|
||||
|
||||
protected:
|
||||
virtual int heightForWidth(int) const override;
|
||||
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||
int heightForWidth(int) const override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
QCompleter *completer = nullptr;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "QString"
|
||||
#include <QString>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
class ScrollbarHighlight
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "messages/limitedqueuesnapshot.hpp"
|
||||
#include "messages/message.hpp"
|
||||
#include "widgets/basewindow.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Channel;
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class ChannelView;
|
||||
|
||||
class SearchPopup : public BaseWindow
|
||||
@@ -27,5 +31,6 @@ private:
|
||||
void initLayout();
|
||||
void performSearch();
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "widgets/basewidget.hpp"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QPaintEvent>
|
||||
#include <QWidget>
|
||||
|
||||
#include "widgets/basewidget.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
class SettingsPage;
|
||||
}
|
||||
} // namespace settingspages
|
||||
|
||||
class SettingsDialog;
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace helper {
|
||||
SplitColumn::SplitColumn()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace helper
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "widgets/split.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace chatterino {
|
||||
namespace helper {
|
||||
|
||||
class SplitColumn
|
||||
{
|
||||
public:
|
||||
SplitColumn();
|
||||
SplitColumn() = default;
|
||||
|
||||
void insert(widgets::Split *split, int index = -1);
|
||||
void remove(int index);
|
||||
@@ -19,5 +20,6 @@ public:
|
||||
private:
|
||||
std::vector<widgets::Split> items;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace helper
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -57,7 +57,8 @@ SplitHeader::SplitHeader(Split *_split)
|
||||
title->setMouseTracking(true);
|
||||
QObject::connect(this->titleLabel, &SignalLabel::mouseDoubleClick, this,
|
||||
&SplitHeader::mouseDoubleClickEvent);
|
||||
QObject::connect(this->titleLabel, &SignalLabel::mouseMove, this, &SplitHeader::mouseMoveEvent);
|
||||
QObject::connect(this->titleLabel, &SignalLabel::mouseMove, this,
|
||||
&SplitHeader::mouseMoveEvent);
|
||||
|
||||
layout->addStretch(1);
|
||||
|
||||
|
||||
@@ -13,11 +13,9 @@
|
||||
#include <QPaintEvent>
|
||||
#include <QPoint>
|
||||
#include <QWidget>
|
||||
#include <boost/signals2/connection.hpp>
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class Split;
|
||||
@@ -50,7 +48,7 @@ private:
|
||||
QPoint dragStart;
|
||||
bool dragging = false;
|
||||
|
||||
boost::signals2::connection onlineStatusChangedConnection;
|
||||
pajlada::Signals::Connection onlineStatusChangedConnection;
|
||||
|
||||
RippleEffectButton *dropdownButton;
|
||||
// Label *titleLabel;
|
||||
|
||||
@@ -162,7 +162,7 @@ void Scrollbar::offset(qreal value)
|
||||
}
|
||||
}
|
||||
|
||||
boost::signals2::signal<void()> &Scrollbar::getCurrentValueChanged()
|
||||
pajlada::Signals::NoArgSignal &Scrollbar::getCurrentValueChanged()
|
||||
{
|
||||
return this->currentValueChanged;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void Scrollbar::setCurrentValue(qreal value)
|
||||
this->currentValue = value;
|
||||
|
||||
this->updateScroll();
|
||||
this->currentValueChanged();
|
||||
this->currentValueChanged.invoke();
|
||||
|
||||
this->update();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <QMutex>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QWidget>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
qreal getCurrentValue() const;
|
||||
// offset the desired value without breaking smooth scolling
|
||||
void offset(qreal value);
|
||||
boost::signals2::signal<void()> &getCurrentValueChanged();
|
||||
pajlada::Signals::NoArgSignal &getCurrentValueChanged();
|
||||
void setCurrentValue(qreal value);
|
||||
|
||||
void printCurrentState(const QString &prefix = QString()) const;
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
qreal currentValue = 0;
|
||||
qreal smoothScrollingOffset = 0;
|
||||
|
||||
boost::signals2::signal<void()> currentValueChanged;
|
||||
pajlada::Signals::NoArgSignal currentValueChanged;
|
||||
|
||||
pajlada::Settings::Setting<bool> &smoothScrollingSetting;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace widgets {
|
||||
|
||||
namespace settingspages {
|
||||
class SettingsPage;
|
||||
}
|
||||
} // namespace settingspages
|
||||
|
||||
class SettingsDialogTab;
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
static void showDialog(PreferredTab preferredTab = PreferredTab::NoPreference);
|
||||
|
||||
protected:
|
||||
virtual void scaleChangedEvent(float newDpi) override;
|
||||
void scaleChangedEvent(float newDpi) override;
|
||||
|
||||
private:
|
||||
void refresh();
|
||||
|
||||
@@ -53,6 +53,7 @@ AboutPage::AboutPage()
|
||||
}
|
||||
layout->addStretch(1);
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
private:
|
||||
QLabel *logo;
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
AccountsPage::AccountsPage()
|
||||
: SettingsPage("Accounts", ":/images/accounts.svg")
|
||||
{
|
||||
@@ -41,6 +42,7 @@ AccountsPage::AccountsPage()
|
||||
singletons::AccountManager::getInstance().Twitch.removeUser(selectedUser);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "widgets/accountswitchwidget.hpp"
|
||||
#include "widgets/settingspages/settingspage.hpp"
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
@@ -19,6 +19,7 @@ private:
|
||||
QPushButton *removeButton;
|
||||
AccountSwitchWidget *accSwitchWidget;
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QSlider>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "util/layoutcreator.hpp"
|
||||
@@ -65,7 +66,8 @@ AppearancePage::AppearancePage()
|
||||
}
|
||||
messages.append(this->createCheckBox("Show badges", settings.showBadges));
|
||||
messages.append(this->createCheckBox("Seperate messages", settings.seperateMessages));
|
||||
messages.append(this->createCheckBox("Show message length while typing", settings.showMessageLength));
|
||||
messages.append(
|
||||
this->createCheckBox("Show message length while typing", settings.showMessageLength));
|
||||
}
|
||||
|
||||
layout->addStretch(1);
|
||||
@@ -148,6 +150,7 @@ QLayout *AppearancePage::createFontChanger()
|
||||
|
||||
return layout;
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "widgets/settingspages/settingspage.hpp"
|
||||
|
||||
#include <QSlider>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
BehaviourPage::BehaviourPage()
|
||||
: SettingsPage("Behaviour", ":/images/behave.svg")
|
||||
{
|
||||
@@ -80,6 +81,7 @@ QSlider *BehaviourPage::createMouseScrollSlider()
|
||||
|
||||
return slider;
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -11,6 +11,7 @@ class EmotesPage : public SettingsPage
|
||||
public:
|
||||
EmotesPage();
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
HighlightingPage::HighlightingPage()
|
||||
: SettingsPage("Highlights", ":/images/notifications.svg")
|
||||
{
|
||||
@@ -239,6 +240,7 @@ void HighlightingPage::addHighlightTabSignals()
|
||||
delete selectedHighlight;
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
#include "widgets/settingspages/settingspage.hpp"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
class QPushButton;
|
||||
class QListWidget;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
IgnoreMessagesPage::IgnoreMessagesPage()
|
||||
: SettingsPage("Ignore Messages", "")
|
||||
{
|
||||
@@ -32,6 +33,7 @@ IgnoreMessagesPage::IgnoreMessagesPage()
|
||||
// ---- misc
|
||||
this->keywordsUpdated.setSingleShot(true);
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <QTimer>
|
||||
#include "widgets/settingspages/settingspage.hpp"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
@@ -14,6 +15,7 @@ public:
|
||||
|
||||
QTimer keywordsUpdated;
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
IgnoreUsersPage::IgnoreUsersPage()
|
||||
: SettingsPage("Ignore Users", "")
|
||||
{
|
||||
@@ -50,6 +51,7 @@ IgnoreUsersPage::IgnoreUsersPage()
|
||||
auto userList = group.emplace<QListView>();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
class IgnoreUsersPage : public SettingsPage
|
||||
{
|
||||
public:
|
||||
IgnoreUsersPage();
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
KeyboardSettingsPage::KeyboardSettingsPage()
|
||||
: SettingsPage("Keybindings", "")
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
class KeyboardSettingsPage : public SettingsPage
|
||||
{
|
||||
public:
|
||||
KeyboardSettingsPage();
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -11,6 +11,7 @@ class LogsPage : public SettingsPage
|
||||
public:
|
||||
LogsPage();
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
SpecialChannelsPage::SpecialChannelsPage()
|
||||
: SettingsPage("Special channels", "")
|
||||
{
|
||||
@@ -30,6 +31,7 @@ SpecialChannelsPage::SpecialChannelsPage()
|
||||
|
||||
layout->addStretch(1);
|
||||
}
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
|
||||
class SpecialChannelsPage : public SettingsPage
|
||||
{
|
||||
public:
|
||||
SpecialChannelsPage();
|
||||
};
|
||||
|
||||
} // namespace settingspages
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <QMimeData>
|
||||
#include <QPainter>
|
||||
#include <QVBoxLayout>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <random>
|
||||
@@ -150,7 +149,7 @@ void Split::setChannel(ChannelPtr _newChannel)
|
||||
|
||||
this->header.updateModerationModeIcon();
|
||||
|
||||
this->channelChanged();
|
||||
this->channelChanged.invoke();
|
||||
}
|
||||
|
||||
void Split::setFlexSizeX(double x)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <QShortcut>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
#include <boost/signals2/connection.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
@@ -47,7 +46,7 @@ public:
|
||||
~Split() override;
|
||||
|
||||
pajlada::Settings::Setting<QString> channelName;
|
||||
boost::signals2::signal<void()> channelChanged;
|
||||
pajlada::Signals::NoArgSignal channelChanged;
|
||||
|
||||
ChannelView &getChannelView()
|
||||
{
|
||||
@@ -93,8 +92,8 @@ private:
|
||||
|
||||
bool moderationMode;
|
||||
|
||||
boost::signals2::connection channelIDChangedConnection;
|
||||
boost::signals2::connection usermodeChangedConnection;
|
||||
pajlada::Signals::Connection channelIDChangedConnection;
|
||||
pajlada::Signals::Connection usermodeChangedConnection;
|
||||
|
||||
void setChannel(ChannelPtr newChannel);
|
||||
void doOpenAccountPopupWidget(AccountPopupWidget *widget, QString user);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
StreamView::StreamView(ChannelPtr channel, QUrl url)
|
||||
{
|
||||
util::LayoutCreator<StreamView> layoutCreator(this);
|
||||
@@ -30,5 +31,6 @@ StreamView::StreamView(ChannelPtr channel, QUrl url)
|
||||
this->layout()->setSpacing(0);
|
||||
this->layout()->setMargin(0);
|
||||
}
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -2,14 +2,17 @@
|
||||
|
||||
#include <QUrl>
|
||||
#include <QWidget>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QWebEngineView;
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Channel;
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class StreamView : public QWidget
|
||||
{
|
||||
public:
|
||||
@@ -18,5 +21,6 @@ public:
|
||||
private:
|
||||
QWebEngineView *stream;
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -7,8 +7,6 @@ namespace widgets {
|
||||
TextInputDialog::TextInputDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, _vbox(this)
|
||||
, _lineEdit()
|
||||
, _buttonBox()
|
||||
, _okButton("OK")
|
||||
, _cancelButton("Cancel")
|
||||
{
|
||||
|
||||
@@ -65,5 +65,6 @@ void TooltipWidget::leaveEvent(QEvent *)
|
||||
{
|
||||
// clear parents event
|
||||
}
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "widgets/basewindow.hpp"
|
||||
|
||||
#include <QLabel>
|
||||
@@ -11,6 +12,7 @@ namespace widgets {
|
||||
class TooltipWidget : public BaseWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TooltipWidget(BaseWidget *parent = nullptr);
|
||||
~TooltipWidget();
|
||||
@@ -27,9 +29,9 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *) override;
|
||||
virtual void leaveEvent(QEvent *) override;
|
||||
virtual void scaleChangedEvent(float) override;
|
||||
void changeEvent(QEvent *) override;
|
||||
void leaveEvent(QEvent *) override;
|
||||
void scaleChangedEvent(float) override;
|
||||
|
||||
private:
|
||||
QLabel *displayText;
|
||||
|
||||
@@ -110,13 +110,9 @@ void Window::repaintVisibleChatWidgets(Channel *channel)
|
||||
return;
|
||||
}
|
||||
|
||||
const std::vector<Split *> &widgets = page->getSplits();
|
||||
|
||||
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
|
||||
Split *widget = *it;
|
||||
|
||||
if (channel == nullptr || channel == widget->getChannel().get()) {
|
||||
widget->layoutMessages();
|
||||
for (const auto &split : page->getSplits()) {
|
||||
if (channel == nullptr || channel == split->getChannel().get()) {
|
||||
split->layoutMessages();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,7 +136,7 @@ void Window::closeEvent(QCloseEvent *)
|
||||
this->windowGeometry.width = geom.width();
|
||||
this->windowGeometry.height = geom.height();
|
||||
|
||||
this->closed();
|
||||
this->closed.invoke();
|
||||
}
|
||||
|
||||
bool Window::event(QEvent *e)
|
||||
|
||||
@@ -8,14 +8,13 @@
|
||||
//#include <platform/borderless/qwinwidget.h>
|
||||
//#endif
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
class ThemeManager;
|
||||
}
|
||||
} // namespace singletons
|
||||
|
||||
namespace widgets {
|
||||
|
||||
@@ -52,11 +51,11 @@ public:
|
||||
|
||||
void refreshWindowTitle(const QString &username);
|
||||
|
||||
boost::signals2::signal<void()> closed;
|
||||
pajlada::Signals::NoArgSignal closed;
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent *event) override;
|
||||
virtual bool event(QEvent *event) override;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
float dpi;
|
||||
|
||||
Reference in New Issue
Block a user