MCPcopy Create free account
hub / github.com/YACReader/yacreader / YACReaderSideBar

Method YACReaderSideBar

custom_widgets/yacreader_sidebar.cpp:13–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <QPainter>
12
13YACReaderSideBar::YACReaderSideBar(QWidget *parent)
14 : QWidget(parent)
15{
16 setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
17
18 settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); // TODO unificar la creación del fichero de config con el servidor
19 settings->beginGroup("libraryConfig");
20
21 // widgets
22 foldersView = new YACReaderFoldersView;
23 readingListsView = new YACReaderReadingListsView;
24 selectedLibrary = new YACReaderLibraryListWidget;
25
26 // Titles will be set from theme in applyTheme
27 librariesTitle = new YACReaderTitledToolBar("");
28 foldersTitle = new YACReaderTitledToolBar("");
29 readingListsTitle = new YACReaderTitledToolBar("");
30
31 splitter = new QSplitter(this);
32 splitter->setOrientation(Qt::Vertical);
33
34 selectedLibrary->setContextMenuPolicy(Qt::ActionsContextMenu);
35 selectedLibrary->setAttribute(Qt::WA_MacShowFocusRect, false);
36 selectedLibrary->setFocusPolicy(Qt::NoFocus);
37
38 // layout
39 QVBoxLayout *l = new QVBoxLayout;
40
41 l->setContentsMargins(0, 0, 0, 0);
42
43 // LIBRARIES-------------------------------------------------------
44 l->addSpacing(5);
45
46 l->addWidget(librariesTitle);
47
48 l->addSpacing(4);
49 auto sep1 = new YACReaderSideBarSeparator(this);
50 separators.append(sep1);
51 l->addWidget(sep1);
52 l->addSpacing(3);
53
54 l->addWidget(selectedLibrary);
55 l->addSpacing(11);
56
57 // END LIBRARIES---------------------------------------------------
58
59 // FOLDERS---------------------------------------------------------
60 QWidget *foldersContainer = new QWidget(this);
61 QVBoxLayout *foldersLayout = new QVBoxLayout;
62 foldersLayout->setContentsMargins(0, 0, 0, 0);
63 foldersLayout->setSpacing(0);
64
65 auto sep2 = new YACReaderSideBarSeparator(this);
66 separators.append(sep2);
67 foldersLayout->addWidget(sep2);
68 foldersLayout->addSpacing(4);
69
70 foldersLayout->addWidget(foldersTitle);

Callers

nothing calls this directly

Calls 2

addSpacingMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected