[Libreoffice-commits] core.git: extras/source starmath/inc starmath/source starmath/uiconfig

Caolán McNamara caolanm at redhat.com
Sun Apr 29 16:25:40 UTC 2018


 extras/source/glade/libreoffice-catalog.xml.in |    3 
 starmath/inc/dialog.hxx                        |   29 ++--
 starmath/inc/utility.hxx                       |   13 +-
 starmath/source/dialog.cxx                     |  145 +++++++++++-------------
 starmath/source/document.cxx                   |    8 -
 starmath/source/utility.cxx                    |   42 +++----
 starmath/uiconfig/smath/ui/fonttypedialog.ui   |  149 ++++++++++++-------------
 7 files changed, 192 insertions(+), 197 deletions(-)

New commits:
commit 5b77e676f57bab2de61dc430e8725c447b73354a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Apr 28 21:39:58 2018 +0100

    weld SmFontTypeDialog
    
    Change-Id: I720196ce7359e6e571ecd26c544b9e6a61e17484
    Reviewed-on: https://gerrit.libreoffice.org/53626
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-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 c1565f200584..fcb9c7c7b497 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -27,9 +27,6 @@
     <glade-widget-class title="Search Results Box" name="sfxlo-SearchResultsBox"
                         generic-name="SearchResultsBox" parent="GtkComboBoxText"
                         icon-name="widget-gtk-comboboxtext"/>
-    <glade-widget-class title="Font PickListBox" name="smlo-SmFontPickListBox"
-                        generic-name="SmFontPickListBox" parent="GtkComboBoxText"
-                        icon-name="widget-gtk-comboboxtext"/>
     <glade-widget-class title="Address Control" name="swuilo-SwAddressControlImpl"
                         generic-name="SwAddressControlImpl" parent="GtkComboBoxText"
                         icon-name="widget-gtk-comboboxtext"/>
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index 86d1753d974e..3a63fb264f7a 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -144,27 +144,26 @@ public:
 
 /**************************************************************************/
 
-class SmFontTypeDialog : public ModalDialog
+class SmFontTypeDialog : public weld::GenericDialogController
 {
-    VclPtr<SmFontPickListBox> m_pVariableFont;
-    VclPtr<SmFontPickListBox> m_pFunctionFont;
-    VclPtr<SmFontPickListBox> m_pNumberFont;
-    VclPtr<SmFontPickListBox> m_pTextFont;
-    VclPtr<SmFontPickListBox> m_pSerifFont;
-    VclPtr<SmFontPickListBox> m_pSansFont;
-    VclPtr<SmFontPickListBox> m_pFixedFont;
-    VclPtr<MenuButton> m_pMenuButton;
-    VclPtr<PushButton> m_pDefaultButton;
-
     VclPtr<OutputDevice> pFontListDev;
 
-    DECL_LINK(MenuSelectHdl, Menu *, bool);
-    DECL_LINK(DefaultButtonClickHdl, Button *, void);
+    std::unique_ptr<SmFontPickListBox> m_xVariableFont;
+    std::unique_ptr<SmFontPickListBox> m_xFunctionFont;
+    std::unique_ptr<SmFontPickListBox> m_xNumberFont;
+    std::unique_ptr<SmFontPickListBox> m_xTextFont;
+    std::unique_ptr<SmFontPickListBox> m_xSerifFont;
+    std::unique_ptr<SmFontPickListBox> m_xSansFont;
+    std::unique_ptr<SmFontPickListBox> m_xFixedFont;
+    std::unique_ptr<weld::MenuButton> m_xMenuButton;
+    std::unique_ptr<weld::Button> m_xDefaultButton;
+
+    DECL_LINK(MenuSelectHdl, const OString&, void);
+    DECL_LINK(DefaultButtonClickHdl, weld::Button&, void);
 
 public:
-    SmFontTypeDialog(vcl::Window *pParent, OutputDevice *pFntListDevice);
+    SmFontTypeDialog(weld::Window* pParent, OutputDevice *pFntListDevice);
     virtual ~SmFontTypeDialog() override;
-    virtual void dispose() override;
 
     void ReadFrom(const SmFormat &rFormat);
     void WriteTo (SmFormat &rFormat) const;
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx
index a5a731577655..63871c3877e7 100644
--- a/starmath/inc/utility.hxx
+++ b/starmath/inc/utility.hxx
@@ -26,6 +26,7 @@
 #include <vcl/fixed.hxx>
 #include <vcl/combobox.hxx>
 #include <vcl/lstbox.hxx>
+#include <vcl/weld.hxx>
 #include <tools/fract.hxx>
 #include <deque>
 
@@ -133,17 +134,17 @@ public:
 //  SmFontPickListBox
 
 
-class SmFontPickListBox final : public SmFontPickList, public ListBox
+class SmFontPickListBox final : public SmFontPickList
 {
-    DECL_LINK(SelectHdl, ListBox&, void);
+private:
+    std::unique_ptr<weld::ComboBoxText> m_xWidget;
 
-public:
-    SmFontPickListBox(vcl::Window* pParent, WinBits nBits);
+    DECL_LINK(SelectHdl, weld::ComboBoxText&, void);
 
+public:
+    SmFontPickListBox(weld::ComboBoxText* pWidget);
     SmFontPickListBox& operator = (const SmFontPickList& rList);
-
     virtual void    Insert(const vcl::Font &rFont) override;
-    using   Window::Update;
 };
 
 #endif
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 713f37f9b690..08bbf1300373 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -442,37 +442,50 @@ void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const
     rFormat.RequestApplyChanges();
 }
 
-IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu, bool )
+IMPL_LINK(SmFontTypeDialog, MenuSelectHdl, const OString&, rIdent, void)
 {
     SmFontPickListBox *pActiveListBox;
 
     bool bHideCheckboxes = false;
-    switch (pMenu->GetCurItemId())
+    if (rIdent == "variables")
+        pActiveListBox = m_xVariableFont.get();
+    else if (rIdent == "functions")
+        pActiveListBox = m_xFunctionFont.get();
+    else if (rIdent == "numbers")
+        pActiveListBox = m_xNumberFont.get();
+    else if (rIdent == "text")
+        pActiveListBox = m_xTextFont.get();
+    else if (rIdent == "serif")
     {
-        case 1: pActiveListBox = m_pVariableFont; break;
-        case 2: pActiveListBox = m_pFunctionFont; break;
-        case 3: pActiveListBox = m_pNumberFont;   break;
-        case 4: pActiveListBox = m_pTextFont;     break;
-        case 5: pActiveListBox = m_pSerifFont; bHideCheckboxes = true;   break;
-        case 6: pActiveListBox = m_pSansFont;  bHideCheckboxes = true;   break;
-        case 7: pActiveListBox = m_pFixedFont; bHideCheckboxes = true;   break;
-        default:pActiveListBox = nullptr;
+        pActiveListBox = m_xSerifFont.get();
+        bHideCheckboxes = true;
     }
+    else if (rIdent == "sansserif")
+    {
+        pActiveListBox = m_xSansFont.get();
+        bHideCheckboxes = true;
+    }
+    else if (rIdent == "fixedwidth")
+    {
+        pActiveListBox = m_xFixedFont.get();
+        bHideCheckboxes = true;
+    }
+    else
+        pActiveListBox = nullptr;
 
     if (pActiveListBox)
     {
-        ScopedVclPtrInstance<SmFontDialog> pFontDialog(this, pFontListDev, bHideCheckboxes);
+        ScopedVclPtrInstance<SmFontDialog> pFontDialog(nullptr /*TODO*/, pFontListDev, bHideCheckboxes);
 
         pActiveListBox->WriteTo(*pFontDialog);
         if (pFontDialog->Execute() == RET_OK)
             pActiveListBox->ReadFrom(*pFontDialog);
     }
-    return false;
 }
 
-IMPL_LINK_NOARG( SmFontTypeDialog, DefaultButtonClickHdl, Button *, void )
+IMPL_LINK_NOARG(SmFontTypeDialog, DefaultButtonClickHdl, weld::Button&, void)
 {
-    SaveDefaultsQuery aQuery(GetFrameWeld());
+    SaveDefaultsQuery aQuery(m_xDialog.get());
     if (aQuery.run() == RET_YES)
     {
         SmModule *pp = SM_MOD();
@@ -482,64 +495,46 @@ IMPL_LINK_NOARG( SmFontTypeDialog, DefaultButtonClickHdl, Button *, void )
     }
 }
 
