diff src/gui/widgets/sidebar.cc @ 294:99cbc51433e4

*: cleanup uses of QPalette I didn't know about setBackgroundRole() which is very useful in 99% of the cases where I even needed to edit the palette
author Paper <paper@paper.us.eu.org>
date Sun, 12 May 2024 18:16:08 -0400
parents 9a88e1725fd2
children 91ac90a34003
line wrap: on
line diff
--- a/src/gui/widgets/sidebar.cc	Sun May 12 18:06:44 2024 -0400
+++ b/src/gui/widgets/sidebar.cc	Sun May 12 18:16:08 2024 -0400
@@ -14,7 +14,7 @@
 	/* FIXME: is there an easy way to do this with palettes? */
 	setStyleSheet("QListWidget::item:disabled { background: transparent }");
 
-	SetBackgroundColor(Qt::transparent);
+	SetBackgroundTransparent(true);
 
 	connect(this, &QListWidget::currentRowChanged, this,
 	        [this](int index) { emit CurrentItemChanged(RemoveSeparatorsFromIndex(index)); });
@@ -28,8 +28,8 @@
 	return RemoveSeparatorsFromIndex(currentRow());
 }
 
-void SideBar::SetBackgroundColor(QColor color) {
-	viewport()->setAutoFillBackground(color != Qt::transparent);
+void SideBar::SetBackgroundTransparent(bool yes) {
+	viewport()->setAutoFillBackground(!yes);
 }
 
 QListWidgetItem* SideBar::AddItem(QString name, QIcon icon) {