diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/homepage.cpp | 13 | ||||
-rw-r--r-- | src/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/previewimage.cpp | 32 | ||||
-rw-r--r-- | src/previewimage.h | 4 |
4 files changed, 21 insertions, 30 deletions
diff --git a/src/homepage.cpp b/src/homepage.cpp index 9a15f249..7d93216c 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -116,14 +116,13 @@ QString HomePage::fillFavorites() for(int i=0; i<8; ++i) { QString text = names.at(i); - if(text.length() > 20) + if(text.length() > 23) { - text.truncate(17); + text.truncate(20); text += "..."; } speed += "<div class=\"thumbnail\">"; - speed += "<object type=\"application/image-preview\" data=\""; - speed += urls.at(i) + "\" >"; + speed += "<object type=\"application/image-preview\" data=\"" + urls.at(i) + "\" >"; speed += "<param name=\"title\" value=\"" + text + "\" />"; speed += "<param name=\"index\" value=\"" + QString::number(i) + "\" />"; speed += "<param name=\"isFavorite\" value=\"true\" />"; @@ -144,8 +143,7 @@ QString HomePage::lastVisitedSites() { HistoryItem it = history.at(i); last += "<div class=\"thumbnail\">"; - last += "<object type=\"application/image-preview\" data=\"" + it.url; - last += "\" width=\"200\">"; + last += "<object type=\"application/image-preview\" data=\"" + it.url + "\" >"; last += "</object>"; last += "<br />"; last += "<a href=\"" + it.url + "\">" + it.url + "</a></div>"; @@ -292,8 +290,7 @@ QString HomePage::fillClosedTabs() } closed += "<div class=\"thumbnail\">"; - closed += "<object type=\"application/image-preview\" data=\""; - closed += item.url + "\" width=\"200\">"; + closed += "<object type=\"application/image-preview\" data=\"" + item.url + "\" >"; closed += "<param name=\"title\" value=\"" + text + "\" />"; closed += "</object>"; closed += "</div>"; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7f2bcdeb..b41b630f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -147,7 +147,7 @@ MainWindow::~MainWindow() { Application::instance()->removeMainWindow(this); delete m_popup; - delete m_view; +// delete m_view; } 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); diff --git a/src/previewimage.h b/src/previewimage.h index 6bc27d8d..b8ef1f4c 100644 --- a/src/previewimage.h +++ b/src/previewimage.h @@ -39,6 +39,8 @@ #include <QImage> #include <QUrl> #include <QToolButton> +#include <QSize> + class PreviewImage : public QWidget { @@ -55,7 +57,7 @@ public slots: void removeMe(); void setUrlFromAction(); void refreshPreview(); - + protected: void contextMenuEvent(QContextMenuEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); |