-SmFontTypeDialog::SmFontTypeDialog(vcl::Window * pParent, OutputDevice *pFntListDevice)
-    : ModalDialog(pParent, "FontsDialog", "modules/smath/ui/fonttypedialog.ui"),
-    pFontListDev    (pFntListDevice)
+SmFontTypeDialog::SmFontTypeDialog(weld::Window* pParent, OutputDevice *pFntListDevice)
+    : GenericDialogController(pParent, "modules/smath/ui/fonttypedialog.ui", "FontsDialog")
+    , pFontListDev(pFntListDevice)
+    , m_xVariableFont(new SmFontPickListBox(m_xBuilder->weld_combo_box_text("variableCB")))
+    , m_xFunctionFont(new SmFontPickListBox(m_xBuilder->weld_combo_box_text("functionCB")))
+    , m_xNumberFont(new SmFontPickListBox(m_xBuilder->weld_combo_box_text("numberCB")))
+    , m_xTextFont(new SmFontPickListBox(m_xBuilder->weld_combo_box_text("textCB")))
+    , m_xSerifFont(new SmFontPickListBox(m_xBuilder->weld_combo_box_text("serifCB")))
+    , m_xSansFont(new SmFontPickListBox(m_xBuilder->weld_combo_box_text("sansCB")))
+    , m_xFixedFont(new SmFontPickListBox(m_xBuilder->weld_combo_box_text("fixedCB")))
+    , m_xMenuButton(m_xBuilder->weld_menu_button("modify"))
+    , m_xDefaultButton(m_xBuilder->weld_button("default"))
 {
-    get(m_pVariableFont, "variableCB");
-    get(m_pFunctionFont, "functionCB");
-    get(m_pNumberFont, "numberCB");
-    get(m_pTextFont, "textCB");
-    get(m_pSerifFont, "serifCB");
-    get(m_pSansFont, "sansCB");
-    get(m_pFixedFont, "fixedCB");
-    get(m_pMenuButton, "modify");
-    get(m_pDefaultButton, "default");
-
-    m_pDefaultButton->SetClickHdl(LINK(this, SmFontTypeDialog, DefaultButtonClickHdl));
-
-    m_pMenuButton->GetPopupMenu()->SetSelectHdl(LINK(this, SmFontTypeDialog, MenuSelectHdl));
+    m_xDefaultButton->connect_clicked(LINK(this, SmFontTypeDialog, DefaultButtonClickHdl));
+    m_xMenuButton->connect_selected(LINK(this, SmFontTypeDialog, MenuSelectHdl));
 }
 
 SmFontTypeDialog::~SmFontTypeDialog()
 {
-    disposeOnce();
-}
-
-void SmFontTypeDialog::dispose()
-{
-    m_pVariableFont.clear();
-    m_pFunctionFont.clear();
-    m_pNumberFont.clear();
-    m_pTextFont.clear();
-    m_pSerifFont.clear();
-    m_pSansFont.clear();
-    m_pFixedFont.clear();
-    m_pMenuButton.clear();
-    m_pDefaultButton.clear();
-    pFontListDev.clear();
-    ModalDialog::dispose();
 }
 
 void SmFontTypeDialog::ReadFrom(const SmFormat &rFormat)
 {
     SmModule *pp = SM_MOD();
 
-    *m_pVariableFont = pp->GetConfig()->GetFontPickList(FNT_VARIABLE);
-    *m_pFunctionFont = pp->GetConfig()->GetFontPickList(FNT_FUNCTION);
-    *m_pNumberFont   = pp->GetConfig()->GetFontPickList(FNT_NUMBER);
-    *m_pTextFont     = pp->GetConfig()->GetFontPickList(FNT_TEXT);
-    *m_pSerifFont    = pp->GetConfig()->GetFontPickList(FNT_SERIF);
-    *m_pSansFont     = pp->GetConfig()->GetFontPickList(FNT_SANS);
-    *m_pFixedFont    = pp->GetConfig()->GetFontPickList(FNT_FIXED);
+    *m_xVariableFont = pp->GetConfig()->GetFontPickList(FNT_VARIABLE);
+    *m_xFunctionFont = pp->GetConfig()->GetFontPickList(FNT_FUNCTION);
+    *m_xNumberFont   = pp->GetConfig()->GetFontPickList(FNT_NUMBER);
+    *m_xTextFont     = pp->GetConfig()->GetFontPickList(FNT_TEXT);
+    *m_xSerifFont    = pp->GetConfig()->GetFontPickList(FNT_SERIF);
+    *m_xSansFont     = pp->GetConfig()->GetFontPickList(FNT_SANS);
+    *m_xFixedFont    = pp->GetConfig()->GetFontPickList(FNT_FIXED);
 
-    m_pVariableFont->Insert( rFormat.GetFont(FNT_VARIABLE) );
-    m_pFunctionFont->Insert( rFormat.GetFont(FNT_FUNCTION) );
-    m_pNumberFont->Insert( rFormat.GetFont(FNT_NUMBER) );
-    m_pTextFont->Insert( rFormat.GetFont(FNT_TEXT) );
-    m_pSerifFont->Insert( rFormat.GetFont(FNT_SERIF) );
-    m_pSansFont->Insert( rFormat.GetFont(FNT_SANS) );
-    m_pFixedFont->Insert( rFormat.GetFont(FNT_FIXED) );
+    m_xVariableFont->Insert( rFormat.GetFont(FNT_VARIABLE) );
+    m_xFunctionFont->Insert( rFormat.GetFont(FNT_FUNCTION) );
+    m_xNumberFont->Insert( rFormat.GetFont(FNT_NUMBER) );
+    m_xTextFont->Insert( rFormat.GetFont(FNT_TEXT) );
+    m_xSerifFont->Insert( rFormat.GetFont(FNT_SERIF) );
+    m_xSansFont->Insert( rFormat.GetFont(FNT_SANS) );
+    m_xFixedFont->Insert( rFormat.GetFont(FNT_FIXED) );
 }
 
 
