comparison src/gui/widgets/sidebar.cc @ 252:a0eeb2cc7e6d

*: resolve make distcheck failures
author Paper <paper@paper.us.eu.org>
date Tue, 06 Feb 2024 02:24:49 -0500
parents c130f47f6f48
children 862d0d8619f6
comparison
equal deleted inserted replaced
251:4d635d3e168a 252:a0eeb2cc7e6d
1 #include "gui/widgets/sidebar.h" 1 #include "gui/widgets/sidebar.h"
2 #include <QFrame> 2 #include <QFrame>
3 #include <QListWidget> 3 #include <QListWidget>
4 #include <QListWidgetItem> 4 #include <QListWidgetItem>
5 #include <QMouseEvent> 5 #include <QMouseEvent>
6
7 #include <iostream>
8 6
9 SideBar::SideBar(QWidget* parent) : QListWidget(parent) { 7 SideBar::SideBar(QWidget* parent) : QListWidget(parent) {
10 setFrameShape(QFrame::NoFrame); 8 setFrameShape(QFrame::NoFrame);
11 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 9 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
12 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 10 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
67 item->setBackground(QBrush(Qt::transparent)); 65 item->setBackground(QBrush(Qt::transparent));
68 return item; 66 return item;
69 } 67 }
70 68
71 int SideBar::AddSeparatorsToIndex(int index) { 69 int SideBar::AddSeparatorsToIndex(int index) {
72 int i = 0, separators = 0, items = 0; 70 int separators = 0, items = 0;
73 71
74 for (; items <= index; ) { 72 for (; items <= index; ) {
75 if (IndexIsSeparator(indexFromItem(item(i++)))) { 73 if (IndexIsSeparator(indexFromItem(item(items + separators)))) {
76 separators++; 74 separators++;
77 } else { 75 } else {
78 items++; 76 items++;
79 } 77 }
80 } 78 }