Kaydet (Commit) c4e0d659 authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) Samuel Mehrbrodt

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/25844Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst be40d4e7
......@@ -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>
......@@ -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);
......
......@@ -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();
......
......@@ -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 \
......
......@@ -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 \
))
......
/* -*- 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: */
......@@ -404,7 +404,32 @@ 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");
......@@ -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;
}
}
......
......@@ -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;
......
......@@ -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.
......
......@@ -1879,6 +1879,28 @@
<property name="tab_fill">False</property>
</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>
......@@ -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>
......
......@@ -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");
......
......@@ -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 )
......
......@@ -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
{
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment