diff options
author | Muhammet Kara <muhammet.kara@pardus.org.tr> | 2018-10-23 21:44:37 +0300 |
---|---|---|
committer | Heiko Tietze <tietze.heiko@gmail.com> | 2018-10-24 13:46:58 +0200 |
commit | b6b31bbb1a9e2272ac77de127825c4ee9f71effa (patch) | |
tree | a0f446c0f67cd5c45a7e8daaeb90443c40d8f7d8 /cui | |
parent | dc35f2592654166ab293c1315f47cec9d2384ed5 (diff) |
tdf#120746: Show the name of the persona as tooltip in the search results
Change-Id: Ie6de25e93f0e96a1a5b1cf5c4d465dfb45afc7f7
Reviewed-on: https://gerrit.libreoffice.org/62249
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/personalization.cxx | 19 | ||||
-rw-r--r-- | cui/source/options/personalization.hxx | 8 |
2 files changed, 17 insertions, 10 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index e46a15454ceb..d1e3b7fcef56 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -383,10 +383,11 @@ void SelectPersonaDialog::SetProgress( const OUString& rProgress ) } } -void SelectPersonaDialog::SetImages( const Image& aImage, sal_Int32 nIndex ) +void SelectPersonaDialog::SetImages( const Image& aImage, const OUString& sName, const sal_Int32& nIndex ) { m_vResultList[nIndex]->Enable(); m_vResultList[nIndex]->SetModeImage( aImage ); + m_vResultList[nIndex]->SetQuickHelpText( sName ); } void SelectPersonaDialog::AddPersonaSetting( OUString const & rPersonaSetting ) @@ -894,11 +895,11 @@ void SearchAndParseThread::execute() INetURLObject aURLObj( aPreviewFile ); - OUString aPersonaSetting = personaInfos[nIndex].sSlug - + ";" + personaInfos[nIndex].sName - + ";" + personaInfos[nIndex].sHeaderURL - + ";" + personaInfos[nIndex].sFooterURL - + ";" + personaInfos[nIndex].sTextColor; + OUString aPersonaSetting = personaInfo.sSlug + + ";" + personaInfo.sName + + ";" + personaInfo.sHeaderURL + + ";" + personaInfo.sFooterURL + + ";" + personaInfo.sTextColor; m_pPersonaDialog->AddPersonaSetting( aPersonaSetting ); @@ -907,10 +908,10 @@ void SearchAndParseThread::execute() aFilter.ImportGraphic( aGraphic, aURLObj ); BitmapEx aBmp = aGraphic.GetBitmapEx(); - m_pPersonaDialog->SetImages( Image( aBmp ), nIndex++ ); + m_pPersonaDialog->SetImages( Image( aBmp ), personaInfo.sName, nIndex ); m_pPersonaDialog->setOptimalLayoutSize(); - if (nIndex >= MAX_RESULTS) + if (++nIndex >= MAX_RESULTS) break; } @@ -969,7 +970,7 @@ void SearchAndParseThread::execute() aFilter.ImportGraphic( aGraphic, aURLObj ); BitmapEx aBmp = aGraphic.GetBitmapEx(); - m_pPersonaDialog->SetImages( Image( aBmp ), 0 ); + m_pPersonaDialog->SetImages( Image( aBmp ), aPersonaInfo.sName, 0 ); m_pPersonaDialog->setOptimalLayoutSize(); } diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index 4eb55b589f60..260fa9ad469a 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -117,7 +117,13 @@ public: OUString GetSelectedPersona() const; void SetProgress( const OUString& ); - void SetImages( const Image&, sal_Int32 ); + /** + * @brief Assings preview images to result buttons + * @param aPreviewImage Persona preview image + * @param sName Name of the persona + * @param nIndex Index number of the result button + */ + void SetImages(const Image& aPreviewImage, const OUString& sName, const sal_Int32& nIndex ); void AddPersonaSetting( OUString const & ); void ClearSearchResults(); void SetAppliedPersonaSetting( OUString const & ); |