changes for light mode

This commit is contained in:
fourtf
2018-06-07 17:43:21 +02:00
parent 698814a21f
commit 9b26fce781
16 changed files with 590 additions and 495 deletions
+438 -436
View File
@@ -1,436 +1,438 @@
#------------------------------------------------- #-------------------------------------------------
# #
# Project created by QtCreator 2016-12-28T18:23:35 # Project created by QtCreator 2016-12-28T18:23:35
# #
#------------------------------------------------- #-------------------------------------------------
message(----) message(----)
QT += widgets core gui network multimedia svg QT += widgets core gui network multimedia svg
CONFIG += communi CONFIG += communi
COMMUNI += core model util COMMUNI += core model util
CONFIG += c++14 CONFIG += c++14
INCLUDEPATH += src/ INCLUDEPATH += src/
TARGET = chatterino TARGET = chatterino
TEMPLATE = app TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS DEFINES += QT_DEPRECATED_WARNINGS
PRECOMPILED_HEADER = src/precompiled_header.hpp PRECOMPILED_HEADER = src/precompiled_header.hpp
CONFIG += precompile_header CONFIG += precompile_header
# https://bugreports.qt.io/browse/QTBUG-27018 # https://bugreports.qt.io/browse/QTBUG-27018
equals(QMAKE_CXX, "clang++")|equals(QMAKE_CXX, "g++") { equals(QMAKE_CXX, "clang++")|equals(QMAKE_CXX, "g++") {
TARGET = bin/chatterino TARGET = bin/chatterino
} }
# Icons # Icons
macx:ICON = resources/images/chatterino2.icns macx:ICON = resources/images/chatterino2.icns
win32:RC_FILE = resources/windows.rc win32:RC_FILE = resources/windows.rc
macx { macx {
LIBS += -L/usr/local/lib LIBS += -L/usr/local/lib
} }
# Submodules # Submodules
include(dependencies/rapidjson.pri) include(dependencies/rapidjson.pri)
include(dependencies/settings.pri) include(dependencies/settings.pri)
include(dependencies/signals.pri) include(dependencies/signals.pri)
include(dependencies/humanize.pri) include(dependencies/humanize.pri)
include(dependencies/fmt.pri) include(dependencies/fmt.pri)
DEFINES += IRC_NAMESPACE=Communi DEFINES += IRC_NAMESPACE=Communi
include(dependencies/libcommuni.pri) include(dependencies/libcommuni.pri)
include(dependencies/websocketpp.pri) include(dependencies/websocketpp.pri)
include(dependencies/openssl.pri) include(dependencies/openssl.pri)
include(dependencies/boost.pri) include(dependencies/boost.pri)
# Optional feature: QtWebEngine # Optional feature: QtWebEngine
#exists ($(QTDIR)/include/QtWebEngine/QtWebEngine) { #exists ($(QTDIR)/include/QtWebEngine/QtWebEngine) {
# message(Using QWebEngine) # message(Using QWebEngine)
# QT += webenginewidgets # QT += webenginewidgets
# DEFINES += "USEWEBENGINE" # DEFINES += "USEWEBENGINE"
#} #}
linux { linux {
LIBS += -lrt LIBS += -lrt
} }
win32 { win32 {
LIBS += -luser32 LIBS += -luser32
} }
# OSX include directory # OSX include directory
macx { macx {
INCLUDEPATH += /usr/local/include INCLUDEPATH += /usr/local/include
} }
# Optional dependency on Windows SDK 7 # Optional dependency on Windows SDK 7
!contains(QMAKE_TARGET.arch, x86_64) { !contains(QMAKE_TARGET.arch, x86_64) {
win32:exists(C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\Windows.h) { win32:exists(C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\Windows.h) {
LIBS += -L"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib" \ LIBS += -L"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib" \
-ldwmapi -ldwmapi
DEFINES += "USEWINSDK" DEFINES += "USEWINSDK"
message(Using Windows SDK 7) message(Using Windows SDK 7)
} }
} }
# Optional dependency on Windows SDK 10 # Optional dependency on Windows SDK 10
contains(QMAKE_TARGET.arch, x86_64) { contains(QMAKE_TARGET.arch, x86_64) {
WIN_SDK_VERSION = $$(WindowsSDKVersion) WIN_SDK_VERSION = $$(WindowsSDKVersion)
!isEmpty(WIN_SDK_VERSION) { !isEmpty(WIN_SDK_VERSION) {
!equals(WIN_SDK_VERSION, "\\") { !equals(WIN_SDK_VERSION, "\\") {
DEFINES += "USEWINSDK" DEFINES += "USEWINSDK"
message(Using Windows SDK 10) message(Using Windows SDK 10)
} }
} }
} }
werr { werr {
QMAKE_CXXFLAGS += -Werror QMAKE_CXXFLAGS += -Werror
message("Enabling error on warning") message("Enabling error on warning")
} }
# src # src
SOURCES += \ SOURCES += \
src/main.cpp \ src/main.cpp \
src/application.cpp \ src/application.cpp \
src/channel.cpp \ src/channel.cpp \
src/channeldata.cpp \ src/channeldata.cpp \
src/messages/image.cpp \ src/messages/image.cpp \
src/messages/layouts/messagelayout.cpp \ src/messages/layouts/messagelayout.cpp \
src/messages/layouts/messagelayoutcontainer.cpp \ src/messages/layouts/messagelayoutcontainer.cpp \
src/messages/layouts/messagelayoutelement.cpp \ src/messages/layouts/messagelayoutelement.cpp \
src/messages/link.cpp \ src/messages/link.cpp \
src/messages/message.cpp \ src/messages/message.cpp \
src/messages/messagebuilder.cpp \ src/messages/messagebuilder.cpp \
src/messages/messagecolor.cpp \ src/messages/messagecolor.cpp \
src/messages/messageelement.cpp \ src/messages/messageelement.cpp \
src/providers/irc/abstractircserver.cpp \ src/providers/irc/abstractircserver.cpp \
src/providers/twitch/ircmessagehandler.cpp \ src/providers/twitch/ircmessagehandler.cpp \
src/providers/twitch/twitchaccount.cpp \ src/providers/twitch/twitchaccount.cpp \
src/providers/twitch/twitchaccountmanager.cpp \ src/providers/twitch/twitchaccountmanager.cpp \
src/providers/twitch/twitchchannel.cpp \ src/providers/twitch/twitchchannel.cpp \
src/providers/twitch/twitchmessagebuilder.cpp \ src/providers/twitch/twitchmessagebuilder.cpp \
src/providers/twitch/twitchserver.cpp \ src/providers/twitch/twitchserver.cpp \
src/providers/twitch/pubsub.cpp \ src/providers/twitch/pubsub.cpp \
src/providers/twitch/twitchemotes.cpp \ src/providers/twitch/twitchemotes.cpp \
src/providers/bttv/bttvemotes.cpp \ src/providers/bttv/bttvemotes.cpp \
src/providers/ffz/ffzemotes.cpp \ src/providers/ffz/ffzemotes.cpp \
src/providers/emoji/emojis.cpp \ src/providers/emoji/emojis.cpp \
src/singletons/emotemanager.cpp \ src/singletons/emotemanager.cpp \
src/singletons/fontmanager.cpp \ src/singletons/fontmanager.cpp \
src/util/completionmodel.cpp \ src/util/completionmodel.cpp \
src/singletons/helper/loggingchannel.cpp \ src/singletons/helper/loggingchannel.cpp \
src/singletons/helper/moderationaction.cpp \ src/singletons/helper/moderationaction.cpp \
src/singletons/helper/chatterinosetting.cpp \ src/singletons/helper/chatterinosetting.cpp \
src/singletons/helper/giftimer.cpp \ src/singletons/helper/giftimer.cpp \
src/singletons/loggingmanager.cpp \ src/singletons/loggingmanager.cpp \
src/singletons/pathmanager.cpp \ src/singletons/pathmanager.cpp \
src/singletons/resourcemanager.cpp \ src/singletons/resourcemanager.cpp \
src/singletons/settingsmanager.cpp \ src/singletons/settingsmanager.cpp \
src/singletons/thememanager.cpp \ src/singletons/thememanager.cpp \
src/singletons/windowmanager.cpp \ src/singletons/windowmanager.cpp \
src/util/networkmanager.cpp \ src/util/networkmanager.cpp \
src/util/networkrequest.cpp \ src/util/networkrequest.cpp \
src/widgets/accountswitchpopupwidget.cpp \ src/widgets/accountswitchpopupwidget.cpp \
src/widgets/accountswitchwidget.cpp \ src/widgets/accountswitchwidget.cpp \
src/widgets/basewidget.cpp \ src/widgets/basewidget.cpp \
src/widgets/basewindow.cpp \ src/widgets/basewindow.cpp \
src/widgets/emotepopup.cpp \ src/widgets/emotepopup.cpp \
src/widgets/helper/channelview.cpp \ src/widgets/helper/channelview.cpp \
src/widgets/helper/droppreview.cpp \ src/widgets/helper/droppreview.cpp \
src/widgets/helper/label.cpp \ src/widgets/helper/label.cpp \
src/widgets/helper/notebookbutton.cpp \ src/widgets/helper/notebookbutton.cpp \
src/widgets/helper/notebooktab.cpp \ src/widgets/helper/notebooktab.cpp \
src/widgets/helper/resizingtextedit.cpp \ src/widgets/helper/resizingtextedit.cpp \
src/widgets/helper/rippleeffectbutton.cpp \ src/widgets/helper/rippleeffectbutton.cpp \
src/widgets/helper/rippleeffectlabel.cpp \ src/widgets/helper/rippleeffectlabel.cpp \
src/widgets/helper/scrollbarhighlight.cpp \ src/widgets/helper/scrollbarhighlight.cpp \
src/widgets/helper/searchpopup.cpp \ src/widgets/helper/searchpopup.cpp \
src/widgets/helper/settingsdialogtab.cpp \ src/widgets/helper/settingsdialogtab.cpp \
src/widgets/helper/splitcolumn.cpp \ src/widgets/helper/splitcolumn.cpp \
src/widgets/helper/splitheader.cpp \ src/widgets/helper/splitheader.cpp \
src/widgets/helper/splitinput.cpp \ src/widgets/helper/splitinput.cpp \
src/widgets/helper/titlebarbutton.cpp \ src/widgets/helper/titlebarbutton.cpp \
src/widgets/logindialog.cpp \ src/widgets/logindialog.cpp \
src/widgets/notebook.cpp \ src/widgets/notebook.cpp \
src/widgets/qualitypopup.cpp \ src/widgets/qualitypopup.cpp \
src/widgets/scrollbar.cpp \ src/widgets/scrollbar.cpp \
src/widgets/settingsdialog.cpp \ src/widgets/settingsdialog.cpp \
src/widgets/settingspages/aboutpage.cpp \ src/widgets/settingspages/aboutpage.cpp \
src/widgets/settingspages/accountspage.cpp \ src/widgets/settingspages/accountspage.cpp \
src/widgets/settingspages/appearancepage.cpp \ src/widgets/settingspages/appearancepage.cpp \
src/widgets/settingspages/behaviourpage.cpp \ src/widgets/settingspages/behaviourpage.cpp \
src/widgets/settingspages/commandpage.cpp \ src/widgets/settingspages/commandpage.cpp \
src/widgets/settingspages/emotespage.cpp \ src/widgets/settingspages/emotespage.cpp \
src/widgets/settingspages/highlightingpage.cpp \ src/widgets/settingspages/highlightingpage.cpp \
src/widgets/settingspages/ignoreuserspage.cpp \ src/widgets/settingspages/ignoreuserspage.cpp \
src/widgets/settingspages/keyboardsettingspage.cpp \ src/widgets/settingspages/keyboardsettingspage.cpp \
src/widgets/settingspages/logspage.cpp \ src/widgets/settingspages/logspage.cpp \
src/widgets/settingspages/moderationpage.cpp \ src/widgets/settingspages/moderationpage.cpp \
src/widgets/settingspages/settingspage.cpp \ src/widgets/settingspages/settingspage.cpp \
src/widgets/settingspages/specialchannelspage.cpp \ src/widgets/settingspages/specialchannelspage.cpp \
src/widgets/split.cpp \ src/widgets/split.cpp \
src/widgets/splitcontainer.cpp \ src/widgets/splitcontainer.cpp \
src/widgets/streamview.cpp \ src/widgets/streamview.cpp \
src/widgets/textinputdialog.cpp \ src/widgets/textinputdialog.cpp \
src/widgets/tooltipwidget.cpp \ src/widgets/tooltipwidget.cpp \
src/widgets/window.cpp \ src/widgets/window.cpp \
src/providers/irc/ircaccount.cpp \ src/providers/irc/ircaccount.cpp \
src/providers/irc/ircserver.cpp \ src/providers/irc/ircserver.cpp \
src/providers/irc/ircchannel2.cpp \ src/providers/irc/ircchannel2.cpp \
src/util/streamlink.cpp \ src/util/streamlink.cpp \
src/providers/twitch/twitchhelpers.cpp \ src/providers/twitch/twitchhelpers.cpp \
src/widgets/helper/signallabel.cpp \ src/widgets/helper/signallabel.cpp \
src/widgets/helper/debugpopup.cpp \ src/widgets/helper/debugpopup.cpp \
src/util/debugcount.cpp \ src/util/debugcount.cpp \
src/singletons/nativemessagingmanager.cpp \ src/singletons/nativemessagingmanager.cpp \
src/util/rapidjson-helpers.cpp \ src/util/rapidjson-helpers.cpp \
src/providers/twitch/pubsubhelpers.cpp \ src/providers/twitch/pubsubhelpers.cpp \
src/providers/twitch/pubsubactions.cpp \ src/providers/twitch/pubsubactions.cpp \
src/providers/twitch/twitchuser.cpp \ src/providers/twitch/twitchuser.cpp \
src/widgets/selectchanneldialog.cpp \ src/widgets/selectchanneldialog.cpp \
src/singletons/updatemanager.cpp \ src/singletons/updatemanager.cpp \
src/widgets/lastruncrashdialog.cpp \ src/widgets/lastruncrashdialog.cpp \
src/widgets/attachedwindow.cpp \ src/widgets/attachedwindow.cpp \
src/widgets/settingspages/externaltoolspage.cpp \ src/widgets/settingspages/externaltoolspage.cpp \
src/widgets/helper/comboboxitemdelegate.cpp \ src/widgets/helper/comboboxitemdelegate.cpp \
src/controllers/commands/command.cpp \ src/controllers/commands/command.cpp \
src/controllers/commands/commandmodel.cpp \ src/controllers/commands/commandmodel.cpp \
src/controllers/commands/commandcontroller.cpp \ src/controllers/commands/commandcontroller.cpp \
src/controllers/highlights/highlightcontroller.cpp \ src/controllers/highlights/highlightcontroller.cpp \
src/controllers/highlights/highlightmodel.cpp \ src/controllers/highlights/highlightmodel.cpp \
src/controllers/ignores/ignorecontroller.cpp \ src/controllers/ignores/ignorecontroller.cpp \
src/controllers/ignores/ignoremodel.cpp \ src/controllers/ignores/ignoremodel.cpp \
src/widgets/helper/editablemodelview.cpp \ src/widgets/helper/editablemodelview.cpp \
src/controllers/accounts/accountcontroller.cpp \ src/controllers/accounts/accountcontroller.cpp \
src/controllers/accounts/accountmodel.cpp \ src/controllers/accounts/accountmodel.cpp \
src/controllers/accounts/account.cpp \ src/controllers/accounts/account.cpp \
src/widgets/helper/splitoverlay.cpp \ src/widgets/helper/splitoverlay.cpp \
src/widgets/helper/dropoverlay.cpp \ src/widgets/helper/dropoverlay.cpp \
src/widgets/helper/splitnode.cpp \ src/widgets/helper/splitnode.cpp \
src/widgets/notificationpopup.cpp \ src/widgets/notificationpopup.cpp \
src/controllers/taggedusers/taggeduserscontroller.cpp \ src/controllers/taggedusers/taggeduserscontroller.cpp \
src/controllers/taggedusers/taggeduser.cpp \ src/controllers/taggedusers/taggeduser.cpp \
src/controllers/taggedusers/taggedusersmodel.cpp \ src/controllers/taggedusers/taggedusersmodel.cpp \
src/util/emotemap.cpp \ src/util/emotemap.cpp \
src/providers/irc/ircconnection2.cpp \ src/providers/irc/ircconnection2.cpp \
src/widgets/userinfopopup.cpp src/widgets/userinfopopup.cpp \
src/widgets/welcomedialog.cpp
HEADERS += \
src/precompiled_header.hpp \ HEADERS += \
src/channel.hpp \ src/precompiled_header.hpp \
src/const.hpp \ src/channel.hpp \
src/debug/log.hpp \ src/const.hpp \
src/messages/image.hpp \ src/debug/log.hpp \
src/messages/layouts/messagelayout.hpp \ src/messages/image.hpp \
src/messages/layouts/messagelayoutcontainer.hpp \ src/messages/layouts/messagelayout.hpp \
src/messages/layouts/messagelayoutelement.hpp \ src/messages/layouts/messagelayoutcontainer.hpp \
src/messages/limitedqueue.hpp \ src/messages/layouts/messagelayoutelement.hpp \
src/messages/limitedqueuesnapshot.hpp \ src/messages/limitedqueue.hpp \
src/messages/link.hpp \ src/messages/limitedqueuesnapshot.hpp \
src/messages/message.hpp \ src/messages/link.hpp \
src/messages/messagebuilder.hpp \ src/messages/message.hpp \
src/messages/messagecolor.hpp \ src/messages/messagebuilder.hpp \
src/messages/messageelement.hpp \ src/messages/messagecolor.hpp \
src/messages/messageparseargs.hpp \ src/messages/messageelement.hpp \
src/messages/selection.hpp \ src/messages/messageparseargs.hpp \
src/providers/twitch/emotevalue.hpp \ src/messages/selection.hpp \
src/providers/twitch/ircmessagehandler.hpp \ src/providers/twitch/emotevalue.hpp \
src/providers/twitch/twitchaccount.hpp \ src/providers/twitch/ircmessagehandler.hpp \
src/providers/twitch/twitchaccountmanager.hpp \ src/providers/twitch/twitchaccount.hpp \
src/providers/twitch/twitchchannel.hpp \ src/providers/twitch/twitchaccountmanager.hpp \
src/providers/twitch/twitchmessagebuilder.hpp \ src/providers/twitch/twitchchannel.hpp \
src/providers/twitch/twitchserver.hpp \ src/providers/twitch/twitchmessagebuilder.hpp \
src/providers/twitch/pubsub.hpp \ src/providers/twitch/twitchserver.hpp \
src/providers/twitch/twitchemotes.hpp \ src/providers/twitch/pubsub.hpp \
src/providers/bttv/bttvemotes.hpp \ src/providers/twitch/twitchemotes.hpp \
src/providers/ffz/ffzemotes.hpp \ src/providers/bttv/bttvemotes.hpp \
src/providers/emoji/emojis.hpp \ src/providers/ffz/ffzemotes.hpp \
src/singletons/emotemanager.hpp \ src/providers/emoji/emojis.hpp \
src/singletons/fontmanager.hpp \ src/singletons/emotemanager.hpp \
src/singletons/helper/chatterinosetting.hpp \ src/singletons/fontmanager.hpp \
src/singletons/helper/giftimer.hpp \ src/singletons/helper/chatterinosetting.hpp \
src/util/completionmodel.hpp \ src/singletons/helper/giftimer.hpp \
src/singletons/helper/loggingchannel.hpp \ src/util/completionmodel.hpp \
src/singletons/helper/moderationaction.hpp \ src/singletons/helper/loggingchannel.hpp \
src/singletons/loggingmanager.hpp \ src/singletons/helper/moderationaction.hpp \
src/singletons/pathmanager.hpp \ src/singletons/loggingmanager.hpp \
src/singletons/resourcemanager.hpp \ src/singletons/pathmanager.hpp \
src/singletons/thememanager.hpp \ src/singletons/resourcemanager.hpp \
src/singletons/windowmanager.hpp \ src/singletons/thememanager.hpp \
src/util/benchmark.hpp \ src/singletons/windowmanager.hpp \
src/util/concurrentmap.hpp \ src/util/benchmark.hpp \
src/util/distancebetweenpoints.hpp \ src/util/concurrentmap.hpp \
src/util/emotemap.hpp \ src/util/distancebetweenpoints.hpp \
src/util/flagsenum.hpp \ src/util/emotemap.hpp \
src/util/helpers.hpp \ src/util/flagsenum.hpp \
src/util/irchelpers.hpp \ src/util/helpers.hpp \
src/util/layoutcreator.hpp \ src/util/irchelpers.hpp \
src/util/nativeeventhelper.hpp \ src/util/layoutcreator.hpp \
src/util/networkmanager.hpp \ src/util/nativeeventhelper.hpp \
src/util/networkrequest.hpp \ src/util/networkmanager.hpp \
src/util/networkrequester.hpp \ src/util/networkrequest.hpp \
src/util/networkworker.hpp \ src/util/networkrequester.hpp \
src/util/posttothread.hpp \ src/util/networkworker.hpp \
src/util/property.hpp \ src/util/posttothread.hpp \
src/util/serialize-custom.hpp \ src/util/property.hpp \
src/util/urlfetch.hpp \ src/util/serialize-custom.hpp \
src/widgets/accountswitchpopupwidget.hpp \ src/util/urlfetch.hpp \
src/widgets/accountswitchwidget.hpp \ src/widgets/accountswitchpopupwidget.hpp \
src/widgets/basewidget.hpp \ src/widgets/accountswitchwidget.hpp \
src/widgets/basewindow.hpp \ src/widgets/basewidget.hpp \
src/widgets/emotepopup.hpp \ src/widgets/basewindow.hpp \
src/widgets/helper/channelview.hpp \ src/widgets/emotepopup.hpp \
src/widgets/helper/droppreview.hpp \ src/widgets/helper/channelview.hpp \
src/widgets/helper/label.hpp \ src/widgets/helper/droppreview.hpp \
src/widgets/helper/notebookbutton.hpp \ src/widgets/helper/label.hpp \
src/widgets/helper/notebooktab.hpp \ src/widgets/helper/notebookbutton.hpp \
src/widgets/helper/resizingtextedit.hpp \ src/widgets/helper/notebooktab.hpp \
src/widgets/helper/rippleeffectbutton.hpp \ src/widgets/helper/resizingtextedit.hpp \
src/widgets/helper/rippleeffectlabel.hpp \ src/widgets/helper/rippleeffectbutton.hpp \
src/widgets/helper/scrollbarhighlight.hpp \ src/widgets/helper/rippleeffectlabel.hpp \
src/widgets/helper/searchpopup.hpp \ src/widgets/helper/scrollbarhighlight.hpp \
src/widgets/helper/settingsdialogtab.hpp \ src/widgets/helper/searchpopup.hpp \
src/widgets/helper/shortcut.hpp \ src/widgets/helper/settingsdialogtab.hpp \
src/widgets/helper/signallabel.hpp \ src/widgets/helper/shortcut.hpp \
src/widgets/helper/splitcolumn.hpp \ src/widgets/helper/signallabel.hpp \
src/widgets/helper/splitheader.hpp \ src/widgets/helper/splitcolumn.hpp \
src/widgets/helper/splitinput.hpp \ src/widgets/helper/splitheader.hpp \
src/widgets/helper/titlebarbutton.hpp \ src/widgets/helper/splitinput.hpp \
src/widgets/notebook.hpp \ src/widgets/helper/titlebarbutton.hpp \
src/widgets/qualitypopup.hpp \ src/widgets/notebook.hpp \
src/widgets/scrollbar.hpp \ src/widgets/qualitypopup.hpp \
src/widgets/settingsdialog.hpp \ src/widgets/scrollbar.hpp \
src/widgets/settingspages/aboutpage.hpp \ src/widgets/settingsdialog.hpp \
src/widgets/settingspages/accountspage.hpp \ src/widgets/settingspages/aboutpage.hpp \
src/widgets/settingspages/appearancepage.hpp \ src/widgets/settingspages/accountspage.hpp \
src/widgets/settingspages/behaviourpage.hpp \ src/widgets/settingspages/appearancepage.hpp \
src/widgets/settingspages/commandpage.hpp \ src/widgets/settingspages/behaviourpage.hpp \
src/widgets/settingspages/emotespage.hpp \ src/widgets/settingspages/commandpage.hpp \
src/widgets/settingspages/highlightingpage.hpp \ src/widgets/settingspages/emotespage.hpp \
src/widgets/settingspages/ignoreuserspage.hpp \ src/widgets/settingspages/highlightingpage.hpp \
src/widgets/settingspages/keyboardsettingspage.hpp \ src/widgets/settingspages/ignoreuserspage.hpp \
src/widgets/settingspages/logspage.hpp \ src/widgets/settingspages/keyboardsettingspage.hpp \
src/widgets/settingspages/moderationpage.hpp \ src/widgets/settingspages/logspage.hpp \
src/widgets/settingspages/settingspage.hpp \ src/widgets/settingspages/moderationpage.hpp \
src/widgets/settingspages/specialchannelspage.hpp \ src/widgets/settingspages/settingspage.hpp \
src/widgets/split.hpp \ src/widgets/settingspages/specialchannelspage.hpp \
src/widgets/splitcontainer.hpp \ src/widgets/split.hpp \
src/widgets/streamview.hpp \ src/widgets/splitcontainer.hpp \
src/widgets/textinputdialog.hpp \ src/widgets/streamview.hpp \
src/widgets/tooltipwidget.hpp \ src/widgets/textinputdialog.hpp \
src/widgets/window.hpp \ src/widgets/tooltipwidget.hpp \
src/common.hpp \ src/widgets/window.hpp \
src/providers/irc/abstractircserver.hpp \ src/common.hpp \
src/providers/irc/ircaccount.hpp \ src/providers/irc/abstractircserver.hpp \
src/providers/irc/ircserver.hpp \ src/providers/irc/ircaccount.hpp \
src/providers/irc/ircchannel2.hpp \ src/providers/irc/ircserver.hpp \
src/util/streamlink.hpp \ src/providers/irc/ircchannel2.hpp \
src/providers/twitch/twitchhelpers.hpp \ src/util/streamlink.hpp \
src/util/debugcount.hpp \ src/providers/twitch/twitchhelpers.hpp \
src/widgets/helper/debugpopup.hpp \ src/util/debugcount.hpp \
src/version.hpp \ src/widgets/helper/debugpopup.hpp \
src/singletons/settingsmanager.hpp \ src/version.hpp \
src/singletons/nativemessagingmanager.hpp \ src/singletons/settingsmanager.hpp \
src/util/rapidjson-helpers.hpp \ src/singletons/nativemessagingmanager.hpp \
src/providers/twitch/pubsubhelpers.hpp \ src/util/rapidjson-helpers.hpp \
src/providers/twitch/pubsubactions.hpp \ src/providers/twitch/pubsubhelpers.hpp \
src/providers/twitch/twitchuser.hpp \ src/providers/twitch/pubsubactions.hpp \
src/widgets/selectchanneldialog.hpp \ src/providers/twitch/twitchuser.hpp \
src/singletons/updatemanager.hpp \ src/widgets/selectchanneldialog.hpp \
src/widgets/lastruncrashdialog.hpp \ src/singletons/updatemanager.hpp \
src/widgets/attachedwindow.hpp \ src/widgets/lastruncrashdialog.hpp \
src/widgets/settingspages/externaltoolspage.hpp \ src/widgets/attachedwindow.hpp \
src/util/removescrollareabackground.hpp \ src/widgets/settingspages/externaltoolspage.hpp \
src/util/standarditemhelper.hpp \ src/util/removescrollareabackground.hpp \
src/widgets/helper/comboboxitemdelegate.hpp \ src/util/standarditemhelper.hpp \
src/util/assertinguithread.hpp \ src/widgets/helper/comboboxitemdelegate.hpp \
src/util/signalvector2.hpp \ src/util/assertinguithread.hpp \
src/util/signalvectormodel.hpp \ src/util/signalvector2.hpp \
src/controllers/commands/command.hpp \ src/util/signalvectormodel.hpp \
src/controllers/commands/commandmodel.hpp \ src/controllers/commands/command.hpp \
src/controllers/commands/commandcontroller.hpp \ src/controllers/commands/commandmodel.hpp \
src/controllers/highlights/highlightcontroller.hpp \ src/controllers/commands/commandcontroller.hpp \
src/controllers/highlights/highlightphrase.hpp \ src/controllers/highlights/highlightcontroller.hpp \
src/controllers/highlights/highlightmodel.hpp \ src/controllers/highlights/highlightphrase.hpp \
src/controllers/ignores/ignorecontroller.hpp \ src/controllers/highlights/highlightmodel.hpp \
src/controllers/ignores/ignorephrase.hpp \ src/controllers/ignores/ignorecontroller.hpp \
src/controllers/ignores/ignoremodel.hpp \ src/controllers/ignores/ignorephrase.hpp \
src/widgets/helper/editablemodelview.hpp \ src/controllers/ignores/ignoremodel.hpp \
src/controllers/accounts/accountcontroller.hpp \ src/widgets/helper/editablemodelview.hpp \
src/controllers/accounts/accountmodel.hpp \ src/controllers/accounts/accountcontroller.hpp \
src/controllers/accounts/account.hpp \ src/controllers/accounts/accountmodel.hpp \
src/util/sharedptrelementless.hpp \ src/controllers/accounts/account.hpp \
src/widgets/helper/splitoverlay.hpp \ src/util/sharedptrelementless.hpp \
src/widgets/helper/dropoverlay.hpp \ src/widgets/helper/splitoverlay.hpp \
src/widgets/helper/splitnode.hpp \ src/widgets/helper/dropoverlay.hpp \
src/widgets/notificationpopup.hpp \ src/widgets/helper/splitnode.hpp \
src/controllers/taggedusers/taggeduserscontroller.hpp \ src/widgets/notificationpopup.hpp \
src/controllers/taggedusers/taggeduser.hpp \ src/controllers/taggedusers/taggeduserscontroller.hpp \
src/providerid.hpp \ src/controllers/taggedusers/taggeduser.hpp \
src/controllers/taggedusers/taggedusersmodel.hpp \ src/providerid.hpp \
src/util/qstringhash.hpp \ src/controllers/taggedusers/taggedusersmodel.hpp \
src/util/mutexvalue.hpp \ src/util/qstringhash.hpp \
src/providers/irc/ircconnection2.hpp \ src/util/mutexvalue.hpp \
src/widgets/helper/line.hpp \ src/providers/irc/ircconnection2.hpp \
src/widgets/userinfopopup.hpp src/widgets/helper/line.hpp \
src/widgets/userinfopopup.hpp \
RESOURCES += \ src/widgets/welcomedialog.hpp
resources/resources.qrc
RESOURCES += \
DISTFILES += resources/resources.qrc
FORMS += DISTFILES +=
# Define warning flags for Chatterino FORMS +=
win32-msvc* {
QMAKE_CXXFLAGS_WARN_ON = /W4 # Define warning flags for Chatterino
# 4714 - function marked as __forceinline not inlined win32-msvc* {
# 4996 - occurs when the compiler encounters a function or variable that is marked as deprecated. QMAKE_CXXFLAGS_WARN_ON = /W4
# These functions may have a different preferred name, may be insecure or have # 4714 - function marked as __forceinline not inlined
# a more secure variant, or may be obsolete. # 4996 - occurs when the compiler encounters a function or variable that is marked as deprecated.
# 4505 - unreferenced local version has been removed # These functions may have a different preferred name, may be insecure or have
# 4127 - conditional expression is constant # a more secure variant, or may be obsolete.
# 4503 - decorated name length exceeded, name was truncated # 4505 - unreferenced local version has been removed
# 4100 - unreferences formal parameter # 4127 - conditional expression is constant
# 4305 - possible truncation of data # 4503 - decorated name length exceeded, name was truncated
# 4267 - possible loss of data in return # 4100 - unreferences formal parameter
QMAKE_CXXFLAGS_WARN_ON += /wd4714 # 4305 - possible truncation of data
QMAKE_CXXFLAGS_WARN_ON += /wd4996 # 4267 - possible loss of data in return
QMAKE_CXXFLAGS_WARN_ON += /wd4505 QMAKE_CXXFLAGS_WARN_ON += /wd4714
QMAKE_CXXFLAGS_WARN_ON += /wd4127 QMAKE_CXXFLAGS_WARN_ON += /wd4996
QMAKE_CXXFLAGS_WARN_ON += /wd4503 QMAKE_CXXFLAGS_WARN_ON += /wd4505
QMAKE_CXXFLAGS_WARN_ON += /wd4100 QMAKE_CXXFLAGS_WARN_ON += /wd4127
QMAKE_CXXFLAGS_WARN_ON += /wd4305 QMAKE_CXXFLAGS_WARN_ON += /wd4503
QMAKE_CXXFLAGS_WARN_ON += /wd4267 QMAKE_CXXFLAGS_WARN_ON += /wd4100
QMAKE_CXXFLAGS_WARN_ON += /wd4305
} else { QMAKE_CXXFLAGS_WARN_ON += /wd4267
QMAKE_CXXFLAGS_WARN_ON = -Wall
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function } else {
QMAKE_CXXFLAGS_WARN_ON += -Wno-switch QMAKE_CXXFLAGS_WARN_ON = -Wall
QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-declarations QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function
QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare QMAKE_CXXFLAGS_WARN_ON += -Wno-switch
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-declarations
QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare
# Disabling strict-aliasing warnings for now, although we probably want to re-enable this in the future QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable
QMAKE_CXXFLAGS_WARN_ON += -Wno-strict-aliasing
# Disabling strict-aliasing warnings for now, although we probably want to re-enable this in the future
equals(QMAKE_CXX, "clang++") { QMAKE_CXXFLAGS_WARN_ON += -Wno-strict-aliasing
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedef
} else { equals(QMAKE_CXX, "clang++") {
QMAKE_CXXFLAGS_WARN_ON += -Wno-class-memaccess QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedef
} } else {
} QMAKE_CXXFLAGS_WARN_ON += -Wno-class-memaccess
}
# do not use windows min/max macros }
#win32 {
# DEFINES += NOMINMAX # do not use windows min/max macros
#} #win32 {
# DEFINES += NOMINMAX
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #}
linux { #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
QMAKE_LFLAGS += -lrt
} linux {
QMAKE_LFLAGS += -lrt
}
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#000000;}
</style>
<path class="st0" d="M50,100c27.7,0,50-22.3,50-50S77.7,0,50,0S0,22.3,0,50S22.3,100,50,100z M33.3,46.2c4.2,0,8.3-3.3,8.3-8.3
s-4.2-8.3-8.3-8.3S25,32.9,25,37.9S29.2,46.2,33.3,46.2z M50,91.7C27,91.7,8.3,73,8.3,50S27,8.3,50,8.3S91.7,27,91.7,50
S73,91.7,50,91.7z M23.3,63.1c16.2,10.3,37.1,10.4,53.2,0.1l-4.3-7c-13.7,8.5-31,8.4-44.5-0.1L23.3,63.1z M67.1,46.2
c4.2,0,8.3-3.3,8.3-8.3s-4.2-8.3-8.3-8.3s-8.3,3.3-8.3,8.3S62.9,46.2,67.1,46.2z"/>
</svg>

