From e5e8916773a45a6d4f35fcb5cf6dec594e6726c4 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 19 Oct 2009 15:59:10 +0200 Subject: Fixing thumbs position --- src/previewimage.cpp | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'src/previewimage.cpp') diff --git a/src/previewimage.cpp b/src/previewimage.cpp index b51631af..0712b5a0 100644 --- a/src/previewimage.cpp +++ b/src/previewimage.cpp @@ -63,21 +63,25 @@ PreviewImage::PreviewImage(const QUrl &url, const QString &title, int index, boo , m_imageLabel(new QLabel) , m_textLabel(new QLabel) { + setMinimumSize(300,200); + + m_imageLabel->setAlignment(Qt::AlignCenter); + m_textLabel->setAlignment(Qt::AlignCenter); + QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(m_imageLabel); mainLayout->addWidget(m_textLabel); setLayout(mainLayout); loadUrlPreview(url); -// setAlignment(Qt::AlignCenter); } PreviewImage::~PreviewImage() { delete ws; - delete m_imageLabel; delete m_textLabel; + delete m_imageLabel; } @@ -129,6 +133,11 @@ void PreviewImage::snapFinished() m_imageLabel->setPixmap(m_pixmap); m_textLabel->setText(m_title); + kDebug() << "m_pixmap: " << m_pixmap.size(); + kDebug() << "text label: " << m_textLabel->size(); + kDebug() << "iamge label: " << m_imageLabel->size(); + kDebug() << "widget: " << size(); + m_pixmap.save(m_savePath); if(m_index > -1) @@ -189,24 +198,7 @@ void PreviewImage::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - // if(m_isFavorite) - // { - Application::instance()->loadUrl(m_url); - - //TODO: what is that ? : - /* } - else - { - MainView *mv = Application::instance()->mainWindow()->mainView(); - int actualIndex = mv->currentIndex(); - - kDebug() << "Actual index: " << actualIndex; - kDebug() << "m_index: " << m_index; - - mv->slotCloseTab(actualIndex); - mv->setCurrentIndex(m_index); - } - */ + Application::instance()->loadUrl(m_url); return; }; QWidget::mousePressEvent(event); -- cgit v1.2.1