MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / createSpaceWidget

Method createSpaceWidget

src/plugins/codeeditor/gui/tabwidget.cpp:176–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176QWidget *TabWidgetPrivate::createSpaceWidget()
177{
178 QWidget *widget = new QWidget(q);
179 QVBoxLayout *vLayout = new QVBoxLayout(widget);
180 vLayout->setSpacing(5);
181
182 QLabel *titleLabel = new QLabel(tr("File Operation"), q);
183 titleLabel->setAlignment(Qt::AlignCenter);
184 auto font = titleLabel->font();
185 font.setPointSize(font.pointSize() * 1.5);
186 titleLabel->setFont(font);
187
188 QGridLayout *gridLayout = new QGridLayout;
189 gridLayout->setSpacing(10);
190 auto addCommandLine = [this, gridLayout](const QString &id) {
191 auto cmd = ActionManager::instance()->command(id);
192 if (!cmd || !cmd->action())
193 return;
194
195 int row = gridLayout->rowCount();
196 gridLayout->addWidget(new QLabel(cmd->action()->text(), q), row, 0, Qt::AlignRight);
197 const auto &keyList = cmd->keySequences();
198 for (int i = 0; i < keyList.size(); ++i) {
199 auto key = keyList[i];
200 gridLayout->addWidget(new KeyLabel(key.toString(), q), row, i + 1, Qt::AlignLeft);
201 }
202 };
203
204 addCommandLine(A_OPEN_FILE);
205 addCommandLine("Find.findInDocument");
206 addCommandLine("Editor.close");
207 addCommandLine("locator.EnterCommand");
208 addCommandLine("Editor.addAndRemoveComment");
209
210 vLayout->addStretch(1);
211 vLayout->addWidget(titleLabel, 0, Qt::AlignHCenter);
212 vLayout->addLayout(gridLayout);
213 vLayout->addStretch(1);
214
215 return widget;
216}
217
218QWidget *TabWidgetPrivate::createFindPlaceHolder()
219{

Callers

nothing calls this directly

Calls 10

fontMethod · 0.80
keySequencesMethod · 0.80
setFontMethod · 0.45
commandMethod · 0.45
actionMethod · 0.45
rowCountMethod · 0.45
addWidgetMethod · 0.45
textMethod · 0.45
sizeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected