[Libreoffice-commits] core.git: extras/source include/sfx2 sfx2/inc sfx2/source sfx2/uiconfig solenv/bin

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 23 08:22:04 UTC 2020


 extras/source/glade/libreoffice-catalog.xml.in |    3 
 include/sfx2/emojipopup.hxx                    |    1 
 sfx2/inc/emojicontrol.hxx                      |   37 +--
 sfx2/inc/emojiview.hxx                         |   14 -
 sfx2/source/control/emojicontrol.cxx           |  161 ++++++--------
 sfx2/source/control/emojipopup.cxx             |   14 +
 sfx2/source/control/emojiview.cxx              |   50 ++--
 sfx2/source/control/thumbnailview.cxx          |    8 
 sfx2/uiconfig/ui/emojicontrol.ui               |  270 +++++++++----------------
 solenv/bin/native-code.py                      |    1 
 10 files changed, 238 insertions(+), 321 deletions(-)

New commits:
commit 6c0a6e2e91069da9db13c27a058721b88e8eaba9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jun 22 15:17:04 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 23 10:21:26 2020 +0200

    weld emoji dropdown
    
    sharing a single widget between multiple notebook pages isn't
    going to work with native notebooks, so replace with a row
    of toggle buttons
    
    Change-Id: Ic24632f6d94d9238423f8b5e61d5e945c98e4a3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96891
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index f20ba840153b..170c0a8967a6 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -28,9 +28,6 @@
     <glade-widget-class title="Recent Documents View" name="sfxlo-RecentDocsView"
                         generic-name="Icon View" parent="GtkIconView"
                         icon-name="widget-gtk-iconview"/>
-    <glade-widget-class title="Emoji View" name="sfxlo-EmojiView"
-                        generic-name="Template Icon View" parent="GtkIconView"
-                        icon-name="widget-gtk-iconview"/>
     <glade-widget-class title="Template Thumbnail View" name="sfxlo-TemplateDefaultView"
                         generic-name="Template Icon View" parent="GtkIconView"
                         icon-name="widget-gtk-iconview"/>
diff --git a/include/sfx2/emojipopup.hxx b/include/sfx2/emojipopup.hxx
index 20d1e493c250..04f6fe720247 100644
--- a/include/sfx2/emojipopup.hxx
+++ b/include/sfx2/emojipopup.hxx
@@ -30,6 +30,7 @@ public:
     virtual ~EmojiPopup() override;
 
     virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
+    virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
 
     // XServiceInfo
     virtual OUString SAL_CALL getImplementationName() override;
diff --git a/sfx2/inc/emojicontrol.hxx b/sfx2/inc/emojicontrol.hxx
index 33d0e021bbe1..98a28985fe42 100644
--- a/sfx2/inc/emojicontrol.hxx
+++ b/sfx2/inc/emojicontrol.hxx
@@ -7,15 +7,12 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SFX2_INC_EMOJICONTROL_HXX
-#define INCLUDED_SFX2_INC_EMOJICONTROL_HXX
+#pragma once
 
 #include <sal/config.h>
 #include <sfx2/dllapi.h>
-#include <vcl/tabctrl.hxx>
 #include <svtools/toolbarmenu.hxx>
-
-#define TAB_FONT_SIZE 15
+#include <vcl/customweld.hxx>
 
 namespace com::sun::star::frame { class XFrame; }
 
@@ -24,28 +21,34 @@ class EmojiView;
 class ThumbnailViewItem;
 enum class FILTER_CATEGORY;
 
