MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / CreateLayout

Method CreateLayout

src/render_panel/ui/st_network_search.cpp:135–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 void StNetworkSearch::CreateLayout() {
136 setWindowTitle(tcTr("id_file_trans_search"));
137 auto settings = GrSettings::Instance();
138
139 auto item_width = 600;
140
141 auto delegate = new NtSearchItemDelegate(this);
142 list_widget_ = new QListWidget(this);
143 list_widget_->setItemDelegate(delegate);
144
145 list_widget_->setMovement(QListView::Static);
146 list_widget_->setViewMode(QListView::ListMode);
147 list_widget_->setFlow(QListView::TopToBottom);
148 list_widget_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
149 list_widget_->setResizeMode(QListWidget::Adjust);
150 list_widget_->setContextMenuPolicy(Qt::CustomContextMenu);
151 list_widget_->setSpacing(2);
152 list_widget_->setStyleSheet(R"(
153 QListWidget {
154 background-color: #ffffff;
155 border: 0px solid #ffffff;
156 }
157 QListWidget::item {
158 color: #ffffff;
159 border: transparent;
160 border-bottom: 0px solid #ffffff;
161 }
162
163 QListWidget::item:hover {
164 background-color: none;
165 }
166
167 QListWidget::item:selected {
168 border-left: 0px solid #777777;
169 background-color: none;
170 }
171 )");
172
173 QObject::connect(list_widget_, &QListWidget::customContextMenuRequested, this, [=, this](const QPoint& pos) {
174 QListWidgetItem* cur_item = list_widget_->itemAt(pos);
175 if (cur_item == nullptr) { return; }
176 int index = list_widget_->row(cur_item);
177
178 });
179
180 QObject::connect(list_widget_, &QListWidget::itemDoubleClicked, this, [=, this](QListWidgetItem *item) {
181 int index = list_widget_->row(item);
182
183 });
184
185 root_layout_->addWidget(list_widget_);
186
187 // sure button
188 {
189 auto layout = new NoMarginHLayout();
190 auto btn_sure = new TcPushButton();
191 btn_sure->SetTextId("id_ok");
192 connect(btn_sure, &QPushButton::clicked, this, [=, this] () {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected