oh no the bad commit descriptions are back D:

This commit is contained in:
fourtf 2017-12-23 23:24:35 +01:00
parent a617873f6a
commit 2bf53f73f8
11 changed files with 35 additions and 41 deletions

View file

@ -56,7 +56,6 @@ void ColorScheme::update()
void ColorScheme::setColors(double hue, double multiplier)
{
lightTheme = multiplier > 0;
bool hasDarkBorder = false;
SystemMessageColor = QColor(140, 127, 127);

View file

@ -23,11 +23,11 @@ Word::Word(const QString &text, Flags type, const MessageColor &color, FontManag
: image(nullptr)
, text(text)
, color(color)
, font(font)
, _isImage(false)
, type(type)
, copyText(copytext)
, tooltip(tooltip)
, font(font)
, link(link)
{
}

View file

@ -10,14 +10,14 @@ using namespace chatterino::messages;
namespace chatterino {
SettingsManager::SettingsManager()
: settings(Path::getAppdataPath() + "settings.ini", QSettings::IniFormat)
, streamlinkPath("/behaviour/streamlink/path", "")
: streamlinkPath("/behaviour/streamlink/path", "")
, preferredQuality("/behaviour/streamlink/quality", "Choose")
, emoteScale(this->settingsItems, "emoteScale", 1.0)
, pathHighlightSound(this->settingsItems, "pathHighlightSound", "qrc:/sounds/ping2.wav")
, highlightProperties(this->settingsItems, "highlightProperties",
QMap<QString, QPair<bool, bool>>())
, highlightUserBlacklist(this->settingsItems, "highlightUserBlacklist", "")
, settings(Path::getAppdataPath() + "settings.ini", QSettings::IniFormat)
{
this->wordMaskListener.addSetting(this->showTimestamps);
this->wordMaskListener.addSetting(this->showTimestampSeconds);

View file

@ -22,6 +22,9 @@ public:
bool canSendMessage() const override;
void sendMessage(const QString &message) override;
const std::shared_ptr<EmoteMap> bttvChannelEmotes;
const std::shared_ptr<EmoteMap> ffzChannelEmotes;
const QString subscriptionURL;
const QString channelURL;
const QString popoutPlayerURL;
@ -37,9 +40,6 @@ public:
QString streamGame;
QString streamUptime;
const std::shared_ptr<EmoteMap> bttvChannelEmotes;
const std::shared_ptr<EmoteMap> ffzChannelEmotes;
private:
void setLive(bool newLiveStatus);
void refreshLiveStatus();

View file

@ -25,7 +25,7 @@ static bool tryHandleDpiChangedMessage(void *message, int &dpi)
static boost::optional<UINT> getWindowDpi(quintptr ptr)
{
typedef UINT(WINAPI * GetDpiForWindow)(HWND);
QLibrary user32("user32.dll", NULL);
QLibrary user32("user32.dll", 0);
GetDpiForWindow getDpiForWindow = (GetDpiForWindow)user32.resolve("GetDpiForWindow");
@ -44,20 +44,20 @@ class DpiNativeEventFilter : public QAbstractNativeEventFilter
public:
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override
{
MSG *msg = reinterpret_cast<MSG *>(message);
// MSG *msg = reinterpret_cast<MSG *>(message);
if (msg->message == WM_NCCREATE) {
QLibrary user32("user32.dll", NULL);
{
typedef BOOL(WINAPI * EnableNonClientDpiScaling)(HWND);
// if (msg->message == WM_NCCREATE) {
// QLibrary user32("user32.dll", 0);
// {
// typedef BOOL(WINAPI * EnableNonClientDpiScaling)(HWND);
EnableNonClientDpiScaling enableNonClientDpiScaling =
(EnableNonClientDpiScaling)user32.resolve("EnableNonClientDpiScaling");
// EnableNonClientDpiScaling enableNonClientDpiScaling =
// (EnableNonClientDpiScaling)user32.resolve("EnableNonClientDpiScaling");
// if (enableNonClientDpiScaling)
// enableNonClientDpiScaling(msg->hwnd);
}
}
// }
// }
return false;
}
};

View file

@ -79,15 +79,11 @@ ChannelView::ChannelView(BaseWidget *parent)
this->updateTimer.start();
});
auto _split = this->parent();
auto _splitContainer = _split->parent();
auto _notebook = _splitContainer->parent();
auto _window = qobject_cast<Window*>(_notebook->parent());
Window *_window = dynamic_cast<Window *>(this->window());
assert(_window);
_window->lostFocus.connect(
[this] { TooltipWidget::getInstance()->hide(); });
if (_window) {
_window->lostFocus.connect([this] { TooltipWidget::getInstance()->hide(); });
}
}
ChannelView::~ChannelView()
@ -283,7 +279,7 @@ QString ChannelView::getSelectedText()
text += "\n";
// middle lines
for (i++; i < this->selection.max.messageIndex; i++) {
for (i++; (int)i < this->selection.max.messageIndex; i++) {
for (const messages::WordPart &part : messagesSnapshot[i]->getWordParts()) {
if (!part.getCopyText().isEmpty()) {
text += part.getCopyText();

View file

@ -45,8 +45,6 @@ inline void ezShortcut(Split *w, const char *key, T t)
} // namespace
static int index = 0;
Split::Split(ChannelManager &_channelManager, SplitContainer *parent, const std::string &_uuid)
: BaseWidget(parent)
, uuid(_uuid)

View file

@ -12,27 +12,29 @@ TooltipWidget::TooltipWidget(BaseWidget *parent)
: BaseWidget(parent)
, displayText(new QLabel())
{
QColor black(0,0,0);
QColor white(255,255,255);
QColor black(0, 0, 0);
QColor white(255, 255, 255);
QPalette palette;
palette.setColor(QPalette::WindowText,white);
palette.setColor(QPalette::Background,black);
palette.setColor(QPalette::WindowText, white);
palette.setColor(QPalette::Background, black);
this->setPalette(palette);
this->setWindowOpacity(0.8);
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall));
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall,
this->getDpiMultiplier()));
this->setAttribute(Qt::WA_ShowWithoutActivating);
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
displayText->setAlignment(Qt::AlignHCenter);
auto layout = new QVBoxLayout();
layout->setContentsMargins(10,5,10,5);
layout->setContentsMargins(10, 5, 10, 5);
layout->addWidget(displayText);
this->setLayout(layout);
FontManager::getInstance().fontChanged.connect([this] {
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall));
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall,
this->getDpiMultiplier()));
});
}