-class SfxEmojiControl final : public svtools::ToolbarPopup
+class SfxEmojiControl final : public WeldToolbarPopup
+
 {
 public:
-    explicit SfxEmojiControl(EmojiPopup* pControl, vcl::Window* pParent);
-
+    explicit SfxEmojiControl(EmojiPopup* pControl, weld::Widget* pParent);
     virtual ~SfxEmojiControl() override;
 
-    virtual void dispose() override;
+    virtual void GrabFocus() override;
 
 private:
-    void ConvertLabelToUnicode(sal_uInt16 nPageId);
+    static void ConvertLabelToUnicode(weld::ToggleButton& rBtn);
 
-    /// Return filter according to the currently selected tab page.
-    FILTER_CATEGORY getCurrentFilter() const;
+    FILTER_CATEGORY getFilter(const weld::Button& rBtn) const;
 
-    DECL_LINK(ActivatePageHdl, TabControl*, void);
+    DECL_LINK(ActivatePageHdl, weld::Button&, void);
     DECL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, void);
 
-    VclPtr<TabControl>   mpTabControl;
-    VclPtr<EmojiView>    mpEmojiView;
+    std::unique_ptr<weld::ToggleButton> mxPeopleBtn;
+    std::unique_ptr<weld::ToggleButton> mxNatureBtn;
+    std::unique_ptr<weld::ToggleButton> mxFoodBtn;
+    std::unique_ptr<weld::ToggleButton> mxActivityBtn;
+    std::unique_ptr<weld::ToggleButton> mxTravelBtn;
+    std::unique_ptr<weld::ToggleButton> mxObjectsBtn;
+    std::unique_ptr<weld::ToggleButton> mxSymbolsBtn;
+    std::unique_ptr<weld::ToggleButton> mxFlagsBtn;
+    std::unique_ptr<weld::ToggleButton> mxUnicode9Btn;
+    std::unique_ptr<EmojiView> mxEmojiView;
+    std::unique_ptr<weld::CustomWeld> mxEmojiWeld;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/emojiview.hxx b/sfx2/inc/emojiview.hxx
index 4ee37ac6f581..68cdb962128e 100644
--- a/sfx2/inc/emojiview.hxx
+++ b/sfx2/inc/emojiview.hxx
@@ -49,26 +49,26 @@ private:
 };
 
 
