[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue May 18 09:28:53 UTC 2021


 vcl/unx/gtk3/gtkinst.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 0e2389ee8df51c388fa2db441b5b45cdaf6e3417
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue May 18 09:19:18 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue May 18 11:28:14 2021 +0200

    gtk4: use gtk_text_set_activates_default on GtkSpinButton
    
    so it continues to activate-default like it did in our gtk3 usage
    
    Change-Id: I6ef5eacf54faea4fb4985545461ea617db29296f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115729
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 28168543e318..b1b3f7dfc9f6 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -10054,9 +10054,10 @@ namespace
 
 class GtkInstanceEditable : public GtkInstanceWidget, public virtual weld::Entry
 {
-private:
+protected:
     GtkEditable* m_pEditable;
     GtkWidget* m_pDelegate;
+private:
     std::unique_ptr<vcl::Font> m_xFont;
     gulong m_nChangedSignalId;
     gulong m_nInsertTextSignalId;
@@ -13856,6 +13857,9 @@ public:
         , m_bBlockOutput(false)
         , m_bBlank(false)
     {
+#if GTK_CHECK_VERSION(4, 0, 0)
+          gtk_text_set_activates_default(GTK_TEXT(m_pDelegate), true);
+#endif
     }
 
     virtual int get_value() const override
@@ -13880,7 +13884,7 @@ public:
         if (!m_bFormatting)
         {
 #if GTK_CHECK_VERSION(4, 0, 0)
-            gtk_editable_set_text(GTK_EDITABLE(m_pButton), OUStringToOString(rText, RTL_TEXTENCODING_UTF8).getStr());
+            gtk_editable_set_text(m_pEditable, OUStringToOString(rText, RTL_TEXTENCODING_UTF8).getStr());
 #else
             gtk_entry_set_text(GTK_ENTRY(m_pButton), OUStringToOString(rText, RTL_TEXTENCODING_UTF8).getStr());
 #endif
@@ -13896,7 +13900,7 @@ public:
             if (!bKeepBlank)
             {
 #if GTK_CHECK_VERSION(4, 0, 0)
-                gtk_editable_set_text(GTK_EDITABLE(m_pButton), OUStringToOString(rText, RTL_TEXTENCODING_UTF8).getStr());
+                gtk_editable_set_text(m_pEditable, OUStringToOString(rText, RTL_TEXTENCODING_UTF8).getStr());
 #else
                 gtk_entry_set_text(GTK_ENTRY(m_pButton), OUStringToOString(rText, RTL_TEXTENCODING_UTF8).getStr());
 #endif


More information about the Libreoffice-commits mailing list