After

Width:  |  Height:  |  Size: 847 B

+1
View File
@@ -65,6 +65,7 @@
<file>images/buttons/mod.png</file> <file>images/buttons/mod.png</file>
<file>images/buttons/unban.png</file> <file>images/buttons/unban.png</file>
<file>images/buttons/unmod.png</file> <file>images/buttons/unmod.png</file>
<file>images/emote_dark.svg</file>
</qresource> </qresource>
<qresource prefix="/qt/etc"> <qresource prefix="/qt/etc">
<file>qt.conf</file> <file>qt.conf</file>
+29 -18
View File
@@ -52,7 +52,8 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
isLight = multiplier > 0; isLight = multiplier > 0;
bool lightWin = isLight; bool lightWin = isLight;
QColor themeColor = QColor::fromHslF(hue, 0.43, 0.5); // QColor themeColor = QColor::fromHslF(hue, 0.43, 0.5);
QColor themeColor = QColor::fromHslF(hue, 0.8, 0.5);
QColor themeColorNoSat = QColor::fromHslF(hue, 0, 0.5); QColor themeColorNoSat = QColor::fromHslF(hue, 0, 0.5);
qreal sat = 0; qreal sat = 0;
@@ -86,17 +87,19 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
this->messages.textColors.caret = // this->messages.textColors.caret = //
this->messages.textColors.regular = isLight ? "#000" : "#fff"; this->messages.textColors.regular = isLight ? "#000" : "#fff";
QColor highlighted = lightWin ? QColor("#b60505") : QColor("#ee6166"); QColor highlighted = lightWin ? QColor("#ff0000") : QColor("#ee6166");
/// TABS /// TABS
if (lightWin) { if (lightWin) {
this->tabs.regular = {QColor("#444"), this->tabs.regular = {QColor("#444"),
{QColor("#fff"), QColor("#fff"), QColor("#fff")}, {QColor("#fff"), QColor("#eee"), QColor("#fff")},
{QColor("#fff"), QColor("#fff"), QColor("#fff")}}; {QColor("#fff"), QColor("#fff"), QColor("#fff")}};
this->tabs.newMessage = { this->tabs.newMessage = {QColor("#222"),
fg, {bg, QColor("#ccc"), bg}, {QColor("#aaa"), QColor("#aaa"), QColor("#aaa")}}; {QColor("#fff"), QColor("#eee"), QColor("#fff")},
this->tabs.highlighted = { {QColor("#bbb"), QColor("#bbb"), QColor("#bbb")}};
fg, {bg, QColor("#ccc"), bg}, {highlighted, highlighted, highlighted}}; this->tabs.highlighted = {fg,
{QColor("#fff"), QColor("#eee"), QColor("#fff")},
{highlighted, highlighted, highlighted}};
this->tabs.selected = {QColor("#000"), this->tabs.selected = {QColor("#000"),
{QColor("#b4d7ff"), QColor("#b4d7ff"), QColor("#b4d7ff")}, {QColor("#b4d7ff"), QColor("#b4d7ff"), QColor("#b4d7ff")},
{QColor("#00aeef"), QColor("#00aeef"), QColor("#00aeef")}}; {QColor("#00aeef"), QColor("#00aeef"), QColor("#00aeef")}};
@@ -147,13 +150,20 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
this->splits.background = getColor(0, sat, 1); this->splits.background = getColor(0, sat, 1);
this->splits.dropPreview = QColor(0, 148, 255, 0x30); this->splits.dropPreview = QColor(0, 148, 255, 0x30);
this->splits.dropPreviewBorder = QColor(0, 148, 255, 0xff); this->splits.dropPreviewBorder = QColor(0, 148, 255, 0xff);
this->splits.dropTargetRect = QColor(0, 148, 255, 0x00);
this->splits.dropTargetRectBorder = QColor(0, 148, 255, 0x00);
this->splits.resizeHandle = QColor(0, 148, 255, 0x70);
this->splits.resizeHandleBackground = QColor(0, 148, 255, 0x20);
// this->splits.border if (isLight) {
// this->splits.borderFocused this->splits.dropTargetRect = QColor(255, 255, 255, 0x00);
this->splits.dropTargetRectBorder = QColor(0, 148, 255, 0x00);
this->splits.resizeHandle = QColor(0, 148, 255, 0xff);
this->splits.resizeHandleBackground = QColor(0, 148, 255, 0x50);
} else {
this->splits.dropTargetRect = QColor(0, 148, 255, 0x00);
this->splits.dropTargetRectBorder = QColor(0, 148, 255, 0x00);
this->splits.resizeHandle = QColor(0, 148, 255, 0x70);
this->splits.resizeHandleBackground = QColor(0, 148, 255, 0x20);
}
this->splits.header.background = getColor(0, sat, flat ? 1 : 0.9); this->splits.header.background = getColor(0, sat, flat ? 1 : 0.9);
this->splits.header.border = getColor(0, sat, flat ? 1 : 0.85); this->splits.header.border = getColor(0, sat, flat ? 1 : 0.85);
@@ -165,8 +175,9 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
this->splits.input.styleSheet = this->splits.input.styleSheet =
"background:" + this->splits.input.background.name() + ";" + "background:" + this->splits.input.background.name() + ";" +
"border:" + this->tabs.selected.backgrounds.regular.color().name() + ";" + "border:" + this->tabs.selected.backgrounds.regular.color().name() + ";" +
"color:" + this->messages.textColors.regular.name() + ";" + "color:" + this->messages.textColors.regular.name() + ";" + //
"selection-background-color:" + this->tabs.selected.backgrounds.regular.color().name(); "selection-background-color:" +
(isLight ? "#68B1FF" : this->tabs.selected.backgrounds.regular.color().name());
// Message // Message
this->messages.textColors.link = isLight ? QColor(66, 134, 244) : QColor(66, 134, 244); this->messages.textColors.link = isLight ? QColor(66, 134, 244) : QColor(66, 134, 244);
@@ -175,7 +186,7 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
this->messages.backgrounds.regular = splits.background; this->messages.backgrounds.regular = splits.background;
this->messages.backgrounds.alternate = getColor(0, sat, 0.93); this->messages.backgrounds.alternate = getColor(0, sat, 0.93);
this->messages.backgrounds.highlighted = this->messages.backgrounds.highlighted =
blendColors(themeColor, this->messages.backgrounds.regular, 0.6); blendColors(themeColor, this->messages.backgrounds.regular, isLight ? 0.8 : 0.6);
this->messages.backgrounds.subscription = this->messages.backgrounds.subscription =
blendColors(QColor("#C466FF"), this->messages.backgrounds.regular, 0.7); blendColors(QColor("#C466FF"), this->messages.backgrounds.regular, 0.7);
@@ -200,7 +211,7 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
this->messages.selection = isLightTheme() ? QColor(0, 0, 0, 64) : QColor(255, 255, 255, 64); this->messages.selection = isLightTheme() ? QColor(0, 0, 0, 64) : QColor(255, 255, 255, 64);
this->updated.invoke(); this->updated.invoke();
} // namespace singletons }
QColor ThemeManager::blendColors(const QColor &color1, const QColor &color2, qreal ratio) QColor ThemeManager::blendColors(const QColor &color1, const QColor &color2, qreal ratio)
{ {
@@ -222,7 +233,7 @@ void ThemeManager::normalizeColor(QColor &color)
color.setHslF( color.setHslF(
color.hueF(), color.saturationF(), color.hueF(), color.saturationF(),
color.lightnessF() - sin((color.hueF() - 0.1) / (0.3333 - 0.1) * 3.14159) * color.lightnessF() - sin((color.hueF() - 0.1) / (0.3333 - 0.1) * 3.14159) *
color.saturationF() * 0.2); color.saturationF() * 0.4);
} }
} else { } else {
if (color.lightnessF() < 0.5) { if (color.lightnessF() < 0.5) {
-2
View File
@@ -59,8 +59,6 @@ public:
struct { struct {
QColor messageSeperator; QColor messageSeperator;
QColor background; QColor background;
QColor border;
QColor borderFocused;
QColor dropPreview; QColor dropPreview;
QColor dropPreviewBorder; QColor dropPreviewBorder;
QColor dropTargetRect; QColor dropTargetRect;
+21 -21
View File
@@ -216,7 +216,7 @@ public:
if (this->data.caller != nullptr) { if (this->data.caller != nullptr) {
QObject::connect(worker, &NetworkWorker::doneUrl, this->data.caller, QObject::connect(worker, &NetworkWorker::doneUrl, this->data.caller,
[onFinished, data = this->data](auto reply) mutable { [ onFinished, data = this->data ](auto reply) mutable {
if (reply->error() != QNetworkReply::NetworkError::NoError) { if (reply->error() != QNetworkReply::NetworkError::NoError) {
// TODO: We might want to call an onError callback here // TODO: We might want to call an onError callback here
return; return;
@@ -238,7 +238,7 @@ public:
QObject::connect( QObject::connect(
&requester, &NetworkRequester::requestUrl, worker, &requester, &NetworkRequester::requestUrl, worker,
[timer, data = std::move(this->data), worker, onFinished{std::move(onFinished)}]() { [ timer, data = std::move(this->data), worker, onFinished{std::move(onFinished)} ]() {
QNetworkReply *reply = NetworkManager::NaM.get(data.request); QNetworkReply *reply = NetworkManager::NaM.get(data.request);
if (timer != nullptr) { if (timer != nullptr) {
@@ -253,21 +253,21 @@ public:
data.onReplyCreated(reply); data.onReplyCreated(reply);
} }
QObject::connect(reply, &QNetworkReply::finished, worker, QObject::connect(reply, &QNetworkReply::finished, worker, [
[data = std::move(data), worker, reply, data = std::move(data), worker, reply, onFinished = std::move(onFinished)
onFinished = std::move(onFinished)]() mutable { ]() mutable {
if (data.caller == nullptr) { if (data.caller == nullptr) {
QByteArray bytes = reply->readAll(); QByteArray bytes = reply->readAll();
data.writeToCache(bytes); data.writeToCache(bytes);
onFinished(bytes); onFinished(bytes);
reply->deleteLater(); reply->deleteLater();
} else { } else {
emit worker->doneUrl(reply); emit worker->doneUrl(reply);
} }
delete worker; delete worker;
}); });
}); });
emit requester.requestUrl(); emit requester.requestUrl();
@@ -276,7 +276,7 @@ public:
template <typename FinishedCallback> template <typename FinishedCallback>
void getJSON(FinishedCallback onFinished) void getJSON(FinishedCallback onFinished)
{ {
this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes) -> bool { this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes)->bool {
auto object = parseJSONFromData(bytes); auto object = parseJSONFromData(bytes);
onFinished(object); onFinished(object);
@@ -289,7 +289,7 @@ public:
template <typename FinishedCallback> template <typename FinishedCallback>
void getJSON2(FinishedCallback onFinished) void getJSON2(FinishedCallback onFinished)
{ {
this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes) -> bool { this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes)->bool {
auto object = parseJSONFromData2(bytes); auto object = parseJSONFromData2(bytes);
onFinished(object); onFinished(object);
@@ -370,8 +370,8 @@ private:
worker->moveToThread(&NetworkManager::workerThread); worker->moveToThread(&NetworkManager::workerThread);
if (this->data.caller != nullptr) { if (this->data.caller != nullptr) {
QObject::connect(worker, &NetworkWorker::doneUrl, this->data.caller, QObject::connect(worker, &NetworkWorker::doneUrl,
[data = this->data](auto reply) mutable { this->data.caller, [data = this->data](auto reply) mutable {
if (reply->error() != QNetworkReply::NetworkError::NoError) { if (reply->error() != QNetworkReply::NetworkError::NoError) {
if (data.onError) { if (data.onError) {
data.onError(reply->error()); data.onError(reply->error());
@@ -394,7 +394,7 @@ private:
} }
QObject::connect(&requester, &NetworkRequester::requestUrl, worker, QObject::connect(&requester, &NetworkRequester::requestUrl, worker,
[timer, data = std::move(this->data), worker]() { [ timer, data = std::move(this->data), worker ]() {
QNetworkReply *reply = nullptr; QNetworkReply *reply = nullptr;
switch (data.requestType) { switch (data.requestType) {
case GetRequest: { case GetRequest: {
@@ -430,7 +430,7 @@ private:
} }
QObject::connect(reply, &QNetworkReply::finished, worker, QObject::connect(reply, &QNetworkReply::finished, worker,
[data = std::move(data), worker, reply]() mutable { [ data = std::move(data), worker, reply ]() mutable {
if (data.caller == nullptr) { if (data.caller == nullptr) {
QByteArray bytes = reply->readAll(); QByteArray bytes = reply->readAll();
data.writeToCache(bytes); data.writeToCache(bytes);
+1 -1
View File
@@ -29,7 +29,7 @@ struct Deserialize<QString> {
auto strLen = value.GetStringLength(); auto strLen = value.GetStringLength();
return QString::fromUtf8(str, strLen); return QString::fromUtf8(str, strLen);
} catch (const std::exception &e) { } catch (const std::exception &) {
// int x = 5; // int x = 5;
} catch (...) { } catch (...) {
// int y = 5; // int y = 5;
+19 -5
View File
@@ -108,11 +108,7 @@ void SplitInput::initLayout()
void SplitInput::scaleChangedEvent(float scale) void SplitInput::scaleChangedEvent(float scale)
{ {
// update the icon size of the emote button // update the icon size of the emote button
QString text = "<img src=':/images/emote.svg' width='xD' height='xD' />"; this->updateEmoteButton();
text.replace("xD", QString::number(int(12 * scale)));
this->ui_.emoteButton->getLabel().setText(text);
this->ui_.emoteButton->setFixedHeight(int(18 * scale));
// set maximum height // set maximum height
this->setMaximumHeight(int(150 * this->getScale())); this->setMaximumHeight(int(150 * this->getScale()));
@@ -124,11 +120,29 @@ void SplitInput::themeRefreshEvent()
palette.setColor(QPalette::Foreground, this->themeManager->splits.input.text); palette.setColor(QPalette::Foreground, this->themeManager->splits.input.text);
this->updateEmoteButton();
this->ui_.textEditLength->setPalette(palette); this->ui_.textEditLength->setPalette(palette);
this->ui_.textEdit->setStyleSheet(this->themeManager->splits.input.styleSheet); this->ui_.textEdit->setStyleSheet(this->themeManager->splits.input.styleSheet);
this->ui_.hbox->setMargin(int((this->themeManager->isLightTheme() ? 4 : 2) * this->getScale())); this->ui_.hbox->setMargin(int((this->themeManager->isLightTheme() ? 4 : 2) * this->getScale()));
this->ui_.emoteButton->getLabel().setStyleSheet("color: #000");
}
void SplitInput::updateEmoteButton()
{
float scale = this->getScale();
QString text = "<img src=':/images/emote.svg' width='xD' height='xD' />";
text.replace("xD", QString::number(int(12 * scale)));
if (this->themeManager->isLightTheme()) {
text.replace("emote", "emote_dark");
}
this->ui_.emoteButton->getLabel().setText(text);
this->ui_.emoteButton->setFixedHeight(int(18 * scale));
} }
void SplitInput::installKeyPressedEvent() void SplitInput::installKeyPressedEvent()
+3 -1
View File
@@ -33,6 +33,7 @@ public:
protected: protected:
virtual void scaleChangedEvent(float scale) override; virtual void scaleChangedEvent(float scale) override;
virtual void themeRefreshEvent() override;
virtual void paintEvent(QPaintEvent *) override; virtual void paintEvent(QPaintEvent *) override;
virtual void resizeEvent(QResizeEvent *) override; virtual void resizeEvent(QResizeEvent *) override;
@@ -58,7 +59,8 @@ private:
void initLayout(); void initLayout();
void installKeyPressedEvent(); void installKeyPressedEvent();
virtual void themeRefreshEvent() override;
void updateEmoteButton();
private slots: private slots:
void editTextChanged(); void editTextChanged();
+7 -1
View File
@@ -1,6 +1,8 @@
#include "splitoverlay.hpp" #include "splitoverlay.hpp"
#include <QEvent> #include <QEvent>
#include <QGraphicsBlurEffect>
#include <QGraphicsEffect>
#include <QGraphicsOpacityEffect> #include <QGraphicsOpacityEffect>
#include <QGridLayout> #include <QGridLayout>
#include <QPainter> #include <QPainter>
@@ -90,7 +92,11 @@ SplitOverlay::SplitOverlay(Split *parent)
void SplitOverlay::paintEvent(QPaintEvent *) void SplitOverlay::paintEvent(QPaintEvent *)
{ {
QPainter painter(this); QPainter painter(this);
painter.fillRect(this->rect(), QColor(0, 0, 0, 150)); if (this->themeManager->isLightTheme()) {
painter.fillRect(this->rect(), QColor(255, 255, 255, 200));
} else {
painter.fillRect(this->rect(), QColor(0, 0, 0, 150));
}
QRect rect; QRect rect;
switch (this->hoveredElement) { switch (this->hoveredElement) {
+10 -2
View File
@@ -418,7 +418,11 @@ void SplitContainer::paintEvent(QPaintEvent *)
painter.drawText(rect(), text, QTextOption(Qt::AlignCenter)); painter.drawText(rect(), text, QTextOption(Qt::AlignCenter));
} else { } else {
painter.fillRect(rect(), QColor("#555")); if (getApp()->themes->isLightTheme()) {
painter.fillRect(rect(), QColor("#999"));
} else {
painter.fillRect(rect(), QColor("#555"));
}
} }
for (DropRect &dropRect : this->dropRects) { for (DropRect &dropRect : this->dropRects) {
@@ -442,7 +446,11 @@ void SplitContainer::paintEvent(QPaintEvent *)
int s = std::min<int>(dropRect.rect.width(), dropRect.rect.height()) - 12; int s = std::min<int>(dropRect.rect.width(), dropRect.rect.height()) - 12;
painter.setPen(QColor(255, 255, 255)); if (this->themeManager->isLightTheme()) {
painter.setPen(QColor(0, 0, 0));
} else {
painter.setPen(QColor(255, 255, 255));
}
painter.drawLine(rect.left() + rect.width() / 2 - (s / 2), rect.top() + rect.height() / 2, painter.drawLine(rect.left() + rect.width() / 2 - (s / 2), rect.top() + rect.height() / 2,
rect.left() + rect.width() / 2 + (s / 2), rect.top() + rect.height() / 2); rect.left() + rect.width() / 2 + (s / 2), rect.top() + rect.height() / 2);
painter.drawLine(rect.left() + rect.width() / 2, rect.top() + rect.height() / 2 - (s / 2), painter.drawLine(rect.left() + rect.width() / 2, rect.top() + rect.height() / 2 - (s / 2),
+11 -8
View File
@@ -140,6 +140,13 @@ UserInfoPopup::UserInfoPopup()
this->installEvents(); this->installEvents();
} }
void UserInfoPopup::themeRefreshEvent()
{
BaseWindow::themeRefreshEvent();
this->setStyleSheet("background: #333");
}
void UserInfoPopup::installEvents() void UserInfoPopup::installEvents()
{ {
std::weak_ptr<bool> hack = this->hack_; std::weak_ptr<bool> hack = this->hack_;
@@ -346,7 +353,7 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
// connect // connect
QObject::connect( QObject::connect(
*a, &RippleEffectLabel::clicked, [this, timeout = std::get<1>(item)] { *a, &RippleEffectLabel::clicked, [ this, timeout = std::get<1>(item) ] {
this->buttonClicked.invoke(std::make_pair(Action::Timeout, timeout)); this->buttonClicked.invoke(std::make_pair(Action::Timeout, timeout));
}); });
} }
@@ -357,17 +364,13 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
addTimeouts("sec", {{"1", 1}}); addTimeouts("sec", {{"1", 1}});
addTimeouts("min", { addTimeouts("min", {
{"1", 1 * 60}, {"1", 1 * 60}, {"5", 5 * 60}, {"10", 10 * 60},
{"5", 5 * 60},
{"10", 10 * 60},
}); });
addTimeouts("hour", { addTimeouts("hour", {
{"1", 1 * 60 * 60}, {"1", 1 * 60 * 60}, {"4", 4 * 60 * 60},
{"4", 4 * 60 * 60},
}); });
addTimeouts("weeks", { addTimeouts("weeks", {
{"1", 1 * 60 * 60 * 30}, {"1", 1 * 60 * 60 * 30}, {"2", 2 * 60 * 60 * 30},
{"2", 2 * 60 * 60 * 30},
}); });
addButton(Ban, "ban", getApp()->resources->buttons.ban); addButton(Ban, "ban", getApp()->resources->buttons.ban);
+3
View File
@@ -20,6 +20,9 @@ public:
void setData(const QString &name, const ChannelPtr &channel); void setData(const QString &name, const ChannelPtr &channel);
protected:
virtual void themeRefreshEvent() override;
private: private:
bool isMod_; bool isMod_;
bool isBroadcaster_; bool isBroadcaster_;
+13
View File
@@ -0,0 +1,13 @@
#include "welcomedialog.hpp"
namespace chatterino {
namespace widgets {
WelcomeDialog::WelcomeDialog()
: BaseWindow(nullptr, BaseWindow::EnableCustomFrame)
{
this->setWindowTitle("Chatterino quick setup");
}
} // namespace widgets
} // namespace chatterino
+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include "widgets/basewindow.hpp"
namespace chatterino {
namespace widgets {
class WelcomeDialog : public BaseWindow
{
public:
WelcomeDialog();
};
} // namespace widgets
} // namespace chatterino
+7
View File
@@ -13,6 +13,7 @@
#include "widgets/notebook.hpp" #include "widgets/notebook.hpp"
#include "widgets/settingsdialog.hpp" #include "widgets/settingsdialog.hpp"
#include "widgets/split.hpp" #include "widgets/split.hpp"
#include "widgets/welcomedialog.hpp"
#include <QApplication> #include <QApplication>
#include <QHeaderView> #include <QHeaderView>
@@ -146,6 +147,12 @@ Window::Window(WindowType _type)
const auto &msg = messages[index++ % messages.size()]; const auto &msg = messages[index++ % messages.size()];
app->twitch.server->addFakeMessage(msg); app->twitch.server->addFakeMessage(msg);
}); });
CreateWindowShortcut(this, "F9", [=] {
auto *dialog = new WelcomeDialog();
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
});
#endif #endif
this->refreshWindowTitle(""); this->refreshWindowTitle("");