diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-12-20 19:10:29 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-03-07 07:05:29 +0000 |
commit | 76db789dc777a4888b95d9f6665ce45bd667b957 (patch) | |
tree | d9b1ec75c45dfacd9dce3e8d981411381459a221 | |
parent | 4f12babf52750bd07ef1a7345a428123cfd0bae5 (diff) |
Add Tooltips for emoji toolbar control
Change-Id: I93d9fb1af42d83c7f7f518a1441f4666fd7ee30a
Reviewed-on: https://gerrit.libreoffice.org/32231
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | include/sfx2/emojiview.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/emojicontrol.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/control/emojiview.cxx | 15 |
3 files changed, 11 insertions, 7 deletions
diff --git a/include/sfx2/emojiview.hxx b/include/sfx2/emojiview.hxx index 1b0d0ac3d6a1..1085d4d760b7 100644 --- a/include/sfx2/emojiview.hxx +++ b/include/sfx2/emojiview.hxx @@ -64,7 +64,7 @@ public: void setInsertEmojiHdl (const Link<ThumbnailViewItem*, void> &rLink); - void AppendItem(const OUString &rTitle, const OUString &rCategory ); + void AppendItem(const OUString &rTitle, const OUString &rCategory, const OUString &rName ); protected: virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx index be6e57073e5d..316a37f869f9 100644 --- a/sfx2/source/control/emojicontrol.cxx +++ b/sfx2/source/control/emojicontrol.cxx @@ -100,6 +100,7 @@ SfxEmojiControl::SfxEmojiControl(sal_uInt16 nId, const css::uno::Reference< css: mpEmojiView->setInsertEmojiHdl(LINK(this, SfxEmojiControl, InsertHdl)); mpEmojiView->Show(); + mpEmojiView->ShowTooltips(true); mpTabControl->SetActivatePageHdl(LINK(this, SfxEmojiControl, ActivatePageHdl)); } diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx index ee4eefb04d50..b3e69007debb 100644 --- a/sfx2/source/control/emojiview.cxx +++ b/sfx2/source/control/emojiview.cxx @@ -103,7 +103,7 @@ void EmojiView::Populate() return; } - // TODO::populate view using the orcus json parser + // Populate view using the orcus json parser using node = orcus::json_document_tree::node; // default json config @@ -126,7 +126,7 @@ void EmojiView::Populate() { // iterate each element to get the keys std::vector<orcus::pstring> aEmojiParams = value.keys(); - OUString sTitle, sCategory; + OUString sTitle, sCategory, sName; bool bDuplicate = false; for (auto paramIter = aEmojiParams.begin(); paramIter != aEmojiParams.end(); ++paramIter) @@ -143,18 +143,20 @@ void EmojiView::Populate() { sCategory = rtl::OStringToOUString(OString( prop.string_value().get(), prop.string_value().size() ), RTL_TEXTENCODING_UTF8); } + else if(paramVal == "name") + { + sName = rtl::OStringToOUString(OString( prop.string_value().get(), prop.string_value().size() ), RTL_TEXTENCODING_UTF8); + } else if(paramVal == "duplicate") { bDuplicate = true; } } - // TODO: Check whether the glyph is present in the font file - // If the glyph is present, Call EmojiView::AppendItem() to populate each template as it is parsed // Don't append if a duplicate emoji if(!bDuplicate) { - AppendItem(sTitle, sCategory); + AppendItem(sTitle, sCategory, sName); } } } @@ -209,12 +211,13 @@ void EmojiView::setInsertEmojiHdl(const Link<ThumbnailViewItem*, void> &rLink) maInsertEmojiHdl = rLink; } -void EmojiView::AppendItem(const OUString &rTitle, const OUString &rCategory) +void EmojiView::AppendItem(const OUString &rTitle, const OUString &rCategory, const OUString &rName) { EmojiViewItem *pItem = new EmojiViewItem(*this, getNextItemId()); pItem->maTitle = rTitle; pItem->setCategory(rCategory); + pItem->setHelpText(rName); ThumbnailView::AppendItem(pItem); |