@@ -547,21 +542,21 @@ void SmFontTypeDialog::WriteTo(SmFormat &rFormat) const
 {
     SmModule *pp = SM_MOD();
 
-    pp->GetConfig()->GetFontPickList(FNT_VARIABLE) = *m_pVariableFont;
-    pp->GetConfig()->GetFontPickList(FNT_FUNCTION) = *m_pFunctionFont;
-    pp->GetConfig()->GetFontPickList(FNT_NUMBER)   = *m_pNumberFont;
-    pp->GetConfig()->GetFontPickList(FNT_TEXT)     = *m_pTextFont;
-    pp->GetConfig()->GetFontPickList(FNT_SERIF)    = *m_pSerifFont;
-    pp->GetConfig()->GetFontPickList(FNT_SANS)     = *m_pSansFont;
-    pp->GetConfig()->GetFontPickList(FNT_FIXED)    = *m_pFixedFont;
-
-    rFormat.SetFont( FNT_VARIABLE, m_pVariableFont->Get() );
-    rFormat.SetFont( FNT_FUNCTION, m_pFunctionFont->Get() );
-    rFormat.SetFont( FNT_NUMBER,   m_pNumberFont->Get() );
-    rFormat.SetFont( FNT_TEXT,     m_pTextFont->Get() );
-    rFormat.SetFont( FNT_SERIF,    m_pSerifFont->Get() );
-    rFormat.SetFont( FNT_SANS,     m_pSansFont->Get() );
-    rFormat.SetFont( FNT_FIXED,    m_pFixedFont->Get() );
+    pp->GetConfig()->GetFontPickList(FNT_VARIABLE) = *m_xVariableFont;
+    pp->GetConfig()->GetFontPickList(FNT_FUNCTION) = *m_xFunctionFont;
+    pp->GetConfig()->GetFontPickList(FNT_NUMBER)   = *m_xNumberFont;
+    pp->GetConfig()->GetFontPickList(FNT_TEXT)     = *m_xTextFont;
+    pp->GetConfig()->GetFontPickList(FNT_SERIF)    = *m_xSerifFont;
+    pp->GetConfig()->GetFontPickList(FNT_SANS)     = *m_xSansFont;
+    pp->GetConfig()->GetFontPickList(FNT_FIXED)    = *m_xFixedFont;
+
+    rFormat.SetFont( FNT_VARIABLE, m_xVariableFont->Get() );
+    rFormat.SetFont( FNT_FUNCTION, m_xFunctionFont->Get() );
+    rFormat.SetFont( FNT_NUMBER,   m_xNumberFont->Get() );
+    rFormat.SetFont( FNT_TEXT,     m_xTextFont->Get() );
+    rFormat.SetFont( FNT_SERIF,    m_xSerifFont->Get() );
+    rFormat.SetFont( FNT_SANS,     m_xSansFont->Get() );
+    rFormat.SetFont( FNT_FIXED,    m_xFixedFont->Get() );
 
     rFormat.RequestApplyChanges();
 }
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index b11eb4545618..191eb7b07ccb 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -928,15 +928,15 @@ void SmDocShell::Execute(SfxRequest& rReq)
                 pDev = &SM_MOD()->GetDefaultVirtualDev();
             OSL_ENSURE (pDev, "device for font list missing" );
 
