fix: Get rid of warnings on clang-cl (#6528)
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
- Dev: Refactored `Emotes` into `EmoteController`. (#6516)
|
- Dev: Refactored `Emotes` into `EmoteController`. (#6516)
|
||||||
- Dev: Fix Arch Linux partial upgrade error in CI. (#6553)
|
- Dev: Fix Arch Linux partial upgrade error in CI. (#6553)
|
||||||
- Dev: Added Qt keyword and warning flags project wide. (#6520)
|
- Dev: Added Qt keyword and warning flags project wide. (#6520)
|
||||||
|
- Def: Fixed compilation error in tests with Clang 21. (#6519)
|
||||||
|
- Dev: Fixed compilation warnings on clang-cl. (#6528)
|
||||||
- Dev: Fixed compilation error in tests with Clang 21. (#6519)
|
- Dev: Fixed compilation error in tests with Clang 21. (#6519)
|
||||||
- Dev: The LuaLS meta files moved from `docs/plugin-meta.lua` to `docs/lua-meta/globals.lua`. (#6530)
|
- Dev: The LuaLS meta files moved from `docs/plugin-meta.lua` to `docs/lua-meta/globals.lua`. (#6530)
|
||||||
|
|
||||||
|
|||||||
@@ -1234,6 +1234,14 @@ if (MSVC)
|
|||||||
# Enable updated '__cplusplus' macro - workaround for CMake#18837
|
# Enable updated '__cplusplus' macro - workaround for CMake#18837
|
||||||
/Zc:__cplusplus
|
/Zc:__cplusplus
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Warnings on clang-cl
|
||||||
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
|
target_compile_options(${LIBRARY_PROJECT} PUBLIC
|
||||||
|
-Wno-missing-designated-field-initializers
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Disable min/max macros from Windows.h
|
# Disable min/max macros from Windows.h
|
||||||
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC NOMINMAX)
|
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC NOMINMAX)
|
||||||
else ()
|
else ()
|
||||||
|
|||||||
+5
-17
@@ -110,20 +110,7 @@ void showLastCrashDialog(const Args &args, const Paths &paths)
|
|||||||
dialog->exec();
|
dialog->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void createRunningFile(const QString &path)
|
#if defined(NDEBUG) && !defined(CHATTERINO_WITH_CRASHPAD)
|
||||||
{
|
|
||||||
QFile runningFile(path);
|
|
||||||
|
|
||||||
std::ignore = runningFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
|
|
||||||
runningFile.flush();
|
|
||||||
runningFile.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeRunningFile(const QString &path)
|
|
||||||
{
|
|
||||||
QFile::remove(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::chrono::steady_clock::time_point signalsInitTime;
|
std::chrono::steady_clock::time_point signalsInitTime;
|
||||||
|
|
||||||
[[noreturn]] void handleSignal(int signum)
|
[[noreturn]] void handleSignal(int signum)
|
||||||
@@ -135,7 +122,7 @@ std::chrono::steady_clock::time_point signalsInitTime;
|
|||||||
{
|
{
|
||||||
QProcess proc;
|
QProcess proc;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
# ifdef Q_OS_MAC
|
||||||
// On macOS, programs are bundled into ".app" Application bundles,
|
// On macOS, programs are bundled into ".app" Application bundles,
|
||||||
// when restarting Chatterino that bundle should be opened with the "open"
|
// when restarting Chatterino that bundle should be opened with the "open"
|
||||||
// terminal command instead of directly starting the underlying executable,
|
// terminal command instead of directly starting the underlying executable,
|
||||||
@@ -152,16 +139,17 @@ std::chrono::steady_clock::time_point signalsInitTime;
|
|||||||
|
|
||||||
CFRelease(appUrlRef);
|
CFRelease(appUrlRef);
|
||||||
CFRelease(macPath);
|
CFRelease(macPath);
|
||||||
#else
|
# else
|
||||||
proc.setProgram(QApplication::applicationFilePath());
|
proc.setProgram(QApplication::applicationFilePath());
|
||||||
proc.setArguments({"--crash-recovery"});
|
proc.setArguments({"--crash-recovery"});
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
proc.startDetached();
|
proc.startDetached();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::_Exit(signum);
|
std::_Exit(signum);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// We want to restart Chatterino when it crashes and the setting is set to
|
// We want to restart Chatterino when it crashes and the setting is set to
|
||||||
// true.
|
// true.
|
||||||
|
|||||||
+4
-1
@@ -306,7 +306,10 @@ void Args::applyCustomChannelLayout(const QString &argValue, const Paths &paths)
|
|||||||
|
|
||||||
// Set first tab as selected
|
// Set first tab as selected
|
||||||
tab.selected_ = window.tabs_.empty();
|
tab.selected_ = window.tabs_.empty();
|
||||||
tab.rootNode_ = SplitNodeDescriptor{{"twitch", channelName}};
|
tab.rootNode_ = SplitNodeDescriptor{{
|
||||||
|
.type_ = "twitch",
|
||||||
|
.channelName_ = channelName,
|
||||||
|
}};
|
||||||
|
|
||||||
window.tabs_.emplace_back(std::move(tab));
|
window.tabs_.emplace_back(std::move(tab));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ void ChannelChatters::addJoinedUser(const QString &user, bool isMod,
|
|||||||
assertInGuiThread();
|
assertInGuiThread();
|
||||||
|
|
||||||
if (isIgnoredMessage(IgnoredMessageParameters{
|
if (isIgnoredMessage(IgnoredMessageParameters{
|
||||||
|
.message = {},
|
||||||
|
.twitchUserID = {},
|
||||||
.twitchUserLogin = user,
|
.twitchUserLogin = user,
|
||||||
.isMod = isMod,
|
.isMod = isMod,
|
||||||
.isBroadcaster = isBroadcaster,
|
.isBroadcaster = isBroadcaster,
|
||||||
@@ -69,6 +71,8 @@ void ChannelChatters::addPartedUser(const QString &user, bool isMod,
|
|||||||
assertInGuiThread();
|
assertInGuiThread();
|
||||||
|
|
||||||
if (isIgnoredMessage(IgnoredMessageParameters{
|
if (isIgnoredMessage(IgnoredMessageParameters{
|
||||||
|
.message = {},
|
||||||
|
.twitchUserID = {},
|
||||||
.twitchUserLogin = user,
|
.twitchUserLogin = user,
|
||||||
.isMod = isMod,
|
.isMod = isMod,
|
||||||
.isBroadcaster = isBroadcaster,
|
.isBroadcaster = isBroadcaster,
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ bool appendWhisperMessageWordsLocally(const QStringList &words)
|
|||||||
const auto &accemotes = *acc->accessEmotes();
|
const auto &accemotes = *acc->accessEmotes();
|
||||||
const auto *bttvemotes = app->getBttvEmotes();
|
const auto *bttvemotes = app->getBttvEmotes();
|
||||||
const auto *ffzemotes = app->getFfzEmotes();
|
const auto *ffzemotes = app->getFfzEmotes();
|
||||||
auto flags = MessageElementFlags();
|
|
||||||
auto emote = std::optional<EmotePtr>{};
|
auto emote = std::optional<EmotePtr>{};
|
||||||
for (int i = 2; i < words.length(); i++)
|
for (int i = 2; i < words.length(); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ std::unique_ptr<MessageElement> elementFromTable(const sol::table &tbl)
|
|||||||
case Link::AutoModAllow:
|
case Link::AutoModAllow:
|
||||||
case Link::AutoModDeny:
|
case Link::AutoModDeny:
|
||||||
case Link::OpenAccountsPage:
|
case Link::OpenAccountsPage:
|
||||||
|
case Link::ViewThread:
|
||||||
case Link::Reconnect:
|
case Link::Reconnect:
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
"Invalid link type. How'd this happen?");
|
"Invalid link type. How'd this happen?");
|
||||||
|
|||||||
@@ -480,7 +480,8 @@ int TextLayoutElement::getMouseOverIndex(QPointF abs) const
|
|||||||
// accept mouse to be at only 50%+ of character width to increase index
|
// accept mouse to be at only 50%+ of character width to increase index
|
||||||
if (x + (width * 0.5) > abs.x())
|
if (x + (width * 0.5) > abs.x())
|
||||||
{
|
{
|
||||||
if (text.size() > i + 1 && QChar::isLowSurrogate(text[i].unicode()))
|
if (text.size() > i + 1 &&
|
||||||
|
QChar::isLowSurrogate(static_cast<char32_t>(text[i].unicode())))
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,22 +110,26 @@ CreateEmoteResult createChannelEmote(const QString &channelDisplayName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto emote = Emote({
|
auto emote = Emote({
|
||||||
name,
|
.name = name,
|
||||||
ImageSet{
|
.images =
|
||||||
Image::fromUrl(getEmoteLinkV3(id, "1x"), 1, EMOTE_BASE_SIZE),
|
ImageSet{
|
||||||
Image::fromUrl(getEmoteLinkV3(id, "2x"), 0.5, EMOTE_BASE_SIZE * 2),
|
Image::fromUrl(getEmoteLinkV3(id, "1x"), 1, EMOTE_BASE_SIZE),
|
||||||
Image::fromUrl(getEmoteLinkV3(id, "3x"), 0.25, EMOTE_BASE_SIZE * 4),
|
Image::fromUrl(getEmoteLinkV3(id, "2x"), 0.5,
|
||||||
},
|
EMOTE_BASE_SIZE * 2),
|
||||||
Tooltip{
|
Image::fromUrl(getEmoteLinkV3(id, "3x"), 0.25,
|
||||||
QString("%1<br>%2 BetterTTV Emote<br>By: %3")
|
EMOTE_BASE_SIZE * 4),
|
||||||
.arg(name.string)
|
},
|
||||||
// when author is empty, it is a channel emote created by the broadcaster
|
.tooltip =
|
||||||
.arg(author.string.isEmpty() ? "Channel" : "Shared")
|
Tooltip{
|
||||||
.arg(author.string.isEmpty() ? channelDisplayName
|
QString("%1<br>%2 BetterTTV Emote<br>By: %3")
|
||||||
: author.string)},
|
.arg(name.string)
|
||||||
Url{EMOTE_LINK_FORMAT.arg(id.string)},
|
// when author is empty, it is a channel emote created by the broadcaster
|
||||||
false,
|
.arg(author.string.isEmpty() ? "Channel" : "Shared")
|
||||||
id,
|
.arg(author.string.isEmpty() ? channelDisplayName
|
||||||
|
: author.string)},
|
||||||
|
.homePage = Url{EMOTE_LINK_FORMAT.arg(id.string)},
|
||||||
|
.zeroWidth = false,
|
||||||
|
.id = id,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {id, name, emote};
|
return {id, name, emote};
|
||||||
|
|||||||
@@ -297,9 +297,11 @@ void Emojis::loadEmojiSet()
|
|||||||
}
|
}
|
||||||
QString url = urlPrefix + code + ".png";
|
QString url = urlPrefix + code + ".png";
|
||||||
emoji->emote = std::make_shared<Emote>(Emote{
|
emoji->emote = std::make_shared<Emote>(Emote{
|
||||||
EmoteName{emoji->value},
|
.name = EmoteName{emoji->value},
|
||||||
ImageSet{Image::fromUrl({url}, 0.35, {64, 64})},
|
.images = ImageSet{Image::fromUrl({url}, 0.35, {64, 64})},
|
||||||
Tooltip{":" + emoji->shortCodes[0] + ":<br/>Emoji"}, Url{}});
|
.tooltip = Tooltip{":" + emoji->shortCodes[0] + ":<br/>Emoji"},
|
||||||
|
.homePage = Url{},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,17 +66,21 @@ void FfzBadges::load()
|
|||||||
jsonBadge["height"].toInt(18));
|
jsonBadge["height"].toInt(18));
|
||||||
|
|
||||||
auto emote = Emote{
|
auto emote = Emote{
|
||||||
EmoteName{},
|
.name = EmoteName{},
|
||||||
ImageSet{Image::fromUrl(
|
.images =
|
||||||
parseFfzUrl(jsonUrls.value("1").toString()),
|
ImageSet{
|
||||||
1.0, baseSize),
|
Image::fromUrl(
|
||||||
Image::fromUrl(
|
parseFfzUrl(jsonUrls.value("1").toString()),
|
||||||
parseFfzUrl(jsonUrls.value("2").toString()),
|
1.0, baseSize),
|
||||||
0.5, baseSize * 2),
|
Image::fromUrl(
|
||||||
Image::fromUrl(
|
parseFfzUrl(jsonUrls.value("2").toString()),
|
||||||
parseFfzUrl(jsonUrls.value("4").toString()),
|
0.5, baseSize * 2),
|
||||||
0.25, baseSize * 4)},
|
Image::fromUrl(
|
||||||
Tooltip{jsonBadge.value("title").toString()}, Url{}};
|
parseFfzUrl(jsonUrls.value("4").toString()),
|
||||||
|
0.25, baseSize * 4)},
|
||||||
|
.tooltip = Tooltip{jsonBadge.value("title").toString()},
|
||||||
|
.homePage = Url{},
|
||||||
|
};
|
||||||
|
|
||||||
Badge badge;
|
Badge badge;
|
||||||
|
|
||||||
|
|||||||
@@ -24,18 +24,16 @@ public:
|
|||||||
SeventvAPI &operator=(const SeventvAPI &) = delete;
|
SeventvAPI &operator=(const SeventvAPI &) = delete;
|
||||||
SeventvAPI &operator=(SeventvAPI &&) = delete;
|
SeventvAPI &operator=(SeventvAPI &&) = delete;
|
||||||
|
|
||||||
virtual void getUserByTwitchID(
|
void getUserByTwitchID(const QString &twitchID,
|
||||||
const QString &twitchID,
|
SuccessCallback<const QJsonObject &> &&onSuccess,
|
||||||
SuccessCallback<const QJsonObject &> &&onSuccess,
|
ErrorCallback &&onError);
|
||||||
ErrorCallback &&onError);
|
void getEmoteSet(const QString &emoteSet,
|
||||||
virtual void getEmoteSet(const QString &emoteSet,
|
SuccessCallback<const QJsonObject &> &&onSuccess,
|
||||||
SuccessCallback<const QJsonObject &> &&onSuccess,
|
ErrorCallback &&onError);
|
||||||
ErrorCallback &&onError);
|
|
||||||
|
|
||||||
virtual void updatePresence(const QString &twitchChannelID,
|
void updatePresence(const QString &twitchChannelID,
|
||||||
const QString &seventvUserID,
|
const QString &seventvUserID,
|
||||||
SuccessCallback<> &&onSuccess,
|
SuccessCallback<> &&onSuccess, ErrorCallback &&onError);
|
||||||
ErrorCallback &&onError);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
@@ -67,17 +67,6 @@ bool isZeroWidthActive(const QJsonObject &activeEmote)
|
|||||||
return flags.has(SeventvActiveEmoteFlag::ZeroWidth);
|
return flags.has(SeventvActiveEmoteFlag::ZeroWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This is only an indicator if an emote should be added
|
|
||||||
* as zero-width or not. The user can still overwrite this.
|
|
||||||
*/
|
|
||||||
bool isZeroWidthRecommended(const QJsonObject &emoteData)
|
|
||||||
{
|
|
||||||
auto flags =
|
|
||||||
SeventvEmoteFlags(SeventvEmoteFlag(emoteData.value("flags").toInt()));
|
|
||||||
return flags.has(SeventvEmoteFlag::ZeroWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip createTooltip(const QString &name, const QString &author, bool isGlobal)
|
Tooltip createTooltip(const QString &name, const QString &author, bool isGlobal)
|
||||||
{
|
{
|
||||||
return Tooltip{QString("%1<br>%2 7TV Emote<br>By: %3")
|
return Tooltip{QString("%1<br>%2 7TV Emote<br>By: %3")
|
||||||
|
|||||||
@@ -460,14 +460,15 @@ EmotePtr TwitchEmotes::getOrCreateEmote(const EmoteId &id,
|
|||||||
auto baseSize = getEmoteExpectedBaseSize(id);
|
auto baseSize = getEmoteExpectedBaseSize(id);
|
||||||
auto emote3xScaleFactor = getEmote3xScaleFactor(id);
|
auto emote3xScaleFactor = getEmote3xScaleFactor(id);
|
||||||
(*cache)[id] = shared = std::make_shared<Emote>(Emote{
|
(*cache)[id] = shared = std::make_shared<Emote>(Emote{
|
||||||
EmoteName{name},
|
.name = EmoteName{name},
|
||||||
ImageSet{
|
.images =
|
||||||
Image::fromUrl(getEmoteLink(id, "1.0"), 1, baseSize),
|
ImageSet{
|
||||||
Image::fromUrl(getEmoteLink(id, "2.0"), 0.5, baseSize * 2),
|
Image::fromUrl(getEmoteLink(id, "1.0"), 1, baseSize),
|
||||||
Image::fromUrl(getEmoteLink(id, "3.0"), emote3xScaleFactor,
|
Image::fromUrl(getEmoteLink(id, "2.0"), 0.5, baseSize * 2),
|
||||||
baseSize * (1.0 / emote3xScaleFactor)),
|
Image::fromUrl(getEmoteLink(id, "3.0"), emote3xScaleFactor,
|
||||||
},
|
baseSize * (1.0 / emote3xScaleFactor)),
|
||||||
Tooltip{name.toHtmlEscaped() + "<br>Twitch Emote"},
|
},
|
||||||
|
.tooltip = Tooltip{name.toHtmlEscaped() + "<br>Twitch Emote"},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ const QString CRASHPAD_EXECUTABLE_NAME = QStringLiteral("crashpad-handler.exe");
|
|||||||
|
|
||||||
/// Converts a QString into the platform string representation.
|
/// Converts a QString into the platform string representation.
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX)
|
||||||
std::string nativeString(const QString &s)
|
[[maybe_unused]] std::string nativeString(const QString &s)
|
||||||
{
|
{
|
||||||
return s.toStdString();
|
return s.toStdString();
|
||||||
}
|
}
|
||||||
#elif defined(Q_OS_WINDOWS)
|
#elif defined(Q_OS_WINDOWS)
|
||||||
std::wstring nativeString(const QString &s)
|
[[maybe_unused]] std::wstring nativeString(const QString &s)
|
||||||
{
|
{
|
||||||
return s.toStdWString();
|
return s.toStdWString();
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,8 @@ std::optional<bool> readRecoverySettings(const Paths &paths)
|
|||||||
return shouldRecover.toBool();
|
return shouldRecover.toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool canRestart(const Paths &paths, const Args &args)
|
[[maybe_unused]] bool canRestart(const Paths &paths,
|
||||||
|
[[maybe_unused]] const Args &args)
|
||||||
{
|
{
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
if (args.isFramelessEmbed || args.shouldRunBrowserExtensionHost)
|
if (args.isFramelessEmbed || args.shouldRunBrowserExtensionHost)
|
||||||
@@ -108,7 +109,7 @@ bool canRestart(const Paths &paths, const Args &args)
|
|||||||
/// additional plus ('++' -> '+').
|
/// additional plus ('++' -> '+').
|
||||||
///
|
///
|
||||||
/// The decoding happens in crash-handler/src/CommandLine.cpp
|
/// The decoding happens in crash-handler/src/CommandLine.cpp
|
||||||
std::string encodeArguments(const Args &appArgs)
|
[[maybe_unused]] std::string encodeArguments(const Args &appArgs)
|
||||||
{
|
{
|
||||||
std::string args;
|
std::string args;
|
||||||
for (auto arg : appArgs.currentArguments())
|
for (auto arg : appArgs.currentArguments())
|
||||||
|
|||||||
@@ -251,6 +251,9 @@ Fonts::FontData Fonts::createFontData(FontStyle type, float scale)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return font;
|
return font;
|
||||||
|
|||||||
@@ -76,14 +76,16 @@ void registerNmManifest([[maybe_unused]] const Paths &paths,
|
|||||||
const Config &config, const QJsonDocument &document)
|
const Config &config, const QJsonDocument &document)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
writeManifestTo(paths.miscDirectory, u"."_s, config.fileName, document);
|
std::ignore =
|
||||||
|
writeManifestTo(paths.miscDirectory, u"."_s, config.fileName, document);
|
||||||
|
|
||||||
QSettings registry(config.registryKey, QSettings::NativeFormat);
|
QSettings registry(config.registryKey, QSettings::NativeFormat);
|
||||||
registry.setValue("Default",
|
registry.setValue("Default",
|
||||||
QString(paths.miscDirectory % u'/' % config.fileName));
|
QString(paths.miscDirectory % u'/' % config.fileName));
|
||||||
#else
|
#else
|
||||||
writeManifestTo(config.browserDirectory, config.nmDirectory,
|
std::ignore =
|
||||||
u"com.chatterino.chatterino.json"_s, document);
|
writeManifestTo(config.browserDirectory, config.nmDirectory,
|
||||||
|
u"com.chatterino.chatterino.json"_s, document);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -314,6 +314,9 @@ Window &WindowManager::createWindow(WindowType type, bool show, QWidget *parent)
|
|||||||
assertInGuiThread();
|
assertInGuiThread();
|
||||||
|
|
||||||
auto *const realParent = [this, type, parent]() -> QWidget * {
|
auto *const realParent = [this, type, parent]() -> QWidget * {
|
||||||
|
(void)this;
|
||||||
|
(void)type;
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
{
|
{
|
||||||
// If a parent is explicitly specified, we use that immediately.
|
// If a parent is explicitly specified, we use that immediately.
|
||||||
@@ -696,6 +699,9 @@ void WindowManager::encodeNodeRecursively(SplitNode *node, QJsonObject &obj)
|
|||||||
obj.insert("items", itemsArr);
|
obj.insert("items", itemsArr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.insert("flexh", node->getHorizontalFlex());
|
obj.insert("flexh", node->getHorizontalFlex());
|
||||||
@@ -737,6 +743,10 @@ void WindowManager::encodeChannel(IndirectChannel channel, QJsonObject &obj)
|
|||||||
obj.insert("type", "misc");
|
obj.insert("type", "misc");
|
||||||
obj.insert("name", channel.get()->getName());
|
obj.insert("name", channel.get()->getName());
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -923,6 +933,9 @@ void WindowManager::applyWindowLayout(const WindowLayout &layout)
|
|||||||
window.setWindowState(Qt::WindowMaximized);
|
window.setWindowState(Qt::WindowMaximized);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WindowDescriptor::State::None:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,10 +44,9 @@ BOOL CALLBACK enumWindows(HWND hwnd, LPARAM)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AttachedWindow::AttachedWindow(void *_target, int _yOffset)
|
AttachedWindow::AttachedWindow(void *_target)
|
||||||
: QWidget(nullptr, Qt::FramelessWindowHint | Qt::Window)
|
: QWidget(nullptr, Qt::FramelessWindowHint | Qt::Window)
|
||||||
, target_(_target)
|
, target_(_target)
|
||||||
, yOffset_(_yOffset)
|
|
||||||
{
|
{
|
||||||
QLayout *layout = new QVBoxLayout(this);
|
QLayout *layout = new QVBoxLayout(this);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
@@ -86,7 +85,7 @@ AttachedWindow *AttachedWindow::get(void *target, const GetArgs &args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *window = new AttachedWindow(target, args.yOffset);
|
auto *window = new AttachedWindow(target);
|
||||||
items.push_back(Item{target, window, args.winId});
|
items.push_back(Item{target, window, args.winId});
|
||||||
return window;
|
return window;
|
||||||
}();
|
}();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using ChannelPtr = std::shared_ptr<Channel>;
|
|||||||
|
|
||||||
class AttachedWindow : public QWidget
|
class AttachedWindow : public QWidget
|
||||||
{
|
{
|
||||||
AttachedWindow(void *_target, int _yOffset);
|
AttachedWindow(void *_target);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct GetArgs {
|
struct GetArgs {
|
||||||
@@ -60,8 +60,6 @@ private:
|
|||||||
void updateWindowRect(void *attached);
|
void updateWindowRect(void *attached);
|
||||||
|
|
||||||
void *target_;
|
void *target_;
|
||||||
int yOffset_;
|
|
||||||
int currentYOffset_{};
|
|
||||||
double x_ = -1;
|
double x_ = -1;
|
||||||
double pixelRatio_ = -1;
|
double pixelRatio_ = -1;
|
||||||
int width_ = 360;
|
int width_ = 360;
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ private:
|
|||||||
std::vector<QLayoutItem *> itemList_;
|
std::vector<QLayoutItem *> itemList_;
|
||||||
int hSpace_ = -1;
|
int hSpace_ = -1;
|
||||||
int vSpace_ = -1;
|
int vSpace_ = -1;
|
||||||
int lineSpacing_ = -1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
#include "widgets/settingspages/SettingsPage.hpp"
|
#include "widgets/settingspages/SettingsPage.hpp"
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
class AccountSwitchWidget;
|
class AccountSwitchWidget;
|
||||||
@@ -12,11 +10,6 @@ class AccountsPage : public SettingsPage
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AccountsPage();
|
AccountsPage();
|
||||||
|
|
||||||
private:
|
|
||||||
QPushButton *addButton_{};
|
|
||||||
QPushButton *removeButton_{};
|
|
||||||
AccountSwitchWidget *accountSwitchWidget_{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
@@ -389,6 +389,9 @@ void HighlightingPage::tableCellClicked(const QModelIndex &clicked,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case HighlightTab::Blacklist:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -371,8 +371,7 @@ SettingWidget *SettingWidget::dropdown(
|
|||||||
widget->managedConnections);
|
widget->managedConnections);
|
||||||
|
|
||||||
QObject::connect(combo, &QComboBox::currentTextChanged,
|
QObject::connect(combo, &QComboBox::currentTextChanged,
|
||||||
[label, combo, &setting](const auto &newText) {
|
[label, combo, &setting](const auto & /*newText*/) {
|
||||||
bool ok = true;
|
|
||||||
auto stringValue = combo->currentData().toString();
|
auto stringValue = combo->currentData().toString();
|
||||||
|
|
||||||
setting.setValue(stringValue);
|
setting.setValue(stringValue);
|
||||||
|
|||||||
@@ -638,6 +638,8 @@ void SplitContainer::paintSplitBorder(Node *node, QPainter *painter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Node::Type::EmptyRoot:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1481,6 +1483,8 @@ void SplitContainer::Node::layout(bool addSpacing, float _scale,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Node::Type::EmptyRoot:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -353,7 +353,6 @@ void SplitHeader::initializeLayout()
|
|||||||
QObject::connect(
|
QObject::connect(
|
||||||
this->moderationButton_, &Button::clicked, this,
|
this->moderationButton_, &Button::clicked, this,
|
||||||
[this](Qt::MouseButton button) mutable {
|
[this](Qt::MouseButton button) mutable {
|
||||||
auto *w = this->moderationButton_;
|
|
||||||
switch (button)
|
switch (button)
|
||||||
{
|
{
|
||||||
case Qt::LeftButton:
|
case Qt::LeftButton:
|
||||||
@@ -378,6 +377,9 @@ void SplitHeader::initializeLayout()
|
|||||||
getApp()->getWindows()->showSettingsDialog(
|
getApp()->getWindows()->showSettingsDialog(
|
||||||
this, SettingsDialogPreference::ModerationActions);
|
this, SettingsDialogPreference::ModerationActions);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -258,7 +258,6 @@ void SplitInput::triggerSelfMessageReceived()
|
|||||||
|
|
||||||
void SplitInput::scaleChangedEvent(float scale)
|
void SplitInput::scaleChangedEvent(float scale)
|
||||||
{
|
{
|
||||||
auto *app = getApp();
|
|
||||||
// update the icon size of the buttons
|
// update the icon size of the buttons
|
||||||
this->updateEmoteButton();
|
this->updateEmoteButton();
|
||||||
this->updateCancelReplyButton();
|
this->updateCancelReplyButton();
|
||||||
|
|||||||
Reference in New Issue
Block a user