Ignore:
Timestamp:
Oct 9, 2014, 11:54:00 AM (11 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update vendor to 14.9.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified smplayer/vendor/current/src/videopreview/videopreview.cpp

    r163 r168  
    6868
    6969        w_contents = new QWidget(this);
     70        w_contents->setContentsMargins(0, 0, 0, 0);
    7071        QPalette p = w_contents->palette();
    7172        p.setColor(w_contents->backgroundRole(), Qt::white);
     
    8081        grid_layout = new QGridLayout;
    8182        grid_layout->setSpacing(2);
     83        grid_layout->setContentsMargins(0, 0, 0, 0);
    8284
    8385        QVBoxLayout * l = new QVBoxLayout;
     86        l->setContentsMargins(4, 4, 4, 4);
     87        l->setSpacing(0);
    8488        l->setSizeConstraint(QLayout::SetFixedSize);
    8589        l->addWidget(info);
    8690        l->addLayout(grid_layout);
    8791        l->addWidget(foot);
    88        
     92
    8993        w_contents->setLayout(l);
    9094
     
    325329
    326330        if (run.thumbnail_width == 0) {
     331                qDebug("VideoPreview::addPicture: horizontalSpacing: %d", grid_layout->horizontalSpacing());
    327332                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());
    328336                if (spacing < 0) spacing = 0;
    329337                qDebug("VideoPreview::addPicture: spacing: %d", spacing);
     
    526534        if (!filename.isEmpty()) {
    527535                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                }
    528541                if (!image.save(filename)) {
    529542                        // Failed!!!
Note: See TracChangeset for help on using the changeset viewer.