diff --git a/src/messages/layouts/MessageLayout.cpp b/src/messages/layouts/MessageLayout.cpp index 772955fb..259da343 100644 --- a/src/messages/layouts/MessageLayout.cpp +++ b/src/messages/layouts/MessageLayout.cpp @@ -175,7 +175,8 @@ void MessageLayout::paint(QPainter &painter, int width, int y, int messageIndex, QColor color = isWindowFocused ? app->themes->tabs.selected.backgrounds.regular.color() : app->themes->tabs.selected.backgrounds.unfocused.color(); - QBrush brush(color, Qt::VerPattern); + QBrush brush(color, + static_cast(app->settings->lastMessagePattern.getValue())); painter.fillRect(0, y + this->container_.getHeight() - 1, pixmap->width(), 1, brush); } diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index c1f76934..315e8b60 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -27,6 +27,7 @@ public: QStringSetting timestampFormat = {"/appearance/messages/timestampFormat", "h:mm"}; BoolSetting showBadges = {"/appearance/messages/showBadges", true}; BoolSetting showLastMessageIndicator = {"/appearance/messages/showLastMessageIndicator", false}; + IntSetting lastMessagePattern = {"/appearance/messages/lastMessagePattern", Qt::VerPattern}; BoolSetting hideEmptyInput = {"/appearance/hideEmptyInputBox", false}; BoolSetting showMessageLength = {"/appearance/messages/showMessageLength", false}; BoolSetting separateMessages = {"/appearance/messages/separateMessages", false}; diff --git a/src/widgets/settingspages/AppearancePage.cpp b/src/widgets/settingspages/AppearancePage.cpp index 6f808c95..f82402ad 100644 --- a/src/widgets/settingspages/AppearancePage.cpp +++ b/src/widgets/settingspages/AppearancePage.cpp @@ -120,6 +120,15 @@ void AppearancePage::addMessagesGroup(QVBoxLayout &layout) combo->addItems( {"Never", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"}); + const auto currentIndex = []() -> int { + auto val = getSettings()->collpseMessagesMinLines.getValue(); + if (val > 0) { + --val; + } + return val; + }(); + combo->setCurrentIndex(currentIndex); + QObject::connect(combo, &QComboBox::currentTextChanged, [](const QString &str) { getSettings()->collpseMessagesMinLines = str.toInt(); }); diff --git a/src/widgets/settingspages/BehaviourPage.cpp b/src/widgets/settingspages/BehaviourPage.cpp index b3bf250d..621722ba 100644 --- a/src/widgets/settingspages/BehaviourPage.cpp +++ b/src/widgets/settingspages/BehaviourPage.cpp @@ -43,6 +43,43 @@ BehaviourPage::BehaviourPage() form->addRow("", this->createCheckBox("Show message length while typing", getSettings()->showMessageLength)); form->addRow("", this->createCheckBox(LAST_MSG, getSettings()->showLastMessageIndicator)); + { + auto *combo = new QComboBox(this); + combo->addItems({"Dotted", "Solid"}); + + const auto currentIndex = []() -> int { + switch (getApp()->settings->lastMessagePattern.getValue()) { + case Qt::SolidLine: { + return 1; + } + default: + case Qt::VerPattern: { + return 0; + } + } + }(); + combo->setCurrentIndex(currentIndex); + + QObject::connect(combo, + static_cast(&QComboBox::currentIndexChanged), + [](int index) { + Qt::BrushStyle brush; + switch (index) { + case 1: + brush = Qt::SolidPattern; + break; + default: + case 0: + brush = Qt::VerPattern; + break; + } + getSettings()->lastMessagePattern = brush; + }); + + auto hbox = form.emplace().withoutMargin(); + hbox.emplace("Last message indicator pattern"); + hbox.append(combo); + } form->addRow("Pause chat:", this->createCheckBox(PAUSE_HOVERING, app->settings->pauseChatHover));