12QWidget* GTree::right_widget() {
14 auto* container =
new QWidget(
this);
15 auto* vlayout =
new QVBoxLayout(container);
16 vlayout->setContentsMargins(0, 0, 0, 0);
17 vlayout->setSpacing(4);
20 std::vector<std::string> bicons;
21 bicons.push_back(
":/gtree/images/wireframe");
22 bicons.push_back(
":/gtree/images/surface");
23 bicons.push_back(
":/gtree/images/cloud");
24 bicons.push_back(
":/gtree/images/centre");
26 styleButtons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
27 vlayout->addWidget(styleButtons);
30 bottomPanel =
new QWidget(container);
31 auto* blayout =
new QVBoxLayout(bottomPanel);
32 blayout->setContentsMargins(0, 0, 0, 0);
33 blayout->setSpacing(2);
36 auto* opacityContainer =
new QWidget(bottomPanel);
37 auto* opacityLayout =
new QHBoxLayout(opacityContainer);
38 opacityLayout->setContentsMargins(0, 0, 0, 0);
40 auto* label =
new QLabel(tr(
"Opacity:"), opacityContainer);
41 opacityLabel =
new QLabel(tr(
"1.00"), opacityContainer);
43 opacitySlider =
new QSlider(Qt::Horizontal, opacityContainer);
44 opacitySlider->setRange(0, 100);
45 opacitySlider->setValue(100);
46 opacitySlider->setSingleStep(5);
47 opacitySlider->setPageStep(10);
49 opacityLayout->addWidget(label);
50 opacityLayout->addWidget(opacitySlider);
51 opacityLayout->addWidget(opacityLabel);
53 blayout->addWidget(opacityContainer);
54 blayout->addSpacing(4);
57 typeLabel =
new QLabel(bottomPanel);
58 daughtersLabel =
new QLabel(bottomPanel);
59 nameLabel =
new QLabel(bottomPanel);
60 materialLabel =
new QLabel(bottomPanel);
61 massLabel =
new QLabel(bottomPanel);
62 volumeLabel =
new QLabel(bottomPanel);
63 densityLabel =
new QLabel(bottomPanel);
64 solidTypeLabel =
new QLabel(bottomPanel);
65 positionLabel =
new QLabel(bottomPanel);
66 rotationLabel =
new QLabel(bottomPanel);
67 motherLabel =
new QLabel(bottomPanel);
68 descriptionLabel =
new QLabel(bottomPanel);
69 descriptionLabel->setWordWrap(
true);
73 parametersLabel =
new QTextEdit(bottomPanel);
74 parametersLabel->setReadOnly(
true);
75 parametersLabel->setFrameShape(QFrame::NoFrame);
76 parametersLabel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
77 parametersLabel->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
78 parametersLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
79 parametersLabel->setStyleSheet(
80 "QTextEdit { background-color: rgba(255,255,255,30); border: 1px solid black; border-radius: 4px; padding: 3px; }");
82 blayout->addWidget(typeLabel);
83 blayout->addWidget(daughtersLabel);
84 blayout->addWidget(nameLabel);
85 blayout->addWidget(materialLabel);
86 blayout->addWidget(massLabel);
87 blayout->addWidget(volumeLabel);
88 blayout->addWidget(densityLabel);
89 blayout->addSpacing(6);
90 blayout->addWidget(solidTypeLabel);
91 blayout->addWidget(parametersLabel, 1);
92 blayout->addWidget(positionLabel);
93 blayout->addWidget(rotationLabel);
94 blayout->addWidget(motherLabel);
95 blayout->addWidget(descriptionLabel);
96 blayout->addStretch();
99 blayout->addSpacing(10);
100 inspectButton =
new QPushButton(bottomPanel);
101 inspectButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
102 inspectButton->setStyleSheet(
103 "QPushButton { border: 2px solid black; border-radius: 4px; padding: 4px 8px; }"
104 "QPushButton:hover { background-color: palette(highlight); color: palette(highlighted-text); }"
106 connect(inspectButton, &QPushButton::clicked,
this, >ree::inspectVolume);
107 blayout->addWidget(inspectButton);
110 blayout->addSpacing(4);
111 drawOverlapsButton =
new QPushButton(bottomPanel);
112 drawOverlapsButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
113 drawOverlapsButton->setStyleSheet(
114 "QPushButton { border: 2px solid black; border-radius: 4px; padding: 4px 8px; }"
115 "QPushButton:hover { background-color: palette(highlight); color: palette(highlighted-text); }"
117 connect(drawOverlapsButton, &QPushButton::clicked,
this, >ree::drawOverlapsWarning);
118 blayout->addWidget(drawOverlapsButton);
121 bottomPanel->setVisible(
false);
123 vlayout->addWidget(bottomPanel, 1);