Changeset ad7e6ca


Ignore:
Timestamp:
06/23/14 09:36:54 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
fd6b78d
Parents:
16d6c41
Message:

Fix the lumina-fm slideshow viewer image resizing. Now it will always fit *exactly* within the window if it needs to get scaled down instead of bumping the size of the window up by a couple pixels each time.

Location:
lumina/lumina-fm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lumina/lumina-fm/MainUI.cpp

    rb3b0822 rad7e6ca  
    311311  //Now go to the Slideshow player 
    312312  ui->stackedWidget->setCurrentWidget(ui->page_image_view); 
     313  showNewPicture(); //make sure it is up to date with the widget size 
    313314} 
    314315 
     
    467468//Slideshow Functions 
    468469void MainUI::showNewPicture(){ 
     470  if( !ui->label_image->isVisible() ){ return; } //don't update if not visible - can cause strange resizing issues 
    469471  QString file = getCurrentDir(); 
    470472  if(!file.endsWith("/")){ file.append("/"); } 
     
    473475  //qDebug() << "Show Image:" << file; 
    474476  QPixmap pix(file); 
    475   if(pix.size().width() > ui->label_image->size().width() || pix.size().height() > ui->label_image->size().height()){  
    476     pix = pix.scaled(ui->label_image->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);  
     477  if(pix.size().width() > ui->label_image->contentsRect().width() || pix.size().height() > ui->label_image->contentsRect().height()){  
     478    pix = pix.scaled(ui->label_image->contentsRect().size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);  
    477479  } 
    478480  ui->label_image->setPixmap(pix); 
  • lumina/lumina-fm/MainUI.ui

    rb3b0822 rad7e6ca  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>550</width> 
    10     <height>398</height> 
     9    <width>543</width> 
     10    <height>395</height> 
    1111   </rect> 
    1212  </property> 
     
    1919     <widget class="QStackedWidget" name="stackedWidget"> 
    2020      <property name="currentIndex"> 
    21        <number>3</number> 
     21       <number>2</number> 
    2222      </property> 
    2323      <widget class="QWidget" name="page_browser"> 
     
    197197          </property> 
    198198          <property name="frameShape"> 
    199            <enum>QFrame::StyledPanel</enum> 
     199           <enum>QFrame::Panel</enum> 
     200          </property> 
     201          <property name="frameShadow"> 
     202           <enum>QFrame::Raised</enum> 
    200203          </property> 
    201204          <property name="text"> 
     
    456459     <x>0</x> 
    457460     <y>0</y> 
    458      <width>550</width> 
    459      <height>21</height> 
     461     <width>543</width> 
     462     <height>20</height> 
    460463    </rect> 
    461464   </property> 
Note: See TracChangeset for help on using the changeset viewer.