-class EmojiView final : public ThumbnailView
+class EmojiView final : public SfxThumbnailView
 {
 public:
-    EmojiView ( vcl::Window* pParent);
+    EmojiView(std::unique_ptr<weld::ScrolledWindow> xWindow);
 
-    virtual ~EmojiView () override;
+    virtual ~EmojiView() override;
 
     // Fill view with emojis
-    void Populate ();
+    void Populate();
 
     void setInsertEmojiHdl (const Link<ThumbnailViewItem*, void> &rLink);
 
     void AppendItem(const OUString &rTitle, const OUString &rCategory, const OUString &rName );
 
 private:
-    virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
+    virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
 
-    virtual void KeyInput( const KeyEvent& rKEvt ) override;
+    virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
 
-    virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
+    virtual bool KeyInput( const KeyEvent& rKEvt ) override;
 
     std::string msJSONData;
 
diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx
index b2961c35df25..11e45c4f806b 100644
--- a/sfx2/source/control/emojicontrol.cxx
+++ b/sfx2/source/control/emojicontrol.cxx
@@ -39,125 +39,104 @@ const char FILTER_UNICODE9[]  = "unicode9";
 
 using namespace com::sun::star;
 
-SfxEmojiControl::SfxEmojiControl(EmojiPopup* pControl, vcl::Window* pParent)
-    : ToolbarPopup(pControl->getFrameInterface(), pParent, "emojictrl", "sfx/ui/emojicontrol.ui")
+SfxEmojiControl::SfxEmojiControl(EmojiPopup* pControl, weld::Widget* pParent)
+    : WeldToolbarPopup(pControl->getFrameInterface(), pParent, "sfx/ui/emojicontrol.ui", "emojictrl")
+    , mxPeopleBtn(m_xBuilder->weld_toggle_button(FILTER_PEOPLE))
+    , mxNatureBtn(m_xBuilder->weld_toggle_button(FILTER_NATURE))
+    , mxFoodBtn(m_xBuilder->weld_toggle_button(FILTER_FOOD))
+    , mxActivityBtn(m_xBuilder->weld_toggle_button(FILTER_ACTIVITY))
+    , mxTravelBtn(m_xBuilder->weld_toggle_button(FILTER_TRAVEL))
+    , mxObjectsBtn(m_xBuilder->weld_toggle_button(FILTER_OBJECTS))
+    , mxSymbolsBtn(m_xBuilder->weld_toggle_button(FILTER_SYMBOLS))
+    , mxFlagsBtn(m_xBuilder->weld_toggle_button(FILTER_FLAGS))
+    , mxUnicode9Btn(m_xBuilder->weld_toggle_button(FILTER_UNICODE9))
+    , mxEmojiView(new EmojiView(m_xBuilder->weld_scrolled_window("emoji_win")))
+    , mxEmojiWeld(new weld::CustomWeld(*m_xBuilder, "emoji_view", *mxEmojiView))
 {
-    get(mpTabControl, "tabcontrol");
-    get(mpEmojiView, "emoji_view");
-
-    sal_uInt16 nCurPageId = mpTabControl->GetPageId(FILTER_PEOPLE);
-    TabPage *pTabPage = mpTabControl->GetTabPage(nCurPageId);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_NATURE);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_FOOD);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_ACTIVITY);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_TRAVEL);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_OBJECTS);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_SYMBOLS);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_FLAGS);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-    pTabPage->Show();
-
-    nCurPageId = mpTabControl->GetPageId(FILTER_UNICODE9);
-    mpTabControl->SetTabPage(nCurPageId, pTabPage);
-    ConvertLabelToUnicode(nCurPageId);
-
-    vcl::Font rFont = mpTabControl->GetControlFont();
-    rFont.SetFontHeight(TAB_FONT_SIZE);
-    mpTabControl->SetControlFont(rFont);
-    pTabPage->Show();
-
-    mpEmojiView->SetStyle(mpEmojiView->GetStyle() | WB_VSCROLL);
-    mpEmojiView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
-    mpEmojiView->setItemDimensions(ITEM_MAX_WIDTH, 0, ITEM_MAX_HEIGHT, ITEM_PADDING);
-
-    mpEmojiView->Populate();
-    mpEmojiView->filterItems(ViewFilter_Category(FILTER_CATEGORY::PEOPLE));
-
-    mpEmojiView->setInsertEmojiHdl(LINK(this, SfxEmojiControl, InsertHdl));
-    mpEmojiView->Show();
-    mpEmojiView->ShowTooltips(true);
-
-    mpTabControl->SetActivatePageHdl(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    ConvertLabelToUnicode(*mxPeopleBtn);
+    ConvertLabelToUnicode(*mxNatureBtn);
+    ConvertLabelToUnicode(*mxFoodBtn);
+    ConvertLabelToUnicode(*mxActivityBtn);
+    ConvertLabelToUnicode(*mxTravelBtn);
+    ConvertLabelToUnicode(*mxObjectsBtn);
+    ConvertLabelToUnicode(*mxSymbolsBtn);
+    ConvertLabelToUnicode(*mxFlagsBtn);
+    ConvertLabelToUnicode(*mxUnicode9Btn);
+
+    mxPeopleBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxNatureBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxFoodBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxActivityBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxTravelBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxObjectsBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxSymbolsBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxFlagsBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+    mxUnicode9Btn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
+
+    mxEmojiView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
+    mxEmojiView->setItemDimensions(ITEM_MAX_WIDTH, 0, ITEM_MAX_HEIGHT, ITEM_PADDING);
+
+    mxEmojiView->Populate();
+    ActivatePageHdl(*mxPeopleBtn);
+
+    mxEmojiView->setInsertEmojiHdl(LINK(this, SfxEmojiControl, InsertHdl));
+    mxEmojiView->ShowTooltips(true);
 }
 
