Mercurial > minori
comparison src/gui/pages/statistics.cc @ 94:2f373d48f889
*: etc changes to graph stuff
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 01 Nov 2023 14:30:26 -0400 |
parents | d5efb81540b3 |
children | b315f3759c56 |
comparison
equal
deleted
inserted
replaced
93:d5efb81540b3 | 94:2f373d48f889 |
---|---|
26 _anime_list.reset(new TextWidgets::LabelledSection( | 26 _anime_list.reset(new TextWidgets::LabelledSection( |
27 tr("Anime list"), | 27 tr("Anime list"), |
28 tr("Anime count:\nEpisode count:\nTime spent watching:\nTime to complete:\nAverage score:\nScore deviation:"), | 28 tr("Anime count:\nEpisode count:\nTime spent watching:\nTime to complete:\nAverage score:\nScore deviation:"), |
29 "", this)); | 29 "", this)); |
30 | 30 |
31 /* spaghetti incoming */ | |
32 QWidget* score_dist_widget = new QWidget(this); | 31 QWidget* score_dist_widget = new QWidget(this); |
33 QVBoxLayout* score_dist_layout = new QVBoxLayout(score_dist_widget); | 32 QVBoxLayout* score_dist_layout = new QVBoxLayout(score_dist_widget); |
34 | 33 |
34 score_dist_layout->addWidget(new TextWidgets::Header(tr("Score distribution"), score_dist_widget)); | |
35 | |
36 /* I have to explain myself here: I hate this :). This makes a widget as a layer to create a margin, | |
37 similar to what I do in text.cc with sections. I hate it and it should really be put into a separate | |
38 class, but whatever. */ | |
35 QWidget* content = new QWidget(score_dist_widget); | 39 QWidget* content = new QWidget(score_dist_widget); |
36 QVBoxLayout* content_layout = new QVBoxLayout(content); | 40 QVBoxLayout* content_layout = new QVBoxLayout(content); |
37 score_dist_layout->addWidget(new TextWidgets::Header(tr("Score distribution"), content)); | |
38 _score_distribution_graph.reset(new Graph<int>(content)); | 41 _score_distribution_graph.reset(new Graph<int>(content)); |
39 content_layout->addWidget(_score_distribution_graph.get()); | 42 content_layout->addWidget(_score_distribution_graph.get()); |
40 content_layout->setContentsMargins(0, 0, 0, 0); | 43 content_layout->setContentsMargins(0, 0, 0, 0); |
41 content->setContentsMargins(12, 0, 0, 0); | 44 content->setContentsMargins(12, 0, 0, 0); |
42 | 45 |