diff --git a/CHANGELOG.md b/CHANGELOG.md
index 27b1d827..3eb736da 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -55,6 +55,7 @@
- Dev: Fixed incorrect lua generation of static methods for typescript plugins. (#6190, #6223)
- Dev: Merged top/bottom and left/right notebook layouts. (#6215)
- Dev: Refactored `Button` and friends. (#6102, #6255)
+- Dev: Made Settings & Account button on Linux/macOS SVGs. (#6267)
- Dev: `OnceFlag`'s internal flag is now atomic. (#6237)
- Dev: Bumped clang-format requirement to 19. (#6236)
diff --git a/resources/buttons/account-darkMode.svg b/resources/buttons/account-darkMode.svg
new file mode 100644
index 00000000..521b98cf
--- /dev/null
+++ b/resources/buttons/account-darkMode.svg
@@ -0,0 +1,17 @@
+
+
diff --git a/resources/buttons/account-lightMode.svg b/resources/buttons/account-lightMode.svg
new file mode 100644
index 00000000..e7a19d67
--- /dev/null
+++ b/resources/buttons/account-lightMode.svg
@@ -0,0 +1,17 @@
+
+
diff --git a/resources/buttons/settings-darkMode.svg b/resources/buttons/settings-darkMode.svg
new file mode 100644
index 00000000..190cc4bf
--- /dev/null
+++ b/resources/buttons/settings-darkMode.svg
@@ -0,0 +1,17 @@
+
+
diff --git a/resources/buttons/settings-lightMode.svg b/resources/buttons/settings-lightMode.svg
new file mode 100644
index 00000000..6a0ee668
--- /dev/null
+++ b/resources/buttons/settings-lightMode.svg
@@ -0,0 +1,17 @@
+
+
diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp
index f6b442c1..ee3c3f27 100644
--- a/src/widgets/Notebook.cpp
+++ b/src/widgets/Notebook.cpp
@@ -13,6 +13,7 @@
#include "widgets/buttons/InitUpdateButton.hpp"
#include "widgets/buttons/NotebookButton.hpp"
#include "widgets/buttons/PixmapButton.hpp"
+#include "widgets/buttons/SvgButton.hpp"
#include "widgets/dialogs/SettingsDialog.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/helper/NotebookTab.hpp"
@@ -1407,7 +1408,12 @@ void SplitNotebook::showEvent(QShowEvent * /*event*/)
void SplitNotebook::addCustomButtons()
{
// settings
- auto *settingsBtn = this->addCustomButton();
+ auto *settingsBtn = this->addCustomButton(SvgButton::Src{
+ .dark = ":/buttons/settings-darkMode.svg",
+ .light = ":/buttons/settings-lightMode.svg",
+ });
+
+ settingsBtn->setPadding({0, 0});
// This is to ensure you can't lock yourself out of the settings
if (getApp()->getArgs().safeMode)
@@ -1426,14 +1432,18 @@ void SplitNotebook::addCustomButtons()
this->signalHolder_);
}
- settingsBtn->setIcon(NotebookButton::Settings);
-
- QObject::connect(settingsBtn, &NotebookButton::leftClicked, [this] {
+ QObject::connect(settingsBtn, &Button::leftClicked, [this] {
getApp()->getWindows()->showSettingsDialog(this);
});
// account
- auto *userBtn = this->addCustomButton();
+ auto *userBtn = this->addCustomButton(SvgButton::Src{
+ .dark = ":/buttons/account-darkMode.svg",
+ .light = ":/buttons/account-lightMode.svg",
+ });
+
+ userBtn->setPadding({0, 0});
+
userBtn->setVisible(!getSettings()->hideUserButton.getValue());
getSettings()->hideUserButton.connect(
[userBtn](bool hide, auto) {
@@ -1441,8 +1451,7 @@ void SplitNotebook::addCustomButtons()
},
this->signalHolder_);
- userBtn->setIcon(NotebookButton::User);
- QObject::connect(userBtn, &NotebookButton::leftClicked, [this, userBtn] {
+ QObject::connect(userBtn, &Button::leftClicked, [this, userBtn] {
getApp()->getWindows()->showAccountSelectPopup(
this->mapToGlobal(userBtn->rect().bottomRight()));
});
diff --git a/src/widgets/buttons/NotebookButton.cpp b/src/widgets/buttons/NotebookButton.cpp
index b5304f3a..345aa57a 100644
--- a/src/widgets/buttons/NotebookButton.cpp
+++ b/src/widgets/buttons/NotebookButton.cpp
@@ -89,48 +89,6 @@ void NotebookButton::paintContent(QPainter &painter)
}
break;
- case User: {
- painter.setRenderHint(QPainter::Antialiasing);
-
- auto a = w / 8;
- QPainterPath path;
-
- path.arcMoveTo(a, 4 * a, 6 * a, 6 * a, 0);
- path.arcTo(a, 4 * a, 6 * a, 6 * a, 0, 180);
-
- QPainterPath remove;
- remove.addEllipse(2 * a, 1 * a, 4 * a, 4 * a);
- path = path.subtracted(remove);
-
- path.addEllipse(2.5 * a, 1.5 * a, 3 * a, 3 * a);
-
- painter.fillPath(path, foreground);
- }
- break;
-
- case Settings: {
- painter.setRenderHint(QPainter::Antialiasing);
-
- auto a = w / 8;
- QPainterPath path;
-
- path.arcMoveTo(a, a, 6 * a, 6 * a, 0 - (360 / 32.0));
-
- for (int i = 0; i < 8; i++)
- {
- path.arcTo(a, a, 6 * a, 6 * a, i * (360 / 8.0) - (360 / 32.0),
- (360 / 32.0));
- path.arcTo(2 * a, 2 * a, 4 * a, 4 * a,
- i * (360 / 8.0) + (360 / 32.0), (360 / 32.0));
- }
-
- QPainterPath remove;
- remove.addEllipse(3 * a, 3 * a, 2 * a, 2 * a);
-
- painter.fillPath(path.subtracted(remove), foreground);
- }
- break;
-
default:;
}
}
diff --git a/src/widgets/buttons/NotebookButton.hpp b/src/widgets/buttons/NotebookButton.hpp
index 306fe414..e7642368 100644
--- a/src/widgets/buttons/NotebookButton.hpp
+++ b/src/widgets/buttons/NotebookButton.hpp
@@ -13,7 +13,10 @@ class NotebookButton : public Button
Q_OBJECT
public:
- enum Icon { None, Plus, User, Settings };
+ enum Icon {
+ None,
+ Plus,
+ };
explicit NotebookButton(Notebook *parent);