-SfxEmojiControl::~SfxEmojiControl()
+void SfxEmojiControl::GrabFocus()
 {
-    disposeOnce();
+    mxEmojiView->GrabFocus();
 }
 
-void SfxEmojiControl::dispose()
+SfxEmojiControl::~SfxEmojiControl()
 {
-    mpTabControl.clear();
-    mpEmojiView.clear();
-
-    ToolbarPopup::dispose();
 }
 
-void SfxEmojiControl::ConvertLabelToUnicode(sal_uInt16 nPageId)
+void SfxEmojiControl::ConvertLabelToUnicode(weld::ToggleButton& rBtn)
 {
-    OUStringBuffer sHexText = "";
-    OUString sLabel = mpTabControl->GetPageText(nPageId);
+    OUStringBuffer sHexText;
+    OUString sLabel = rBtn.get_label();
     sHexText.appendUtf32(sLabel.toUInt32(16));
-    mpTabControl->SetPageText(nPageId, sHexText.toString());
+    rBtn.set_label(sHexText.toString());
 }
 
-FILTER_CATEGORY SfxEmojiControl::getCurrentFilter() const
+FILTER_CATEGORY SfxEmojiControl::getFilter(const weld::Button& rCurPageId) const
 {
-    const sal_uInt16 nCurPageId = mpTabControl->GetCurPageId();
-
-    if (nCurPageId == mpTabControl->GetPageId(FILTER_PEOPLE))
+    if (&rCurPageId == mxPeopleBtn.get())
         return FILTER_CATEGORY::PEOPLE;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_NATURE))
+    else if (&rCurPageId == mxNatureBtn.get())
         return FILTER_CATEGORY::NATURE;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_FOOD))
+    else if (&rCurPageId == mxFoodBtn.get())
         return FILTER_CATEGORY::FOOD;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_ACTIVITY))
+    else if (&rCurPageId == mxActivityBtn.get())
         return FILTER_CATEGORY::ACTIVITY;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_TRAVEL))
+    else if (&rCurPageId == mxTravelBtn.get())
         return FILTER_CATEGORY::TRAVEL;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_OBJECTS))
+    else if (&rCurPageId == mxObjectsBtn.get())
         return FILTER_CATEGORY::OBJECTS;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_SYMBOLS))
+    else if (&rCurPageId == mxSymbolsBtn.get())
         return FILTER_CATEGORY::SYMBOLS;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_FLAGS))
+    else if (&rCurPageId == mxFlagsBtn.get())
         return FILTER_CATEGORY::FLAGS;
-    else if (nCurPageId == mpTabControl->GetPageId(FILTER_UNICODE9))
+    else if (&rCurPageId == mxUnicode9Btn.get())
         return FILTER_CATEGORY::UNICODE9;
 
     return FILTER_CATEGORY::PEOPLE;
 }
 
-IMPL_LINK_NOARG(SfxEmojiControl, ActivatePageHdl, TabControl*, void)
+IMPL_LINK(SfxEmojiControl, ActivatePageHdl, weld::Button&, rButton, void)
 {
-    mpEmojiView->filterItems(ViewFilter_Category(getCurrentFilter()));
+    mxPeopleBtn->set_active(&rButton == mxPeopleBtn.get());
+    mxNatureBtn->set_active(&rButton == mxNatureBtn.get());
+    mxFoodBtn->set_active(&rButton == mxFoodBtn.get());
+    mxActivityBtn->set_active(&rButton == mxActivityBtn.get());
+    mxTravelBtn->set_active(&rButton == mxTravelBtn.get());
+    mxObjectsBtn->set_active(&rButton == mxObjectsBtn.get());
+    mxSymbolsBtn->set_active(&rButton == mxSymbolsBtn.get());
+    mxFlagsBtn->set_active(&rButton == mxFlagsBtn.get());
+    mxUnicode9Btn->set_active(&rButton == mxUnicode9Btn.get());
+
+    mxEmojiView->filterItems(ViewFilter_Category(getFilter(rButton)));
 }
 
 IMPL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, pItem, void)
