svx/source/tbxctrls/tbcontrl.cxx  |   12 ------------
 svx/uiconfig/ui/currencywindow.ui |   29 +----------------------------
 2 files changed, 1 insertion(+), 40 deletions(-)

New commits:
commit 8a03a31393ab814b96c893ec9b906367fac4fe5e
Author:     Szymon Kłos <[email protected]>
AuthorDate: Tue Jan 7 13:58:11 2025 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Jan 7 23:19:05 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 <[email protected]>
    Change-Id: Ib5ad5509f99466710cd898bf0baedeac8fdb49ab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179886
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index cec2c181140a..0d4951f2f921 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3898,16 +3898,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;
 
@@ -3915,9 +3912,7 @@ namespace
         SvxCurrencyList_Impl(SvxCurrencyToolBoxControl* pControl, 
weld::Widget* pParent, OUString& rSelectedFormat, LanguageType& 
eSelectedLanguage)
             : WeldToolbarPopup(pControl->getFrameInterface(), pParent, 
"svx/ui/currencywindow.ui", "CurrencyWindow")
             , m_xControl(pControl)
-            , m_xLabel(m_xBuilder->weld_label("label"))
             , m_xCurrencyLb(m_xBuilder->weld_tree_view("currency"))
-            , m_xOkBtn(m_xBuilder->weld_button("ok"))
             , m_rSelectedFormat(rSelectedFormat)
             , m_eSelectedLanguage(eSelectedLanguage)
         {
@@ -3984,9 +3979,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
@@ -4001,11 +3994,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 c58a0c49226d..c65ce6763b03 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