fix: svgify chatters button (#6397)

This commit is contained in:
pajlada
2025-08-17 23:08:30 +02:00
committed by GitHub
parent dcae8e67cc
commit a7d7668f71
7 changed files with 19 additions and 16 deletions
+1
View File
@@ -94,6 +94,7 @@
- Dev: Refactored `Button` and friends. (#6102, #6255, #6266, #6302, #6268, #6334, #6371, #6372)
- Dev: Made "add split" button (part of the split header) a natively rendered button. (#6349)
- Dev: Made Settings & Account button on Linux/macOS SVGs. (#6267)
- Dev: Made "Chatters" button an SVG. (#6397)
- Dev: Made user card "pin" button SVGs. (#6399)
- Dev: Some more setting widget refactors. (#6317)
- Dev: Emoji style / set is now stored lowercase (and matched case-insensitively). Changing emoji style from this point on and then running an old version might mean you will use the Twitter emoji style by default. (#6300)
+1
View File
@@ -0,0 +1 @@
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 13.999 13 14a2 2 0 0 1 1.995 1.85L15 16v1.5C14.999 21 11.284 22 8.5 22c-2.722 0-6.335-.956-6.495-4.27L2 17.5v-1.501c0-1.054.816-1.918 1.85-1.995L4 14ZM15.22 14H20c1.054 0 1.918.816 1.994 1.85L22 16v1c-.001 3.062-2.858 4-5 4a7.16 7.16 0 0 1-2.14-.322c.336-.386.607-.827.802-1.327A6.19 6.19 0 0 0 17 19.5l.267-.006c.985-.043 3.086-.363 3.226-2.289L20.5 17v-1a.501.501 0 0 0-.41-.492L20 15.5h-4.051a2.957 2.957 0 0 0-.595-1.34L15.22 14H20h-4.78ZM4 15.499l-.1.01a.51.51 0 0 0-.254.136.506.506 0 0 0-.136.253l-.01.101V17.5c0 1.009.45 1.722 1.417 2.242.826.445 2.003.714 3.266.753l.317.005.317-.005c1.263-.039 2.439-.308 3.266-.753.906-.488 1.359-1.145 1.412-2.057l.005-.186V16a.501.501 0 0 0-.41-.492L13 15.5l-9-.001ZM8.5 3a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm9 2a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm-9-.5c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3Zm9 2c-1.103 0-2 .897-2 2s.897 2 2 2 2-.897 2-2-.897-2-2-2Z" fill="#c0c0c0"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

+1
View File
@@ -0,0 +1 @@
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 13.999 13 14a2 2 0 0 1 1.995 1.85L15 16v1.5C14.999 21 11.284 22 8.5 22c-2.722 0-6.335-.956-6.495-4.27L2 17.5v-1.501c0-1.054.816-1.918 1.85-1.995L4 14ZM15.22 14H20c1.054 0 1.918.816 1.994 1.85L22 16v1c-.001 3.062-2.858 4-5 4a7.16 7.16 0 0 1-2.14-.322c.336-.386.607-.827.802-1.327A6.19 6.19 0 0 0 17 19.5l.267-.006c.985-.043 3.086-.363 3.226-2.289L20.5 17v-1a.501.501 0 0 0-.41-.492L20 15.5h-4.051a2.957 2.957 0 0 0-.595-1.34L15.22 14H20h-4.78ZM4 15.499l-.1.01a.51.51 0 0 0-.254.136.506.506 0 0 0-.136.253l-.01.101V17.5c0 1.009.45 1.722 1.417 2.242.826.445 2.003.714 3.266.753l.317.005.317-.005c1.263-.039 2.439-.308 3.266-.753.906-.488 1.359-1.145 1.412-2.057l.005-.186V16a.501.501 0 0 0-.41-.492L13 15.5l-9-.001ZM8.5 3a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm9 2a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm-9-.5c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3Zm9 2c-1.103 0-2 .897-2 2s.897 2 2 2 2-.897 2-2-.897-2-2-2Z" fill="#424242"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 B

+14 -15
View File
@@ -23,6 +23,7 @@
#include "widgets/buttons/DrawnButton.hpp"
#include "widgets/buttons/LabelButton.hpp"
#include "widgets/buttons/PixmapButton.hpp"
#include "widgets/buttons/SvgButton.hpp"
#include "widgets/dialogs/SettingsDialog.hpp"
#include "widgets/helper/CommonTexts.hpp"
#include "widgets/Label.hpp"
@@ -289,6 +290,13 @@ void SplitHeader::initializeLayout()
{
assert(this->layout() == nullptr);
this->chattersButton_ = new SvgButton(
{
.dark = ":/buttons/chatters-darkMode.svg",
.light = ":/buttons/chatters-lightMode.svg",
},
this, {4, 4});
this->addButton_ = new DrawnButton(DrawnButton::Symbol::Plus,
{
.padding = 3,
@@ -365,17 +373,18 @@ void SplitHeader::initializeLayout()
});
}),
// chatter list
this->chattersButton_ = makeWidget<PixmapButton>([&](auto w) {
QObject::connect(w, &Button::leftClicked, this, [this]() {
this->split_->openChatterList();
});
}),
this->chattersButton_,
// dropdown
this->dropdownButton_,
// add split
this->addButton_,
});
QObject::connect(this->chattersButton_, &Button::leftClicked, this,
[this]() {
this->split_->openChatterList();
});
QObject::connect(this->addButton_, &Button::leftClicked, this, [this]() {
this->split_->addSibling();
});
@@ -1085,16 +1094,6 @@ void SplitHeader::themeChangedEvent()
.backgroundHover = this->theme->messages.backgrounds.regular,
});
// --
if (this->theme->isLightTheme())
{
this->chattersButton_->setPixmap(getResources().buttons.chattersDark);
}
else
{
this->chattersButton_->setPixmap(getResources().buttons.chattersLight);
}
this->update();
}
+2 -1
View File
@@ -16,6 +16,7 @@
namespace chatterino {
class SvgButton;
class DrawnButton;
class PixmapButton;
class LabelButton;
@@ -87,7 +88,7 @@ private:
QAction *modeActionSetFollowers{};
PixmapButton *moderationButton_{};
PixmapButton *chattersButton_{};
SvgButton *chattersButton_{};
DrawnButton *addButton_{};
// states