[Libreoffice-commits] core.git: extras/source include/sfx2 include/vcl sd/Library_sd.mk sd/source sd/uiconfig sd/UIConfig_simpress.mk sfx2/source vcl/inc vcl/source

Szymon Kłos eszkadev at gmail.com
Tue Jun 28 07:53:50 UTC 2016


 extras/source/glade/libreoffice-catalog.xml.in             |    3 
 include/sfx2/notebookbar/SfxNotebookBar.hxx                |    2 
 include/vcl/syswin.hxx                                     |    1 
 sd/Library_sd.mk                                           |    1 
 sd/UIConfig_simpress.mk                                    |    1 
 sd/source/ui/animations/SlideTransitionBox.cxx             |   83 ++++
 sd/source/ui/animations/SlideTransitionPane.cxx            |   43 +-
 sd/source/ui/animations/SlideTransitionPane.hxx            |  146 -------
 sd/source/ui/inc/SlideTransitionPane.hxx                   |  155 +++++++
 sd/source/ui/view/ViewShellBase.cxx                        |    4 
 sd/uiconfig/simpress/ui/notebookbar.ui                     |   34 +
 sd/uiconfig/simpress/ui/slidetransitionspanelhorizontal.ui |  263 +++++++++++++
 sfx2/source/notebookbar/SfxNotebookBar.cxx                 |    7 
 vcl/inc/brdwin.hxx                                         |    1 
 vcl/source/window/brdwin.cxx                               |    8 
 vcl/source/window/syswin.cxx                               |    6 
 16 files changed, 603 insertions(+), 155 deletions(-)

New commits:
commit c4e0d6596da5ef2aa040b9974aac987c6a93bb6d
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Thu Jun 2 15:43:45 2016 +0200

    notebookbar: added slide transition tab
    
    - created VclVBox control which creates SlideTransitionPane
    - SlideTransitionPane extended with second constructor
      which loads ui in horizontal mode
    - introduced CloseMethod for NotebookBar to kill widgets in right order
    
    Change-Id: Ic3ba35cb7734aa744a4804c5b670fed7c1bec204
    Reviewed-on: https://gerrit.libreoffice.org/25844
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 3b322ae..4dd4593 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -807,5 +807,8 @@
     <glade-widget-class title="Notebookbar with context" name="vcllo-ContextTabControl"
                         generic-name="ContextTabControl" parent="GtkNotebook"
                         icon-name="widget-gtk-notebook"/>
+    <glade-widget-class title="Slide Transition Pane" name="sdlo-SlideTransitionBox"
+                        generic-name="ShowText" parent="GtkToolButton"
+                        icon-name="widget-gtk-toolbutton"/>
   </glade-widget-classes>
 </glade-catalog>
diff --git a/include/sfx2/notebookbar/SfxNotebookBar.hxx b/include/sfx2/notebookbar/SfxNotebookBar.hxx
index 1b79c78..e68d3f1 100644
--- a/include/sfx2/notebookbar/SfxNotebookBar.hxx
+++ b/include/sfx2/notebookbar/SfxNotebookBar.hxx
@@ -21,6 +21,8 @@ namespace sfx2 {
 class SFX2_DLLPUBLIC SfxNotebookBar
 {
 public:
+    static void CloseMethod(SfxBindings& rBindings);
+
     /// Function to be called from the sdi's ExecMethod.
     static void ExecMethod(SfxBindings& rBindings);
 
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 4c525e7..3ea4dcb 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -242,6 +242,7 @@ public:
     void            SetMenuBarMode( MenuBarMode nMode );
 
     void            SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
+    void            CloseNotebookBar();
     VclPtr<NotebookBar> GetNotebookBar() const;
 
     TaskPaneList*   GetTaskPaneList();
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index ae04336..eab6571 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -180,6 +180,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
 	sd/source/ui/animations/CustomAnimationPane \
 	sd/source/ui/animations/STLPropertySet \
 	sd/source/ui/animations/SlideTransitionPane \
+	sd/source/ui/animations/SlideTransitionBox \
 	sd/source/ui/animations/motionpathtag \
 	sd/source/ui/annotations/annotationmanager \
 	sd/source/ui/annotations/annotationtag \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index 0309c75..ef79c95 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -130,6 +130,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
 	sd/uiconfig/simpress/ui/sidebarslidebackground \
 	sd/uiconfig/simpress/ui/slidedesigndialog \
 	sd/uiconfig/simpress/ui/slidetransitionspanel \
+	sd/uiconfig/simpress/ui/slidetransitionspanelhorizontal \
 	sd/uiconfig/simpress/ui/tabledesignpanel \
 	sd/uiconfig/simpress/ui/templatedialog \
 ))