-            VclPtrInstance< SmFontTypeDialog > xFontTypeDialog( nullptr, pDev );
+            SmFontTypeDialog aFontTypeDialog(rReq.GetFrameWeld(), pDev);
 
             SmFormat aOldFormat  = GetFormat();
-            xFontTypeDialog->ReadFrom( aOldFormat );
-            if (xFontTypeDialog->Execute() == RET_OK)
+            aFontTypeDialog.ReadFrom( aOldFormat );
+            if (aFontTypeDialog.run() == RET_OK)
             {
                 SmFormat aNewFormat( aOldFormat );
 
-                xFontTypeDialog->WriteTo(aNewFormat);
+                aFontTypeDialog.WriteTo(aNewFormat);
                 ::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
                 if (pTmpUndoMgr)
                     pTmpUndoMgr->AddUndoAction(
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 05ff9a2d9b5c..015257bc3527 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -120,30 +120,27 @@ void SmFontPickList::WriteTo(SmFontDialog& rDialog) const
 
 /**************************************************************************/
 
-VCL_BUILDER_FACTORY_ARGS(SmFontPickListBox, WB_DROPDOWN)
-
-SmFontPickListBox::SmFontPickListBox (vcl::Window* pParent, WinBits nBits) :
-    SmFontPickList(4),
-    ListBox(pParent, nBits)
+SmFontPickListBox::SmFontPickListBox(weld::ComboBoxText* pWidget)
+    : SmFontPickList(4)
+    , m_xWidget(pWidget)
 {
-    SetSelectHdl(LINK(this, SmFontPickListBox, SelectHdl));
+    m_xWidget->connect_changed(LINK(this, SmFontPickListBox, SelectHdl));
 }
 
-IMPL_LINK_NOARG( SmFontPickListBox, SelectHdl, ListBox&, void )
+IMPL_LINK_NOARG(SmFontPickListBox, SelectHdl, weld::ComboBoxText&, void)
 {
     OUString aString;
 
-    const sal_Int32 nPos = GetSelectedEntryPos();
-
+    const int nPos = m_xWidget->get_active();
     if (nPos != 0)
     {
         SmFontPickList::Insert(Get(nPos));
-        aString = GetEntry(nPos);
-        RemoveEntry(nPos);
-        InsertEntry(aString, 0);
+        aString = m_xWidget->get_text(nPos);
+        m_xWidget->remove(nPos);
+        m_xWidget->insert_text(0, aString);
     }
 
-    SelectEntryPos(0);
+    m_xWidget->set_active(0);
 }
 
 SmFontPickListBox& SmFontPickListBox::operator=(const SmFontPickList& rList)
@@ -151,10 +148,10 @@ SmFontPickListBox& SmFontPickListBox::operator=(const SmFontPickList& rList)
     *static_cast<SmFontPickList *>(this) = rList;
 
     for (decltype(aFontVec)::size_type nPos = 0; nPos < aFontVec.size(); nPos++)
-        InsertEntry(lcl_GetStringItem(aFontVec[nPos]), nPos);
+        m_xWidget->insert_text(nPos, lcl_GetStringItem(aFontVec[nPos]));
 
     if (!aFontVec.empty())
-        SelectEntry(lcl_GetStringItem(aFontVec.front()));
+        m_xWidget->set_active_text(lcl_GetStringItem(aFontVec.front()));
 
     return *this;
 }
@@ -163,15 +160,17 @@ void SmFontPickListBox::Insert(const vcl::Font &rFont)
 {
     SmFontPickList::Insert(rFont);
 
-    RemoveEntry(lcl_GetStringItem(aFontVec.front()));
-    InsertEntry(lcl_GetStringItem(aFontVec.front()), 0);
-    SelectEntry(lcl_GetStringItem(aFontVec.front()));
+    OUString aEntry(lcl_GetStringItem(aFontVec.front()));
+    int nPos = m_xWidget->find_text(aEntry);
+    if (nPos != -1)
+        m_xWidget->remove(nPos);
+    m_xWidget->insert_text(0, aEntry);
+    m_xWidget->set_active(0);
 
-    while (GetEntryCount() > nMaxItems)
-        RemoveEntry(GetEntryCount() - 1);
+    while (m_xWidget->get_count() > nMaxItems)
+        m_xWidget->remove(m_xWidget->get_count() - 1);
 }
 
-
 bool IsItalic( const vcl::Font &rFont )
 {
     FontItalic eItalic = rFont.GetItalic();
@@ -241,5 +240,4 @@ SmFace & operator *= (SmFace &rFace, const Fraction &rFrac)
     return rFace;
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/uiconfig/smath/ui/fonttypedialog.ui b/starmath/uiconfig/smath/ui/fonttypedialog.ui
index 84fa1b94a0c1..6c200603f41d 100644
--- a/starmath/uiconfig/smath/ui/fonttypedialog.ui
+++ b/starmath/uiconfig/smath/ui/fonttypedialog.ui
@@ -1,8 +1,67 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
 <interface domain="sm">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkMenu" id="menu1">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="variables">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="fonttypedialog|menuitem1">_Variables</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="functions">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="fonttypedialog|menuitem2">_Functions</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="numbers">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="fonttypedialog|menuitem3">_Numbers</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="text">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="fonttypedialog|menuitem4">_Text</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="serif">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="fonttypedialog|menuitem5">_Serif</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="sansserif">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="fonttypedialog|menuitem6">S_ans-serif</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="fixedwidth">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="fonttypedialog|menuitem7">Fixe_d-width</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
   <object class="GtkDialog" id="FontsDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
@@ -20,12 +79,17 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="modify:menu1">
+              <object class="GtkMenuButton" id="modify">
                 <property name="label" translatable="yes" context="fonttypedialog|modify">_Modify</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_underline">True</property>
+                <property name="popup">menu1</property>
+                <property name="use_popover">False</property>
+                <child>
+                  <placeholder/>
+                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -197,7 +261,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="smlo-SmFontPickListBox" id="variableCB">
+                          <object class="GtkComboBoxText" id="variableCB">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
@@ -208,7 +272,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="smlo-SmFontPickListBox" id="functionCB">
+                          <object class="GtkComboBoxText" id="functionCB">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
@@ -219,7 +283,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="smlo-SmFontPickListBox" id="numberCB">
+                          <object class="GtkComboBoxText" id="numberCB">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
@@ -230,7 +294,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="smlo-SmFontPickListBox" id="textCB">
+                          <object class="GtkComboBoxText" id="textCB">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
@@ -333,7 +397,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="smlo-SmFontPickListBox" id="serifCB">
+                          <object class="GtkComboBoxText" id="serifCB">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
@@ -344,7 +408,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="smlo-SmFontPickListBox" id="sansCB">
+                          <object class="GtkComboBoxText" id="sansCB">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
@@ -355,7 +419,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="smlo-SmFontPickListBox" id="fixedCB">
+                          <object class="GtkComboBoxText" id="fixedCB">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
@@ -396,12 +460,13 @@
       </object>
     </child>
     <action-widgets>
-      <action-widget response="0">modify:menu1</action-widget>
       <action-widget response="-11">help</action-widget>
-      <action-widget response="0">default</action-widget>
       <action-widget response="-5">ok</action-widget>
       <action-widget response="-6">cancel</action-widget>
     </action-widgets>
+    <child>
+      <placeholder/>
+    </child>
   </object>
   <object class="GtkSizeGroup" id="sizegroup1">
     <widgets>
@@ -414,64 +479,4 @@
       <widget name="label7"/>
     </widgets>
   </object>
-  <object class="GtkMenu" id="menu1">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <child>
-      <object class="GtkMenuItem" id="menuitem1">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes" context="fonttypedialog|menuitem1">_Variables</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="menuitem2">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes" context="fonttypedialog|menuitem2">_Functions</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="menuitem3">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes" context="fonttypedialog|menuitem3">_Numbers</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="menuitem4">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes" context="fonttypedialog|menuitem4">_Text</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="menuitem5">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes" context="fonttypedialog|menuitem5">_Serif</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="menuitem6">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes" context="fonttypedialog|menuitem6">S_ans-serif</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="menuitem7">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes" context="fonttypedialog|menuitem7">Fixe_d-width</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-  </object>
 </interface>


More information about the Libreoffice-commits mailing list