diff --git a/sfx2/source/control/emojipopup.cxx b/sfx2/source/control/emojipopup.cxx
index 2fe9173ea8cd..a0161fe2dbd7 100644
--- a/sfx2/source/control/emojipopup.cxx
+++ b/sfx2/source/control/emojipopup.cxx
@@ -39,9 +39,19 @@ EmojiPopup::~EmojiPopup()
 {
 }
 
-VclPtr<vcl::Window> EmojiPopup::createVclPopupWindow(vcl::Window* pParent)
+std::unique_ptr<WeldToolbarPopup> EmojiPopup::weldPopupWindow()
 {
-    return VclPtr<SfxEmojiControl>::Create(this, pParent);
+    return std::make_unique<SfxEmojiControl>(this, m_pToolbar);
+}
+
+VclPtr<vcl::Window> EmojiPopup::createVclPopupWindow( vcl::Window* pParent )
+{
+    mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
+        std::make_unique<SfxEmojiControl>(this, pParent->GetFrameWeld()));
+
+    mxInterimPopover->Show();
+
+    return mxInterimPopover;
 }
 
 OUString EmojiPopup::getImplementationName()
diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx
index 8bc65609d1d0..9e1606d3fc07 100644
--- a/sfx2/source/control/emojiview.cxx
+++ b/sfx2/source/control/emojiview.cxx
@@ -15,6 +15,7 @@
 #include <officecfg/Office/Common.hxx>
 #include <comphelper/processfactory.hxx>
 #include <vcl/event.hxx>
+#include <vcl/svapp.hxx>
 
 #include <orcus/json_document_tree.hpp>
 #include <orcus/config.hpp>
@@ -22,7 +23,6 @@
 #include <string>
 #include <fstream>
 
-#include <vcl/builderfactory.hxx>
 using namespace ::com::sun::star;
 
 bool ViewFilter_Category::isFilteredCategory(FILTER_CATEGORY filter, const OUString &rCategory)
@@ -60,8 +60,8 @@ bool ViewFilter_Category::operator () (const ThumbnailViewItem *pItem)
     return true;
 }
 
-EmojiView::EmojiView (vcl::Window *pParent)
-    : ThumbnailView(pParent, WB_TABSTOP | WB_VSCROLL)
+EmojiView::EmojiView(std::unique_ptr<weld::ScrolledWindow> xWindow)
+    : SfxThumbnailView(std::move(xWindow), nullptr)
 {
     // locate json data file
     OUString sPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/emojiconfig/emoji.json");
@@ -75,19 +75,28 @@ EmojiView::EmojiView (vcl::Window *pParent)
     msJSONData = std::string((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
     if(msJSONData.empty())
         return;
-
-    uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
-    OUString sFontName(officecfg::Office::Common::Misc::EmojiFont::get(xContext));
-    vcl::Font aFont = GetControlFont();
-    aFont.SetFamilyName( sFontName );
-    SetControlFont(aFont);
 }
 
-VCL_BUILDER_FACTORY(EmojiView)
+void EmojiView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
+    SfxThumbnailView::SetDrawingArea(pDrawingArea);
+
+    if (vcl::Window* pDefaultDevice = dynamic_cast<vcl::Window*>(Application::GetDefaultDevice()))
+    {
+        uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
+        OUString sFontName(officecfg::Office::Common::Misc::EmojiFont::get(xContext));
+        vcl::Font aFont = pDrawingArea->get_font();
+        aFont.SetFamilyName(sFontName);
+        OutputDevice& rDevice = pDrawingArea->get_ref_device();
+        pDefaultDevice->SetPointFont(rDevice, aFont);
+    }
+
+    mpItemAttrs->aFontSize.setX(ITEM_MAX_WIDTH - 2*ITEM_PADDING);
+    mpItemAttrs->aFontSize.setY(ITEM_MAX_HEIGHT - 2*ITEM_PADDING);
+}
 
 EmojiView::~EmojiView()
 {
-    disposeOnce();
 }
 
 void EmojiView::Populate()
@@ -155,14 +164,7 @@ void EmojiView::Populate()
     }
 }
 
