changeset 37:9ae9365dd4ea

window.cpp: fix sidebar on Linux
author Paper <mrpapersonic@gmail.com>
date Thu, 21 Sep 2023 17:15:43 -0400
parents 2743011a6042
children 1a34fd7469b9
files src/gui/pages/statistics.cpp src/gui/sidebar.cpp src/gui/window.cpp
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui/pages/statistics.cpp	Thu Sep 21 15:17:47 2023 -0400
+++ b/src/gui/pages/statistics.cpp	Thu Sep 21 17:15:43 2023 -0400
@@ -17,6 +17,10 @@
 	setFrameShape(QFrame::Panel);
 	setFrameShadow(QFrame::Sunken);
 
+	QPalette pal = QPalette();
+	setAutoFillBackground(true);
+	setPalette(pal);
+
 	UiUtils::LabelledTextParagraph* anime_list_paragraph = new UiUtils::LabelledTextParagraph(
 	    "Anime list",
 	    "Anime count:\nEpisode count:\nTime spent watching:\nTime to complete:\nAverage score:\nScore deviation:", "\n\n\n\n\n",
@@ -31,11 +35,6 @@
 	layout()->addWidget(application_paragraph);
 	((QBoxLayout*)layout())->addStretch();
 
-	QPalette pal = QPalette();
-	pal.setColor(QPalette::Window, Qt::white);
-	setAutoFillBackground(true);
-	setPalette(pal);
-
 	QTimer* timer = new QTimer(this);
 	connect(timer, &QTimer::timeout, this, [this] {
 		if (isVisible())
--- a/src/gui/sidebar.cpp	Thu Sep 21 15:17:47 2023 -0400
+++ b/src/gui/sidebar.cpp	Thu Sep 21 17:15:43 2023 -0400
@@ -6,7 +6,6 @@
 #include <QMouseEvent>
 
 SideBar::SideBar(QWidget* parent) : QListWidget(parent) {
-	setObjectName("sidebar");
 	setFrameShape(QFrame::NoFrame);
 	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -14,9 +13,11 @@
 	setSelectionBehavior(QAbstractItemView::SelectItems);
 	setMouseTracking(true);
 	viewport()->setAutoFillBackground(false);
+
 	QFont font;
 	font.setPointSize(9);
 	setFont(font);
+
 	connect(this, &QListWidget::currentRowChanged, this,
 	        [this](int index) { emit CurrentItemChanged(RemoveSeparatorsFromIndex(index)); });
 }
--- a/src/gui/window.cpp	Thu Sep 21 15:17:47 2023 -0400
+++ b/src/gui/window.cpp	Thu Sep 21 17:15:43 2023 -0400
@@ -125,7 +125,7 @@
 	setMenuBar(menubar);
 
 	QHBoxLayout* layout = new QHBoxLayout(main_widget);
-	layout->addWidget(sidebar, 0, Qt::AlignLeft | Qt::AlignTop);
+	layout->addWidget(sidebar);
 	layout->addWidget(stack);
 	setCentralWidget(main_widget);