Skip to content

Commit

Permalink
MythBrowser: Show the web page's favicon on the page selector.
Browse files Browse the repository at this point in the history
You just need to add an imagetype called 'favicon' to the 'pagelist'
buttonlist.
  • Loading branch information
Paul Harrison committed May 5, 2011
1 parent 6f4c698 commit e88fa03
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
31 changes: 0 additions & 31 deletions mythplugins/mythbrowser/mythbrowser/mythbrowser.cpp
Expand Up @@ -241,8 +241,6 @@ void MythBrowser::slotLoadFinished(bool OK)

if (m_progressBar)
m_progressBar->SetUsed(0);

slotIconChanged();
}

void MythBrowser::slotLoadProgress(int progress)
Expand All @@ -258,35 +256,6 @@ void MythBrowser::slotTitleChanged(const QString &title)
item->SetText(title);
}

void MythBrowser::slotIconChanged(void)
{
MythUIButtonListItem *item = m_pageList->GetItemCurrent();
if (!item)
return;

QIcon icon = activeBrowser()->GetIcon();

if (icon.isNull())
{
//FIXME use a default icon here
item->setImage(NULL);
}
else
{
if (item)
{
QPixmap pixmap = icon.pixmap(32, 32);
QImage image = pixmap.toImage();
image = image.scaled(
QSize(32,32), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
MythImage *mimage = GetMythPainter()->GetFormatImage();
mimage->Assign(image);

item->setImage(mimage);
}
}
}

void MythBrowser::slotStatusBarMessage(const QString &text)
{
if (m_statusText)
Expand Down
1 change: 0 additions & 1 deletion mythplugins/mythbrowser/mythbrowser/mythbrowser.h
Expand Up @@ -51,7 +51,6 @@ class MythBrowser : public MythScreenType
void slotStatusBarMessage(const QString &text);
void slotTabSelected(MythUIButtonListItem *item);
void slotTabLosingFocus(void);
void slotIconChanged(void);

private:
MythUIWebBrowser* activeBrowser(void);
Expand Down
4 changes: 2 additions & 2 deletions mythplugins/mythbrowser/mythbrowser/webpage.cpp
Expand Up @@ -104,7 +104,7 @@ void WebPage::slotIconChanged(void)
if (icon.isNull())
{
//FIXME use a default icon here?
m_listItem->setImage(NULL);
m_listItem->SetImage("", "favicon");
}
else
{
Expand All @@ -117,7 +117,7 @@ void WebPage::slotIconChanged(void)
MythImage *mimage = GetMythPainter()->GetFormatImage();
mimage->Assign(image);

m_listItem->setImage(mimage);
m_listItem->setImage(mimage, "favicon");
}
}

Expand Down

0 comments on commit e88fa03

Please sign in to comment.