refactor: Make Account & Settings buttons SVGs (#6267)

instead of rendering the icons directly in Chatterino, they're now SVGs

This has the following consequences:
1. The color does _not_ respect your custom theme. For most users, this
   will not be a problem/concern.
2. You can no longer drag a split onto those buttons to create a new tab
This commit is contained in:
pajlada
2025-06-14 22:28:17 +02:00
committed by GitHub
parent 20b92ea0ca
commit 6398570bcc
8 changed files with 89 additions and 50 deletions
-42
View File
@@ -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:;
}
}
+4 -1
View File
@@ -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);