diff src/gui/widgets/sidebar.cpp @ 73:f1fc8b04bc63

...: merge heads
author Paper <mrpapersonic@gmail.com>
date Tue, 03 Oct 2023 05:00:08 -0400
parents 5f9bdcea3d01
children 5ccb99bfa605
line wrap: on
line diff
--- a/src/gui/widgets/sidebar.cpp	Tue Oct 03 04:58:38 2023 -0400
+++ b/src/gui/widgets/sidebar.cpp	Tue Oct 03 05:00:08 2023 -0400
@@ -15,7 +15,8 @@
 	setMouseTracking(true);
 	/* FIXME: is there an easy way to do this with palettes? */
 	setStyleSheet("QListWidget::item:disabled { background: transparent }");
-	viewport()->setAutoFillBackground(false);
+
+	SetBackgroundColor(Qt::transparent);
 
 	QFont font;
 	font.setPointSize(9);
@@ -29,6 +30,13 @@
 	setCurrentRow(AddSeparatorsToIndex(index));
 }
 
+void SideBar::SetBackgroundColor(QColor color) {
+	viewport()->setAutoFillBackground(color != Qt::transparent);
+	QPalette pal(palette());
+	pal.setColor(QPalette::Window, color);
+	setPalette(pal);
+}
+
 QListWidgetItem* SideBar::AddItem(QString name, QIcon icon) {
 	QListWidgetItem* item = new QListWidgetItem(this);
 	item->setText(name);