Changeset 168 for smplayer/vendor/current/src/videopreview/videopreview.cpp
- Timestamp:
- Oct 9, 2014, 11:54:00 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified smplayer/vendor/current/src/videopreview/videopreview.cpp ¶
r163 r168 68 68 69 69 w_contents = new QWidget(this); 70 w_contents->setContentsMargins(0, 0, 0, 0); 70 71 QPalette p = w_contents->palette(); 71 72 p.setColor(w_contents->backgroundRole(), Qt::white); … … 80 81 grid_layout = new QGridLayout; 81 82 grid_layout->setSpacing(2); 83 grid_layout->setContentsMargins(0, 0, 0, 0); 82 84 83 85 QVBoxLayout * l = new QVBoxLayout; 86 l->setContentsMargins(4, 4, 4, 4); 87 l->setSpacing(0); 84 88 l->setSizeConstraint(QLayout::SetFixedSize); 85 89 l->addWidget(info); 86 90 l->addLayout(grid_layout); 87 91 l->addWidget(foot); 88 92 89 93 w_contents->setLayout(l); 90 94 … … 325 329 326 330 if (run.thumbnail_width == 0) { 331 qDebug("VideoPreview::addPicture: horizontalSpacing: %d", grid_layout->horizontalSpacing()); 327 332 int spacing = grid_layout->horizontalSpacing() * (prop.n_cols-1); 333 QMargins m = w_contents->layout()->contentsMargins(); 334 qDebug("VideoPreview::addPicture: contentsMargins: %d, %d", m.left(), m.right()); 335 spacing += (m.left() + m.right()); 328 336 if (spacing < 0) spacing = 0; 329 337 qDebug("VideoPreview::addPicture: spacing: %d", spacing); … … 526 534 if (!filename.isEmpty()) { 527 535 QPixmap image = QPixmap::grabWidget(w_contents); 536 qDebug("VideoPreview::saveImage: size: %d %d", image.size().width(), image.size().height()); 537 if (image.size().width() > prop.max_width) { 538 image = image.scaledToWidth(prop.max_width, Qt::SmoothTransformation); 539 qDebug("VideoPreview::saveImage: image scaled to : %d %d", image.size().width(), image.size().height()); 540 } 528 541 if (!image.save(filename)) { 529 542 // Failed!!!
Note:
See TracChangeset
for help on using the changeset viewer.