diff --git a/sd/source/ui/animations/SlideTransitionBox.cxx b/sd/source/ui/animations/SlideTransitionBox.cxx
new file mode 100644
index 0000000..29c3d4f
--- /dev/null
+++ b/sd/source/ui/animations/SlideTransitionBox.cxx
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "ViewShellBase.hxx"
+#include <DrawDocShell.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <SlideTransitionPane.hxx>
+#include <vcl/builderfactory.hxx>
+#include <vcl/layout.hxx>
+
+namespace sd
+{
+
+class SlideTransitionBox : public VclVBox
+{
+    VclPtr<SlideTransitionPane> m_pPane;
+    bool m_bIsInitialized;
+
+public:
+    SlideTransitionBox(vcl::Window* pParent);
+    ~SlideTransitionBox();
+
+    virtual void dispose() override;
+    virtual void StateChanged(StateChangedType nStateChange) override;
+};
+
+VCL_BUILDER_FACTORY(SlideTransitionBox);
+
+SlideTransitionBox::SlideTransitionBox(vcl::Window* pParent)
+    : VclVBox(pParent)
+    , m_bIsInitialized(false)
+{
+}
+
+SlideTransitionBox::~SlideTransitionBox()
+{
+    disposeOnce();
+}
+
+void SlideTransitionBox::dispose()
+{
+    m_pPane.disposeAndClear();
+    VclVBox::dispose();
+}
+
+void SlideTransitionBox::StateChanged(StateChangedType nStateChange)
+{
+    if(SfxViewFrame::Current() && !m_bIsInitialized)
+    {
+        ViewShellBase* pBase = ViewShellBase::GetViewShellBase(SfxViewFrame::Current());
+
+        if(pBase && pBase->GetDocShell())
+        {
+            css::uno::Reference<css::frame::XFrame> xFrame;
+            SdDrawDocument* pDoc = pBase->GetDocShell()->GetDoc();
+            m_pPane = VclPtr<SlideTransitionPane>::Create(this, *pBase, pDoc, xFrame, false);
+            m_pPane->Show();
+            m_pPane->SetSizePixel(GetSizePixel());
+            m_bIsInitialized = true;
+        }
+    }
+    VclVBox::StateChanged(nStateChange);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 1778f13..174d83f 100755
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -404,8 +404,33 @@ SlideTransitionPane::SlideTransitionPane(
         mbHasSelection( false ),
         mbUpdatingControls( false ),
         mbIsMainViewChangePending( false ),
+        mbHorizontalLayout( false ),
         maLateInitTimer()
 {
+    Initialize(pDoc);
+}
+
+SlideTransitionPane::SlideTransitionPane(
+    Window * pParent,
+    ViewShellBase & rBase,
+    SdDrawDocument* pDoc,
+    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    bool /*bHorizontalLayout*/ ) :
+        PanelLayout( pParent, "SlideTransitionsPanel", "modules/simpress/ui/slidetransitionspanelhorizontal.ui", rxFrame ),
+
+        mrBase( rBase ),
+        mpDrawDoc( pDoc ),
+        mbHasSelection( false ),
+        mbUpdatingControls( false ),
+        mbIsMainViewChangePending( false ),
+        mbHorizontalLayout( true ),
+        maLateInitTimer()
+{
+    Initialize(pDoc);
+}
+
+void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
+{
     get(mpFT_VARIANT, "variant_label");
     get(mpLB_VARIANT, "variant_list");
     get(mpFT_duration, "duration_label");
@@ -511,9 +536,16 @@ void SlideTransitionPane::DataChanged (const DataChangedEvent& rEvent)
 
 void SlideTransitionPane::UpdateLook()
 {
-    SetBackground(::sfx2::sidebar::Theme::GetWallpaper(::sfx2::sidebar::Theme::Paint_PanelBackground));
-    mpFT_duration->SetBackground(Wallpaper());
-    mpFT_SOUND->SetBackground(Wallpaper());
+    if( mbHorizontalLayout )
+    {
+        SetBackground(Wallpaper());
+    }
+    else
+    {
+        SetBackground(::sfx2::sidebar::Theme::GetWallpaper(::sfx2::sidebar::Theme::Paint_PanelBackground));
+        mpFT_duration->SetBackground(Wallpaper());
+        mpFT_SOUND->SetBackground(Wallpaper());
+    }
 }
 
 void SlideTransitionPane::onSelectionChanged()
@@ -981,6 +1013,11 @@ IMPL_LINK_TYPED(SlideTransitionPane,EventMultiplexerListener,
             break;
 
         default:
+            if (rEvent.meEventId != tools::EventMultiplexerEvent::EID_DISPOSING)
+            {
+                onSelectionChanged();
+                onChangeCurrentPage();
+            }
             break;
     }
 }
diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/inc/SlideTransitionPane.hxx
similarity index 93%
rename from sd/source/ui/animations/SlideTransitionPane.hxx
rename to sd/source/ui/inc/SlideTransitionPane.hxx
index 9407ad1..e5da099 100755
--- a/sd/source/ui/animations/SlideTransitionPane.hxx
+++ b/sd/source/ui/inc/SlideTransitionPane.hxx
@@ -58,6 +58,12 @@ public:
         ViewShellBase & rBase,
         SdDrawDocument* pDoc,
         const css::uno::Reference<css::frame::XFrame>& rxFrame );
+    explicit SlideTransitionPane(
+        Window * pParent,
+        ViewShellBase & rBase,
+        SdDrawDocument* pDoc,
+        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+        bool bHorizontalLayout );
     virtual ~SlideTransitionPane();
     virtual void dispose() override;
 
@@ -88,6 +94,8 @@ private:
 
     void UpdateLook();
 
+    void Initialize(SdDrawDocument* pDoc);
+
     DECL_LINK_TYPED( ApplyToAllButtonClicked, Button*, void );
     DECL_LINK_TYPED( PlayButtonClicked, Button*, void );
     DECL_LINK_TYPED( AutoPreviewClicked, Button*, void );
@@ -127,6 +135,7 @@ private:
     bool         mbHasSelection;
     bool         mbUpdatingControls;
     bool         mbIsMainViewChangePending;
+    bool         mbHorizontalLayout;
 
     typedef ::std::vector< OUString > tSoundListType;
     tSoundListType  maSoundList;
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 340948a..2df5ad5 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -83,6 +83,8 @@
 #include <vcl/msgbox.hxx>
 #include <vcl/settings.hxx>
 
+#include <sfx2/notebookbar/SfxNotebookBar.hxx>
+
 #include <tools/diagnose_ex.h>
 
 #include "fubullet.hxx"
@@ -768,6 +770,8 @@ bool ViewShellBase::PrepareClose (bool bUI)
 
     if (bResult)
     {
+        sfx2::SfxNotebookBar::CloseMethod(GetFrame()->GetBindings());
+
         mpImpl->mbIsClosing = true;
 
         // Forward call to main sub shell.
diff --git a/sd/uiconfig/simpress/ui/notebookbar.ui b/sd/uiconfig/simpress/ui/notebookbar.ui
index da12749..4bc8d84 100644
--- a/sd/uiconfig/simpress/ui/notebookbar.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar.ui
@@ -1880,6 +1880,28 @@
               </packing>
             </child>
             <child>
+              <object class="sdlo-SlideTransitionBox" id="SlideTransitionBox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="is_important">True</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="TransitionsLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Transitions</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkBox" id="SlideShowBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
@@ -2029,7 +2051,7 @@
                 </child>
               </object>
               <packing>
-                <property name="position">3</property>
+                <property name="position">4</property>
               </packing>
             </child>
             <child type="tab">
@@ -2039,7 +2061,7 @@
                 <property name="label" translatable="yes">Slide Show</property>
               </object>
               <packing>
-                <property name="position">3</property>
+                <property name="position">4</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
@@ -2167,7 +2189,7 @@
                 </child>
               </object>
               <packing>
-                <property name="position">4</property>
+                <property name="position">5</property>
               </packing>
             </child>
             <child type="tab">
@@ -2177,7 +2199,7 @@
                 <property name="label" translatable="yes">Review</property>
               </object>
               <packing>
-                <property name="position">4</property>
+                <property name="position">5</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
@@ -2541,7 +2563,7 @@
                 </child>
               </object>
               <packing>
-                <property name="position">5</property>
+                <property name="position">6</property>
               </packing>
             </child>
             <child type="tab">
@@ -2551,7 +2573,7 @@
                 <property name="label" translatable="yes">View</property>
               </object>
               <packing>
-                <property name="position">5</property>
+                <property name="position">6</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
diff --git a/sd/uiconfig/simpress/ui/slidetransitionspanelhorizontal.ui b/sd/uiconfig/simpress/ui/slidetransitionspanelhorizontal.ui
new file mode 100755
index 0000000..652bdf8
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/slidetransitionspanelhorizontal.ui
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkBox" id="SlideTransitionsPanel">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="orientation">vertical</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkBox" id="box4">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkAlignment" id="transitions_icons">
+                <property name="width_request">500</property>
+                <property name="height_request">75</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="column_spacing">12</property>
+            <child>
+              <object class="GtkLabel" id="duration_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Duration:</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="VclComboBoxNumeric" id="transition_duration:0.00sec">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="has_tooltip">True</property>
+                <property name="tooltip_markup" translatable="yes">Select the speed of Slide Transition.</property>
+                <property name="tooltip_text" translatable="yes">Select the speed of Slide Transition.</property>
+                <property name="hexpand">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="variant_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Variant:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="variant_list">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="sound_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Sound:</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBoxText" id="sound_list">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <items>
+                  <item translatable="yes">No sound</item>
+                  <item translatable="yes">Stop previous sound</item>
+                  <item translatable="yes">Other sound...</item>
+                </items>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="loop_sound">
+                <property name="label" translatable="yes">Loop until next sound</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">3</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="rb_mouse_click">
+                <property name="label" translatable="yes">On mouse click</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="xalign">0</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">rb_auto_after</property>
+              </object>
+              <packing>
+                <property name="left_attach">4</property>
+                <property name="top_attach">0</property>
+                <property name="width">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="rb_auto_after">
+                <property name="label" translatable="yes">Automatically after:</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="xalign">0</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">4</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSpinButton" id="auto_after_value:0sec">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">●</property>
+                <property name="text" translatable="yes">0,00</property>
+                <property name="digits">2</property>
+              </object>
+              <packing>
+                <property name="left_attach">5</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="auto_preview">
+                <property name="label" translatable="yes">Automatic Preview</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">6</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButtonBox" id="buttonbox1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="layout_style">center</property>
+                <child>
+                  <object class="GtkButton" id="apply_to_all">
+                    <property name="label" translatable="yes">Apply Transition to All Slides</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="halign">center</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">6</property>
+                <property name="top_attach">0</property>
+                <property name="width">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="play">
+                <property name="label" translatable="yes">Play</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="image">image1</property>
+                <property name="image_position">right</property>
+                <property name="always_show_image">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">7</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+  </object>
+  <object class="GtkImage" id="image1">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="pixbuf">sd/res/playblue_16.png</property>
+  </object>
+</interface>
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 5640e46..8652df7 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -22,6 +22,13 @@ using namespace sfx2;
 using namespace css::uno;
 using namespace css::ui;
 
+void SfxNotebookBar::CloseMethod(SfxBindings& rBindings)
+{
+    SfxFrame& rFrame = rBindings.GetDispatcher_Impl()->GetFrame()->GetFrame();
+    if (rFrame.GetSystemWindow()->GetNotebookBar())
+        rFrame.GetSystemWindow()->CloseNotebookBar();
+}
+
 void SfxNotebookBar::ExecMethod(SfxBindings& rBindings)
 {
     SvtViewOptions aViewOpt(E_WINDOW, "notebookbar");
diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx
index 49c60c9..fd3859b 100644
--- a/vcl/inc/brdwin.hxx
+++ b/vcl/inc/brdwin.hxx
@@ -177,6 +177,7 @@ public:
     void                    SetMenuBarMode( bool bHide );
 
     void                    SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
+    void                    CloseNotebookBar();
     const VclPtr<NotebookBar>& GetNotebookBar() const { return mpNotebookBar; }
 
     void                    SetMinOutputSize( long nWidth, long nHeight )
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index bf4270c..32606f7 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -2183,6 +2183,14 @@ void ImplBorderWindow::SetNotebookBar(const OUString& rUIXMLDescription, const c
     Resize();
 }
 
+void ImplBorderWindow::CloseNotebookBar()
+{
+    if (mpNotebookBar)
+        mpNotebookBar.disposeAndClear();
+    mpNotebookBar = nullptr;
+    Resize();
+}
+
 void ImplBorderWindow::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
                                   sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const
 {
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index bdf2e44..ca0f47f 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -939,6 +939,12 @@ void SystemWindow::SetNotebookBar(const OUString& rUIXMLDescription, const css::
     }
 }
 
+void SystemWindow::CloseNotebookBar()
+{
+    static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CloseNotebookBar();
+    maNotebookBarUIFile = "";
+}
+
 VclPtr<NotebookBar> SystemWindow::GetNotebookBar() const
 {
     return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetNotebookBar();


More information about the Libreoffice-commits mailing list