# HG changeset patch # User Paper # Date 1695330943 14400 # Node ID 9ae9365dd4eae3253993c03c1e1f382671ed88ee # Parent 2743011a604247346a27d74f9180dff134b18e1d window.cpp: fix sidebar on Linux diff -r 2743011a6042 -r 9ae9365dd4ea src/gui/pages/statistics.cpp --- 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()) diff -r 2743011a6042 -r 9ae9365dd4ea src/gui/sidebar.cpp --- 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 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)); }); } diff -r 2743011a6042 -r 9ae9365dd4ea src/gui/window.cpp --- 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);