sfx2/uiconfig/ui/tabbarcontents.ui |  105 ++++++++++++++++++++++---------------
 vcl/qt5/QtInstanceToolbar.cxx      |   12 +++-
 2 files changed, 75 insertions(+), 42 deletions(-)

New commits:
commit 696b453b856330b32a786c6b4e309ad286381b94
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 6 17:43:10 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Feb 7 06:32:16 2026 +0100

    tdf#130857 qt weld: Implement QtInstanceToolbar::set_item_ident
    
    Change-Id: I61c7e30a5d0527151a1c2eb4276a5c780e882328
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198855
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>
    Reviewed-by: Dan Williams <[email protected]>

diff --git a/vcl/qt5/QtInstanceToolbar.cxx b/vcl/qt5/QtInstanceToolbar.cxx
index 1c6709c30cc6..211a492339e5 100644
--- a/vcl/qt5/QtInstanceToolbar.cxx
+++ b/vcl/qt5/QtInstanceToolbar.cxx
@@ -242,9 +242,17 @@ OUString QtInstanceToolbar::get_item_ident(int nIndex) 
const
     return sIdent;
 }
 
-void QtInstanceToolbar::set_item_ident(int, const OUString&)
+void QtInstanceToolbar::set_item_ident(int nIndex, const OUString& rIdent)
 {
-    assert(false && "Not implemented yet");
+    SolarMutexGuard g;
+
+    GetQtInstance().RunInMainThread([&] {
+        QAction* pAction = m_pToolBar->actions().at(nIndex);
+        assert(pAction);
+        QWidget* pWidget = m_pToolBar->widgetForAction(pAction);
+        assert(pWidget);
+        pWidget->setObjectName(toQString(rIdent));
+    });
 }
 
 void QtInstanceToolbar::set_item_label(int, const OUString&)
commit 6ceeffbc73acce50e5060adcc3a111471f369064
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 6 17:30:51 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Feb 7 06:32:06 2026 +0100

    tdf#130857 sfx2: Use GtkDialog instead of GtkWindow for temp parent
    
    The top-level GtkWindow defined in tabbarcontents.ui
    is only a temporary one only used while loading the file,
    but which never gets shown. The sfx2::sidebar::TabBar
    ctor (in sfx2/source/sidebar/TabBar.cxx) moves the
    tab bar contents (widget with ID "TabBarContents")
    to another container anyway and the window it was
    in previously otherwise gets ignored.
    
    So far, QtBuilder doesn't support "GtkWindow", and
    since this one isn't of any relevance either, it
    also doesn't seem worth adding support for it for
    this one. Replace it with a GtkDialog instead.
    
    Whatever the temporary toplevel is doesn't really
    matter, but at least with the gtk3 VCL plugin,
    removing the GtkWindow parent altogether would
    result in
    
        (soffice:2053938): Gtk-CRITICAL **: 15:30:52.342: 
gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
    
    warnings, so keep a dummy toplevel in place.
    
    (The warning is probably related to the fact
    that an accelerator is defined for the
    "locktaskpanel" GtkMenuItem.)
    
    (`git show --ignore-space-change` helps to see
    the "actual" change more easily.)
    
    Change-Id: I59a9ccd6575ed8ac564ca5b7713e4f9865028875
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198850
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sfx2/uiconfig/ui/tabbarcontents.ui 
b/sfx2/uiconfig/ui/tabbarcontents.ui
index 1fb4eaba1cc5..99f7185f2dd1 100644
--- a/sfx2/uiconfig/ui/tabbarcontents.ui
+++ b/sfx2/uiconfig/ui/tabbarcontents.ui
@@ -58,69 +58,94 @@
       </object>
     </child>
   </object>
-  <object class="GtkWindow" id="window">
+  <object class="GtkDialog">
     <property name="can-focus">False</property>
-    <child>
-      <object class="GtkBox" id="toplevel">
-        <property name="visible">True</property>
+    <property name="type-hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox">
         <property name="can-focus">False</property>
-        <property name="orientation">vertical</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox">
+            <property name="can-focus">False</property>
+            <property name="layout-style">end</property>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
-          <object class="GtkBox" id="TabBarContents">
+          <object class="GtkBox" id="toplevel">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
             <property name="orientation">vertical</property>
             <child>
-              <object class="GtkBox">
+              <object class="GtkBox" id="TabBarContents">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
-                <property name="border-width">2</property>
                 <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkMenuButton" id="menubutton">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="can-focus">True</property>
-                    <property name="receives-default">True</property>
-                    <property name="tooltip-text" translatable="yes" 
context="tabbar|menubutton|tool_tip">Sidebar Settings</property>
-                    <property name="halign">center</property>
-                    <property name="valign">center</property>
-                    <property name="margin-bottom">3</property>
-                    <property name="image">image6</property>
-                    <property name="relief">none</property>
-                    <property name="always-show-image">True</property>
-                    <property name="popup">mainmenu</property>
-                    <property name="use-popover">False</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkToolbar" id="measure">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
-                    <property name="halign">center</property>
+                    <property name="can-focus">False</property>
+                    <property name="border-width">2</property>
                     <property name="orientation">vertical</property>
-                    <property name="toolbar-style">icons</property>
-                    <property name="show-arrow">False</property>
                     <child>
-                      <object class="GtkToggleToolButton" id="toggle">
+                      <object class="GtkMenuButton" id="menubutton">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">True</property>
+                        <property name="tooltip-text" translatable="yes" 
context="tabbar|menubutton|tool_tip">Sidebar Settings</property>
+                        <property name="halign">center</property>
+                        <property name="valign">center</property>
+                        <property name="margin-bottom">3</property>
+                        <property name="image">image6</property>
+                        <property name="relief">none</property>
+                        <property name="always-show-image">True</property>
+                        <property name="popup">mainmenu</property>
+                        <property name="use-popover">False</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkToolbar" id="measure">
                         <property name="visible">True</property>
-                        <property name="use-underline">True</property>
-                        <property 
name="icon-name">sfx2/res/symphony/sidebar-property-large.png</property>
+                        <property name="can-focus">True</property>
+                        <property name="halign">center</property>
+                        <property name="orientation">vertical</property>
+                        <property name="toolbar-style">icons</property>
+                        <property name="show-arrow">False</property>
+                        <child>
+                          <object class="GtkToggleToolButton" id="toggle">
+                            <property name="visible">True</property>
+                            <property name="use-underline">True</property>
+                            <property 
name="icon-name">sfx2/res/symphony/sidebar-property-large.png</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="homogeneous">True</property>
+                          </packing>
+                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="homogeneous">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">1</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
               </object>
@@ -134,7 +159,7 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">0</property>
+            <property name="position">1</property>
           </packing>
         </child>
       </object>

Reply via email to