| 152 | } |
| 153 | |
| 154 | void TabWidget::handleShowOpenedFiles(const int &x, const int &y, const QSize &size) |
| 155 | { |
| 156 | int count = d->tabBar->tabCount(); |
| 157 | if (count < 2) |
| 158 | return; |
| 159 | |
| 160 | d->openedWidget->setWindowFlags(Qt::Popup); |
| 161 | QSize popupSize = d->openedWidget->size(); |
| 162 | |
| 163 | int posX = (size.width() - popupSize.width()) / 2 + x; |
| 164 | int posY = (size.height() - popupSize.height()) / 2 + y; |
| 165 | |
| 166 | d->openedWidget->move(posX, posY); |
| 167 | d->openedWidget->setOpenedFiles(d->recentOpenedFiles); |
| 168 | d->openedWidget->setListViewSelection(1); |
| 169 | connect(d->openedWidget, &RecentOpenWidget::triggered, this, [=](const QModelIndex &index) { |
| 170 | d->tabBar->setCurrentIndex(d->tabBar->indexOf(index.data(RecentOpenWidget::RecentOpenedUserRole::FilePathRole).toString())); |
| 171 | }); |
| 172 | d->openedWidget->show(); |
| 173 | d->openedWidget->setFocusListView(); |
| 174 | } |
| 175 | |
| 176 | QWidget *TabWidgetPrivate::createSpaceWidget() |
| 177 | { |
nothing calls this directly
no test coverage detected