-void EmojiView::ApplySettings(vcl::RenderContext& rRenderContext)
-{
-    ThumbnailView::ApplySettings(rRenderContext);
-    mpItemAttrs->aFontSize.setX(ITEM_MAX_WIDTH - 2*ITEM_PADDING);
-    mpItemAttrs->aFontSize.setY(ITEM_MAX_HEIGHT - 2*ITEM_PADDING);
-}
-
-void EmojiView::MouseButtonDown( const MouseEvent& rMEvt )
+bool EmojiView::MouseButtonDown( const MouseEvent& rMEvt )
 {
     GrabFocus();
 
@@ -174,9 +176,11 @@ void EmojiView::MouseButtonDown( const MouseEvent& rMEvt )
         if(pItem)
             maInsertEmojiHdl.Call(pItem);
     }
+
+    return true;
 }
 
-void EmojiView::KeyInput( const KeyEvent& rKEvt )
+bool EmojiView::KeyInput( const KeyEvent& rKEvt )
 {
     vcl::KeyCode aKeyCode = rKEvt.GetKeyCode();
 
@@ -192,10 +196,10 @@ void EmojiView::KeyInput( const KeyEvent& rKEvt )
 
         if (IsReallyVisible() && IsUpdateMode())
             Invalidate();
-        return;
+        return true;
     }
 
-    ThumbnailView::KeyInput(rKEvt);
+    return SfxThumbnailView::KeyInput(rKEvt);
 }
 
 void EmojiView::setInsertEmojiHdl(const Link<ThumbnailViewItem*, void> &rLink)
