svx/source/tbxctrls/tbcontrl.cxx  |   12 ------------
 svx/uiconfig/ui/currencywindow.ui |   29 +----------------------------
 vcl/inc/jsdialog/enabled.hxx      |    2 ++
 vcl/jsdialog/enabled.cxx          |   14 ++++++++++++++
 vcl/source/window/builder.cxx     |    4 ++++
 5 files changed, 21 insertions(+), 40 deletions(-)

New commits:
commit 3b8b8d6a6c0ea871b6beb4d056949bbd4503a33c
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Mar 4 08:38:13 2025 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Mar 5 11:26:42 2025 +0100

    jsdialogs: warn if not used in lok
    
    - it will be easier to spot missing ui file
    - add ignore list to not spam
    
    Change-Id: I2aabadfd0fa04732e7a7346dbb082d4ca5f01a98
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182453
    (cherry picked from commit 126fb266713cf6cdf4a5bfa49f927516ce8d5d15)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182508
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/vcl/inc/jsdialog/enabled.hxx b/vcl/inc/jsdialog/enabled.hxx
index 5c85f310f155..fc61a9dba8fc 100644
--- a/vcl/inc/jsdialog/enabled.hxx
+++ b/vcl/inc/jsdialog/enabled.hxx
@@ -13,6 +13,8 @@
 
 namespace jsdialog
 {
+/// used to not warn about it
+bool isIgnored(std::u16string_view rUIFile);
 bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile);
 bool isBuilderEnabledForPopup(std::u16string_view rUIFile);
 bool isBuilderEnabledForMenu(std::u16string_view rUIFile);
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index f474ca505c16..45fff2d6fc5d 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -13,6 +13,20 @@
 
 namespace jsdialog
 {
+bool isIgnored(std::u16string_view rUIFile)
+{
+    if (rUIFile == u"sfx/ui/deck.ui"
+        || rUIFile == u"svt/ui/scrollbars.ui"
+        || rUIFile == u"svx/ui/selectionmenu.ui"
+        || rUIFile == u"svx/ui/stylemenu.ui"
+        || rUIFile == u"svt/ui/tabbuttons.ui"
+        || rUIFile == u"svx/ui/toolbarpopover.ui"
+        || rUIFile == u"svx/ui/toolbarpopover.ui")
+        return true;
+
+    return false;
+}
+
 bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile)
 {
     // mobile only dialogs
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index fd2821d1d7ca..97df7bd8d9df 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -197,6 +197,8 @@ std::unique_ptr<weld::Builder> 
Application::CreateBuilder(weld::Widget* pParent,
             return JSInstanceBuilder::CreateMenuBuilder(pParent, 
AllSettings::GetUIRootDir(), rUIFile);
         else if (jsdialog::isBuilderEnabled(rUIFile, bMobile))
             return JSInstanceBuilder::CreateDialogBuilder(pParent, 
AllSettings::GetUIRootDir(), rUIFile);
+        else if (!jsdialog::isIgnored(rUIFile))
+            SAL_WARN("vcl", "UI file not enabled for JSDialogs: " << rUIFile);
     }
 
     return ImplGetSVData()->mpDefInst->CreateBuilder(pParent, 
AllSettings::GetUIRootDir(), rUIFile);
@@ -215,6 +217,8 @@ std::unique_ptr<weld::Builder> 
Application::CreateInterimBuilder(vcl::Window* pP
         else if (jsdialog::isBuilderEnabledForAddressInput(rUIFile))
             return JSInstanceBuilder::CreateAddressInputBuilder(
                 pParent, AllSettings::GetUIRootDir(), rUIFile, nLOKWindowId);
+        else if (!jsdialog::isIgnored(rUIFile))
+            SAL_WARN("vcl", "UI file not enabled for JSDialogs: " << rUIFile);
     }
 
     return ImplGetSVData()->mpDefInst->CreateInterimBuilder(pParent, 
AllSettings::GetUIRootDir(), rUIFile, bAllowCycleFocusOut, nLOKWindowId);
commit f3ef8a54ace48d15ea24b3b5df3f655cb57679f5
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Jan 7 13:58:11 2025 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Mar 5 11:26:36 2025 +0100

    Improve UX of currency dropdown
    
    - single click activation
    - no additional ok button in the dropdown
    - no label
    
    It's not common that dropdown has to be confirmed using button
    
    Signed-off-by: Szymon Kłos <szymon.k...@collabora.com>
    Change-Id: Ib5ad5509f99466710cd898bf0baedeac8fdb49ab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182512
    Tested-by: Jenkins

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index fe45a36c4137..f16e57ba609c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3913,16 +3913,13 @@ namespace
     {
     private:
         rtl::Reference<SvxCurrencyToolBoxControl> m_xControl;
-        std::unique_ptr<weld::Label> m_xLabel;
         std::unique_ptr<weld::TreeView> m_xCurrencyLb;
-        std::unique_ptr<weld::Button> m_xOkBtn;
         OUString&       m_rSelectedFormat;
         LanguageType&   m_eSelectedLanguage;
 
         std::vector<OUString> m_aFormatEntries;
         LanguageType          m_eFormatLanguage;
         DECL_LINK(RowActivatedHdl, weld::TreeView&, bool);
-        DECL_LINK(OKHdl, weld::Button&, void);
 
         virtual void GrabFocus() override;
 
@@ -3930,9 +3927,7 @@ namespace
         SvxCurrencyList_Impl(SvxCurrencyToolBoxControl* pControl, 
weld::Widget* pParent, OUString& rSelectedFormat, LanguageType& 
eSelectedLanguage)
             : WeldToolbarPopup(pControl->getFrameInterface(), pParent, 
u"svx/ui/currencywindow.ui"_ustr, u"CurrencyWindow"_ustr)
             , m_xControl(pControl)
-            , m_xLabel(m_xBuilder->weld_label(u"label"_ustr))
             , m_xCurrencyLb(m_xBuilder->weld_tree_view(u"currency"_ustr))
-            , m_xOkBtn(m_xBuilder->weld_button(u"ok"_ustr))
             , m_rSelectedFormat(rSelectedFormat)
             , m_eSelectedLanguage(eSelectedLanguage)
         {
@@ -3999,9 +3994,7 @@ namespace
             // enable multiple selection enabled so we can start with nothing 
selected
             m_xCurrencyLb->set_selection_mode(SelectionMode::Multiple);
             m_xCurrencyLb->connect_row_activated( LINK( this, 
SvxCurrencyList_Impl, RowActivatedHdl ) );
-            m_xLabel->set_label(SvxResId(RID_SVXSTR_TBLAFMT_CURRENCY));
             m_xCurrencyLb->select( nSelectedPos );
-            m_xOkBtn->connect_clicked(LINK(this, SvxCurrencyList_Impl, OKHdl));
 
             // gtk will initially make a best guess depending on the first few 
entries, so copy the probable
             // longest entry to the start temporarily and force in the width 
at this point
@@ -4016,11 +4009,6 @@ namespace
         m_xCurrencyLb->grab_focus();
     }
 
-    IMPL_LINK_NOARG(SvxCurrencyList_Impl, OKHdl, weld::Button&, void)
-    {
-        RowActivatedHdl(*m_xCurrencyLb);
-    }
-
     IMPL_LINK_NOARG(SvxCurrencyList_Impl, RowActivatedHdl, weld::TreeView&, 
bool)
     {
         if (!m_xControl.is())
diff --git a/svx/uiconfig/ui/currencywindow.ui 
b/svx/uiconfig/ui/currencywindow.ui
index 7f0008888338..141652b52981 100644
--- a/svx/uiconfig/ui/currencywindow.ui
+++ b/svx/uiconfig/ui/currencywindow.ui
@@ -21,20 +21,6 @@
         <property name="can-focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
-        <child>
-          <object class="GtkLabel" id="label">
-            <property name="visible">True</property>
-            <property name="can-focus">False</property>
-            <property name="use-underline">True</property>
-            <property name="mnemonic-widget">currency</property>
-            <property name="xalign">0</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkScrolledWindow">
             <property name="visible">True</property>
@@ -45,6 +31,7 @@
             <property name="shadow-type">in</property>
             <child>
               <object class="GtkTreeView" id="currency">
+                <property name="activate_on_single_click">True</property>
                 <property name="visible">True</property>
                 <property name="can-focus">True</property>
                 <property name="hexpand">True</property>
@@ -76,20 +63,6 @@
             <property name="position">1</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkButton" id="ok">
-            <property name="label" translatable="yes" 
context="stock">_OK</property>
-            <property name="visible">True</property>
-            <property name="can-focus">True</property>
-            <property name="receives-default">True</property>
-            <property name="use-underline">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>

Reply via email to