diff src/gui/sidebar.cpp @ 36:2743011a6042

*: mass update formatted all source files, converted ALL instances of setStyleSheet() to palettes and fonts (stylesheets suck), and I changed the clang-format file because it wasn't working on my laptop for some reason.
author Paper <mrpapersonic@gmail.com>
date Thu, 21 Sep 2023 15:17:47 -0400
parents cde8f67a7c7d
children 9ae9365dd4ea
line wrap: on
line diff
--- a/src/gui/sidebar.cpp	Thu Sep 21 11:43:24 2023 -0400
+++ b/src/gui/sidebar.cpp	Thu Sep 21 15:17:47 2023 -0400
@@ -14,7 +14,9 @@
 	setSelectionBehavior(QAbstractItemView::SelectItems);
 	setMouseTracking(true);
 	viewport()->setAutoFillBackground(false);
-	setStyleSheet("font-size: 12px");
+	QFont font;
+	font.setPointSize(9);
+	setFont(font);
 	connect(this, &QListWidget::currentRowChanged, this,
 	        [this](int index) { emit CurrentItemChanged(RemoveSeparatorsFromIndex(index)); });
 }
@@ -37,12 +39,16 @@
 
 QListWidgetItem* SideBar::AddSeparator() {
 	QListWidgetItem* item = new QListWidgetItem(this);
-	setStyleSheet("QListWidget::item:disabled {background: transparent;}");
 	QFrame* line = new QFrame(this);
 	line->setFrameShape(QFrame::HLine);
 	line->setFrameShadow(QFrame::Sunken);
 	line->setMouseTracking(true);
 	line->setEnabled(false);
+
+	QPalette pal;
+	pal.setColor(QPalette::Window, QColor(0, 0, 0, 0));
+	line->setPalette(pal);
+
 	setItemWidget(item, line);
 	item->setFlags(Qt::NoItemFlags);
 	return item;
@@ -61,8 +67,7 @@
 	return !(index.isValid() && index.flags() & Qt::ItemIsEnabled);
 }
 
-QItemSelectionModel::SelectionFlags SideBar::selectionCommand(const QModelIndex& index,
-                                                              const QEvent*) const {
+QItemSelectionModel::SelectionFlags SideBar::selectionCommand(const QModelIndex& index, const QEvent*) const {
 	if (IndexIsSeparator(index))
 		return QItemSelectionModel::NoUpdate;
 	return QItemSelectionModel::ClearAndSelect;