feat: add image support for the news reader :^)
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
		@@ -20,7 +20,9 @@ NewsDialog::NewsDialog(QList<NewsEntryPtr> entries, QWidget* parent) : QDialog(p
 | 
			
		||||
 | 
			
		||||
    auto article_entry = m_entries.constFind(first_item->text()).value();
 | 
			
		||||
    ui->articleTitleLabel->setText(QString("<a href='%1'>%2</a>").arg(article_entry->link, first_item->text()));
 | 
			
		||||
 | 
			
		||||
    ui->currentArticleContentBrowser->setText(article_entry->content);
 | 
			
		||||
    ui->currentArticleContentBrowser->flush();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NewsDialog::~NewsDialog()
 | 
			
		||||
@@ -33,7 +35,9 @@ void NewsDialog::selectedArticleChanged(const QString& new_title)
 | 
			
		||||
    auto const& article_entry = m_entries.constFind(new_title).value();
 | 
			
		||||
 | 
			
		||||
    ui->articleTitleLabel->setText(QString("<a href='%1'>%2</a>").arg(article_entry->link, new_title));
 | 
			
		||||
 | 
			
		||||
    ui->currentArticleContentBrowser->setText(article_entry->content);
 | 
			
		||||
    ui->currentArticleContentBrowser->flush();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void NewsDialog::toggleArticleList()
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@
 | 
			
		||||
        </widget>
 | 
			
		||||
       </item>
 | 
			
		||||
       <item>
 | 
			
		||||
        <widget class="QTextBrowser" name="currentArticleContentBrowser">
 | 
			
		||||
        <widget class="ProjectDescriptionPage" name="currentArticleContentBrowser">
 | 
			
		||||
         <property name="textInteractionFlags">
 | 
			
		||||
          <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
 | 
			
		||||
         </property>
 | 
			
		||||
@@ -91,6 +91,13 @@
 | 
			
		||||
   </item>
 | 
			
		||||
  </layout>
 | 
			
		||||
 </widget>
 | 
			
		||||
 <customwidgets>
 | 
			
		||||
  <customwidget>
 | 
			
		||||
   <class>ProjectDescriptionPage</class>
 | 
			
		||||
   <extends>QTextBrowser</extends>
 | 
			
		||||
   <header>ui/widgets/ProjectDescriptionPage.h</header>
 | 
			
		||||
  </customwidget>
 | 
			
		||||
 </customwidgets>
 | 
			
		||||
 <resources/>
 | 
			
		||||
 <connections>
 | 
			
		||||
  <connection>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user