@@ -211,7 +215,7 @@ void EmojiView::AppendItem(const OUString &rTitle, const OUString &rCategory, co
     pItem->setCategory(rCategory);
     pItem->setHelpText(rName);
 
-    ThumbnailView::AppendItem(std::move(pItem));
+    SfxThumbnailView::AppendItem(std::move(pItem));
 
     CalculateItemPositions();
 }
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 996aceae06b4..09d66045ebf4 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -1986,11 +1986,9 @@ void SfxThumbnailView::Paint(vcl::RenderContext& rRenderContext, const ::tools::
     for (size_t i = 0; i < nItemCount; i++)
     {
         ThumbnailViewItem *const pItem = mItemList[i].get();
-
-        if (pItem->isVisible())
-        {
-            pItem->Paint(pProcessor.get(), mpItemAttrs.get());
-        }
+        if (!pItem->isVisible())
+            continue;
+        pItem->Paint(pProcessor.get(), mpItemAttrs.get());
     }
 
     rRenderContext.Pop();
diff --git a/sfx2/uiconfig/ui/emojicontrol.ui b/sfx2/uiconfig/ui/emojicontrol.ui
index ea9d72ccb2ee..7ff1033566da 100644
--- a/sfx2/uiconfig/ui/emojicontrol.ui
+++ b/sfx2/uiconfig/ui/emojicontrol.ui
@@ -1,17 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.2 -->
 <interface domain="sfx">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
-  <object class="GtkWindow" id="emojictrl">
+  <object class="GtkPopover" id="emojictrl">
     <property name="can_focus">False</property>
-    <property name="resizable">False</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="type_hint">popup-menu</property>
-    <property name="skip_pager_hint">True</property>
-    <property name="deletable">False</property>
     <child>
-      <object class="GtkBox" id="box1">
+      <object class="GtkBox" id="container">
         <property name="width_request">350</property>
         <property name="height_request">200</property>
         <property name="visible">True</property>
@@ -19,233 +13,165 @@
         <property name="resize_mode">queue</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkNotebook" id="tabcontrol">
+          <object class="GtkGrid">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="scrollable">True</property>
-            <property name="enable_popup">True</property>
+            <property name="can_focus">False</property>
+            <property name="column_spacing">3</property>
             <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <object class="sfxlo-EmojiView" id="emoji_view">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin">0</property>
-                    <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="people">
-                <property name="width_request">40</property>
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="halign">center</property>
+              <object class="GtkToggleButton" id="people">
                 <property name="label" translatable="no">1f603</property>
-              </object>
-              <packing>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="nature">
-                <property name="width_request">40</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="no">1f43c</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">1</property>
-                <property name="tab_fill">False</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="food">
-                <property name="width_request">40</property>
+              <object class="GtkToggleButton" id="nature">
+                <property name="label" translatable="no">1f43c</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="no">1f34f</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">2</property>
-                <property name="tab_fill">False</property>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="position">3</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="activity">
+              <object class="GtkToggleButton" id="food">
+                <property name="label" translatable="no">1f34f</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="no">1f3c8</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">3</property>
-                <property name="tab_fill">False</property>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="position">4</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="travel">
+              <object class="GtkToggleButton" id="activity">
+                <property name="label" translatable="no">1f3c8</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="no">1f697</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">4</property>
-                <property name="tab_fill">False</property>
+                <property name="left_attach">3</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="position">5</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="objects">
+              <object class="GtkToggleButton" id="travel">
+                <property name="label" translatable="no">1f697</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="no">1f4f1</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">5</property>
-                <property name="tab_fill">False</property>
+                <property name="left_attach">4</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkToggleButton" id="objects">
+                <property name="label" translatable="no">1f4f1</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <placeholder/>
-                </child>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">6</property>
+                <property name="left_attach">5</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
-            <child type="tab">
-              <object class="GtkLabel" id="symbols">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
+            <child>
+              <object class="GtkToggleButton" id="symbols">
                 <property name="label" translatable="no">1f499</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">6</property>
-                <property name="tab_fill">False</property>
+                <property name="left_attach">6</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkToggleButton" id="flags">
+                <property name="label" translatable="no">1f1ee-1f1f3</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <placeholder/>
-                </child>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">7</property>
+                <property name="left_attach">7</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
-            <child type="tab">
-              <object class="GtkLabel" id="flags">
+            <child>
+              <object class="GtkToggleButton" id="unicode9">
+                <property name="label" translatable="no">1f939</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="no">1f1ee-1f1f3</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="position">7</property>
-                <property name="tab_fill">False</property>
+                <property name="left_attach">8</property>
+                <property name="top_attach">0</property>
               </packing>
             </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="emoji_win">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="hscrollbar_policy">never</property>
+            <property name="shadow_type">in</property>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkViewport">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
                 <child>
-                  <placeholder/>
+                  <object class="GtkDrawingArea" id="emoji_view">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                  </object>
                 </child>
               </object>
-              <packing>
-                <property name="position">8</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="unicode9">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="no">1f939</property>
-              </object>
-              <packing>
-                <property name="position">8</property>
-                <property name="tab_fill">False</property>
-              </packing>
             </child>
           </object>
           <packing>
-            <property name="expand">True</property>
+            <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">0</property>
+            <property name="position">1</property>
           </packing>
         </child>
       </object>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index dbd9cf720376..0bbf6ecb66f4 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -523,7 +523,6 @@ constructor_map = {
 custom_widgets = [
     'ContextVBox',
     'DropdownBox',
-    'EmojiView',
     'ManagedMenuButton',
     'PriorityHBox',
     'PriorityMergedHBox',


More information about the Libreoffice-commits mailing list