View file

@ -1,8 +1,8 @@
#pragma once
#include "widgets/basewidget.hpp"
#include <QWidget>
#include <QLabel>
#include <QWidget>
namespace chatterino {
namespace widgets {
@ -16,11 +16,10 @@ public:
void setText(QString text);
void moveTo(QPoint point);
static TooltipWidget* getInstance()
static TooltipWidget *getInstance()
{
static TooltipWidget *tooltipWidget = nullptr;
if(tooltipWidget == nullptr)
{
if (tooltipWidget == nullptr) {
tooltipWidget = new TooltipWidget();
}
return tooltipWidget;

View file

@ -19,10 +19,10 @@ Window::Window(const QString &windowName, ChannelManager &_channelManager,
: BaseWidget(_colorScheme, nullptr)
, settingRoot(fS("/windows/{}", windowName))
, windowGeometry(this->settingRoot)
, dpi(this->getDpiMultiplier())
, channelManager(_channelManager)
, colorScheme(_colorScheme)
, notebook(this->channelManager, this, _isMainWindow, this->settingRoot)
, dpi(this->getDpiMultiplier())
{
this->initAsWindow();

View file

@ -81,7 +81,7 @@ int WindowManager::windowCount()
widgets::Window *WindowManager::windowAt(int index)
{
if (index < 0 || index >= this->windows.size()) {
if (index < 0 || (size_t)index >= this->windows.size()) {
return nullptr;
}
qDebug() << "getting window at bad index" << index;