]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/filepicker.cpp
Fixed 24BPP mode (used R twice instead of B), fixed problem with Object
[virtualjaguar] / src / gui / filepicker.cpp
index 06e517d0e2d5235c4a014d6c46f5c46aa0c39c5f..288605274d0dc47d6978dc6eb3b2414b093f5ff8 100644 (file)
@@ -89,11 +89,30 @@ printf("VSB size: %u, %u\n", sbSize3.width(), sbSize3.height());
        printf("VSB size width: %u\n", sbWidth);
        int sbWidth2 = vsb->sizeHint().width();
        printf("VSB sizeHint width: %u\n", sbWidth2);
+       int sbWidth3 = vsb->minimumSize().width();
+       printf("VSB minimum width: %u\n", sbWidth3);
+       int sbWidth4 = vsb->frameSize().width();
+       printf("VSB frame width: %u\n", sbWidth4);
        delete vsb;
 
+//     fileList->setFixedWidth((488/4) + 4);
+       int sbWidth5 = fileList->frameWidth();
+       printf("List frame width: %u, (diff=%d)\n", sbWidth5, sbWidth5 - ((488/4) + 4));
+       int sbWidth6 = fileList->sizeHint().width();
+       printf("List sizeHint width: %u\n", sbWidth6);
+       int sbWidth7 = fileList->minimumSize().width();
+       printf("List minimum width: %u\n", sbWidth7);
+       int sbWidth8 = fileList->minimumSizeHint().width();
+       printf("List minimum hint width: %u\n", sbWidth8);
 //     fileList->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
 //     fileList->verticalScrollBar()->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
+       // (488/4) + 4 is the width of the object in the filelistmodel. Dunno why the QListView
+       // isn't picking that up. :-(
        fileList->setFixedWidth((488/4) + 4 + sbWidth);//ick
+//     fileList->setFixedWidth((488/4) + 4 + 17 + 4);//sbWidth);//ick
+
+//     fileList->setSpacing(4);
+       fileList->setUniformItemSizes(true);
 #endif
 
 //     QVBoxLayout * layout = new QVBoxLayout;
@@ -181,6 +200,14 @@ New sizes: 373x172 (label), 420x340 (cart)
        connect(insertCart, SIGNAL(clicked()), this, SLOT(LoadButtonPressed()));
 }
 
+void FilePickerWindow::keyPressEvent(QKeyEvent * e)
+{
+       if (e->key() == Qt::Key_Escape)
+               hide();
+       else if (e->key() == Qt::Key_Return)
+               LoadButtonPressed();
+}
+
 QString FilePickerWindow::GetSelectedPrettyName(void)
 {
        return prettyFilename;
@@ -222,8 +249,8 @@ if (index != 0xFFFFFFFF)
 
 void FilePickerWindow::AddFileToList3(unsigned long index, QString str, QImage * img, unsigned long size, bool haveUniversalHeader, unsigned long fileType, unsigned long crc)
 {
-if (index != 0xFFFFFFFF)
-       printf("FilePickerWindow(3): Found match [%s]...\n", romList[index].name);
+//if (index != 0xFFFFFFFF)
+//     printf("FilePickerWindow(3): Found match [%s]...\n", romList[index].name);
 
        if (img)
        {
@@ -239,7 +266,7 @@ void FilePickerWindow::LoadButtonPressed(void)
 {
        // TODO: Get the text of the current selection, call the MainWin slot for loading
        emit(RequestLoad(currentFile));
-       this->hide();
+       hide();
 }
 
 //