Add settings for last message line style (#2019)
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
- Minor: Changed the English in two rate-limited system messages (#1878)
|
- Minor: Changed the English in two rate-limited system messages (#1878)
|
||||||
- Minor: Added image for streamer mode in the user popup icon.
|
- Minor: Added image for streamer mode in the user popup icon.
|
||||||
- Minor: Added vip and unvip buttons.
|
- Minor: Added vip and unvip buttons.
|
||||||
|
- Minor: Added settings for displaying where the last message was.
|
||||||
- Minor: Commands are now saved upon pressing Ok in the settings window
|
- Minor: Commands are now saved upon pressing Ok in the settings window
|
||||||
- Minor: Colorized nicknames now enabled by default
|
- Minor: Colorized nicknames now enabled by default
|
||||||
- Minor: Show channels live now enabled by default
|
- Minor: Show channels live now enabled by default
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ public:
|
|||||||
"h:mm"};
|
"h:mm"};
|
||||||
BoolSetting showLastMessageIndicator = {
|
BoolSetting showLastMessageIndicator = {
|
||||||
"/appearance/messages/showLastMessageIndicator", false};
|
"/appearance/messages/showLastMessageIndicator", false};
|
||||||
IntSetting lastMessagePattern = {"/appearance/messages/lastMessagePattern",
|
EnumSetting<Qt::BrushStyle> lastMessagePattern = {
|
||||||
Qt::VerPattern};
|
"/appearance/messages/lastMessagePattern", Qt::VerPattern};
|
||||||
QStringSetting lastMessageColor = {"/appearance/messages/lastMessageColor",
|
QStringSetting lastMessageColor = {"/appearance/messages/lastMessageColor",
|
||||||
""};
|
""};
|
||||||
BoolSetting showEmptyInput = {"/appearance/showEmptyInputBox", true};
|
BoolSetting showEmptyInput = {"/appearance/showEmptyInputBox", true};
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
#include "util/Helpers.hpp"
|
#include "util/Helpers.hpp"
|
||||||
#include "util/IncognitoBrowser.hpp"
|
#include "util/IncognitoBrowser.hpp"
|
||||||
#include "widgets/BaseWindow.hpp"
|
#include "widgets/BaseWindow.hpp"
|
||||||
|
#include "widgets/dialogs/ColorPickerDialog.hpp"
|
||||||
|
#include "widgets/helper/ColorButton.hpp"
|
||||||
#include "widgets/helper/Line.hpp"
|
#include "widgets/helper/Line.hpp"
|
||||||
|
|
||||||
#define CHROME_EXTENSION_LINK \
|
#define CHROME_EXTENSION_LINK \
|
||||||
@@ -159,6 +161,36 @@ ComboBox *SettingsLayout::addDropdown(
|
|||||||
return combo;
|
return combo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColorButton *SettingsLayout::addColorButton(
|
||||||
|
const QString &text, const QColor &color,
|
||||||
|
pajlada::Settings::Setting<QString> &setting)
|
||||||
|
{
|
||||||
|
auto colorButton = new ColorButton(color);
|
||||||
|
auto layout = new QHBoxLayout();
|
||||||
|
auto label = new QLabel(text + ":");
|
||||||
|
layout->addWidget(label);
|
||||||
|
layout->addStretch(1);
|
||||||
|
layout->addWidget(colorButton);
|
||||||
|
this->addLayout(layout);
|
||||||
|
QObject::connect(
|
||||||
|
colorButton, &ColorButton::clicked, [&setting, colorButton]() {
|
||||||
|
auto dialog = new ColorPickerDialog(QColor(setting));
|
||||||
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
dialog->show();
|
||||||
|
dialog->closed.connect([&setting, colorButton, &dialog] {
|
||||||
|
QColor selected = dialog->selectedColor();
|
||||||
|
|
||||||
|
if (selected.isValid())
|
||||||
|
{
|
||||||
|
setting = selected.name(QColor::HexArgb);
|
||||||
|
colorButton->setColor(selected);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return colorButton;
|
||||||
|
}
|
||||||
|
|
||||||
DescriptionLabel *SettingsLayout::addDescription(const QString &text)
|
DescriptionLabel *SettingsLayout::addDescription(const QString &text)
|
||||||
{
|
{
|
||||||
auto label = new DescriptionLabel(text);
|
auto label = new DescriptionLabel(text);
|
||||||
@@ -384,9 +416,34 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
|||||||
layout.addTitle("Messages");
|
layout.addTitle("Messages");
|
||||||
layout.addCheckbox("Separate with lines", s.separateMessages);
|
layout.addCheckbox("Separate with lines", s.separateMessages);
|
||||||
layout.addCheckbox("Alternate background color", s.alternateMessages);
|
layout.addCheckbox("Alternate background color", s.alternateMessages);
|
||||||
// layout.addCheckbox("Mark last message you read");
|
|
||||||
// layout.addDropdown("Last read message style", {"Default"});
|
|
||||||
layout.addCheckbox("Show deleted messages", s.hideModerated, true);
|
layout.addCheckbox("Show deleted messages", s.hideModerated, true);
|
||||||
|
layout.addCheckbox("Show last message line", s.showLastMessageIndicator);
|
||||||
|
layout.addDropdown<std::underlying_type<Qt::BrushStyle>::type>(
|
||||||
|
"Last message line style", {"Dotted", "Solid"}, s.lastMessagePattern,
|
||||||
|
[](int value) {
|
||||||
|
switch (value)
|
||||||
|
{
|
||||||
|
case Qt::VerPattern:
|
||||||
|
return 0;
|
||||||
|
case Qt::SolidPattern:
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[](DropdownArgs args) {
|
||||||
|
switch (args.index)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return Qt::VerPattern;
|
||||||
|
case 1:
|
||||||
|
default:
|
||||||
|
return Qt::SolidPattern;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
false);
|
||||||
|
layout.addColorButton("Last message line color",
|
||||||
|
QColor(getSettings()->lastMessageColor.getValue()),
|
||||||
|
getSettings()->lastMessageColor);
|
||||||
layout.addCheckbox("Highlight messages redeemed with Channel Points",
|
layout.addCheckbox("Highlight messages redeemed with Channel Points",
|
||||||
s.enableRedeemedHighlight);
|
s.enableRedeemedHighlight);
|
||||||
layout.addDropdown<QString>(
|
layout.addDropdown<QString>(
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "pajlada/signals/signal.hpp"
|
#include "pajlada/signals/signal.hpp"
|
||||||
#include "singletons/Settings.hpp"
|
#include "singletons/Settings.hpp"
|
||||||
#include "singletons/WindowManager.hpp"
|
#include "singletons/WindowManager.hpp"
|
||||||
|
#include "widgets/helper/ColorButton.hpp"
|
||||||
#include "widgets/settingspages/SettingsPage.hpp"
|
#include "widgets/settingspages/SettingsPage.hpp"
|
||||||
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
@@ -72,6 +73,8 @@ public:
|
|||||||
ComboBox *addDropdown(const QString &text, const QStringList &items,
|
ComboBox *addDropdown(const QString &text, const QStringList &items,
|
||||||
pajlada::Settings::Setting<QString> &setting,
|
pajlada::Settings::Setting<QString> &setting,
|
||||||
bool editable = false);
|
bool editable = false);
|
||||||
|
ColorButton *addColorButton(const QString &text, const QColor &color,
|
||||||
|
pajlada::Settings::Setting<QString> &setting);
|
||||||
|
|
||||||
template <typename OnClick>
|
template <typename OnClick>
|
||||||
QPushButton *makeButton(const QString &text, OnClick onClick)
|
QPushButton *makeButton(const QString &text, OnClick onClick)
|
||||||
|
|||||||
Reference in New Issue
Block a user