Kaydet (Commit) e4aa4472 authored tarafından Rishabh Kumar's avatar Rishabh Kumar Kaydeden (comit) Katarina Behrens

tdf#87813: Moving effects list into the animation tab

Adding the animation effect -
1.Press the + button

Modifying the animation effect
1. Select the animation from the list of added animations
2. Select the animation style from the Listbox

Change-Id: I14f9242b9f04279622d879ae8c3e162ded6e3e3d
Reviewed-on: https://gerrit.libreoffice.org/17008Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst d165f035
...@@ -174,7 +174,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ ...@@ -174,7 +174,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/accessibility/AccessibleSlideSorterView \ sd/source/ui/accessibility/AccessibleSlideSorterView \
sd/source/ui/accessibility/AccessibleViewForwarder \ sd/source/ui/accessibility/AccessibleViewForwarder \
sd/source/ui/accessibility/SdShapeTypes \ sd/source/ui/accessibility/SdShapeTypes \
sd/source/ui/animations/CustomAnimationCreateDialog \ sd/source/ui/animations/CategoryListBox \
sd/source/ui/animations/CustomAnimationDialog \ sd/source/ui/animations/CustomAnimationDialog \
sd/source/ui/animations/CustomAnimationList \ sd/source/ui/animations/CustomAnimationList \
sd/source/ui/animations/CustomAnimationPane \ sd/source/ui/animations/CustomAnimationPane \
......
...@@ -71,8 +71,6 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\ ...@@ -71,8 +71,6 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\
$(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/assistentdialog \ sd/uiconfig/simpress/ui/assistentdialog \
sd/uiconfig/simpress/ui/customanimationcreatedialog \
sd/uiconfig/simpress/ui/customanimationcreatetab \
sd/uiconfig/simpress/ui/customanimationspanel \ sd/uiconfig/simpress/ui/customanimationspanel \
sd/uiconfig/simpress/ui/customanimationproperties \ sd/uiconfig/simpress/ui/customanimationproperties \
sd/uiconfig/simpress/ui/customanimationeffecttab \ sd/uiconfig/simpress/ui/customanimationeffecttab \
......
#include "CategoryListBox.hxx"
namespace sd {
CategoryListBox::CategoryListBox( vcl::Window* pParent )
: ListBox( pParent, WB_TABSTOP | WB_BORDER )
{
EnableUserDraw( true );
SetDoubleClickHdl( LINK( this, CategoryListBox, implDoubleClickHdl ) );
}
VCL_BUILDER_FACTORY(CategoryListBox)
CategoryListBox::~CategoryListBox()
{
}
sal_Int32 CategoryListBox::InsertCategory( const OUString& rStr, sal_Int32 nPos /* = LISTBOX_APPEND */ )
{
sal_Int32 n = ListBox::InsertEntry( rStr, nPos );
if( n != LISTBOX_ENTRY_NOTFOUND )
ListBox::SetEntryFlags( n, ListBox::GetEntryFlags(n) | ListBoxEntryFlags::DisableSelection );
return n;
}
void CategoryListBox::UserDraw( const UserDrawEvent& rUDEvt )
{
const sal_uInt16 nItem = rUDEvt.GetItemId();
if( ListBox::GetEntryFlags(nItem) & ListBoxEntryFlags::DisableSelection )
{
Rectangle aOutRect( rUDEvt.GetRect() );
vcl::RenderContext* pDev = rUDEvt.GetRenderContext();
// fill the background
Color aColor (GetSettings().GetStyleSettings().GetDialogColor());
pDev->SetFillColor (aColor);
pDev->SetLineColor ();
pDev->DrawRect(aOutRect);
// Erase the four corner pixels to make the rectangle appear rounded.
pDev->SetLineColor( GetSettings().GetStyleSettings().GetWindowColor());
pDev->DrawPixel( aOutRect.TopLeft());
pDev->DrawPixel( Point(aOutRect.Right(), aOutRect.Top()));
pDev->DrawPixel( Point(aOutRect.Left(), aOutRect.Bottom()));
pDev->DrawPixel( Point(aOutRect.Right(), aOutRect.Bottom()));
// draw the category title
pDev->DrawText (aOutRect, GetEntry(nItem), DrawTextFlags::Center );
}
else
{
DrawEntry( rUDEvt, true, true );
}
}
IMPL_LINK_NOARG_TYPED(CategoryListBox, implDoubleClickHdl, ListBox&, void)
{
CaptureMouse();
}
void CategoryListBox::MouseButtonUp( const MouseEvent& rMEvt )
{
ReleaseMouse();
if( rMEvt.IsLeft() && (rMEvt.GetClicks() == 2) )
{
maDoubleClickHdl.Call( *this );
}
else
{
ListBox::MouseButtonUp( rMEvt );
}
}
}
#ifndef INCLUDED_SD_SOURCE_UI_ANIMATIONS_CATEGORYLISTBOX_HXX
#define INCLUDED_SD_SOURCE_UI_ANIMATIONS_CATEGORYLISTBOX_HXX
#include <vcl/lstbox.hxx>
#include <vcl/builderfactory.hxx>
namespace sd {
class CategoryListBox : public ListBox
{
public:
CategoryListBox( vcl::Window* pParent );
virtual ~CategoryListBox();
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
sal_Int32 InsertCategory( const OUString& rStr, sal_Int32 nPos = LISTBOX_APPEND );
void SetDoubleClickLink( const Link<CategoryListBox&,void>& rDoubleClickHdl ) { maDoubleClickHdl = rDoubleClickHdl; }
DECL_LINK_TYPED(implDoubleClickHdl, ListBox&, void);
private:
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
Link<CategoryListBox&,void> maDoubleClickHdl;
};
}
#endif
...@@ -28,11 +28,10 @@ ...@@ -28,11 +28,10 @@
#include <sfx2/sidebar/ControlFactory.hxx> #include <sfx2/sidebar/ControlFactory.hxx>
#include "CustomAnimationPreset.hxx" #include "CustomAnimationPreset.hxx"
#include "CustomAnimationList.hxx" #include "CustomAnimationList.hxx"
#include "CustomAnimationCreateDialog.hxx" #include "CategoryListBox.hxx"
#include "motionpathtag.hxx" #include "motionpathtag.hxx"
#include "misc/scopelock.hxx" #include "misc/scopelock.hxx"
#include "CustomAnimationPreset.hxx"
#include <vector> #include <vector>
class PushButton; class PushButton;
...@@ -42,6 +41,8 @@ class ListBox; ...@@ -42,6 +41,8 @@ class ListBox;
class ComboBox; class ComboBox;
class CheckBox; class CheckBox;
enum class PathKind { NONE, CURVE, POLYGON, FREEFORM };
namespace com { namespace sun { namespace star { namespace animations { namespace com { namespace sun { namespace star { namespace animations {
class XAnimationNode; class XAnimationNode;
} } } } } } } }
...@@ -69,7 +70,8 @@ public: ...@@ -69,7 +70,8 @@ public:
// callbacks // callbacks
void onSelectionChanged(); void onSelectionChanged();
void onChangeCurrentPage(); void onChangeCurrentPage();
void onChange( bool bCreate ); void onChange();
void animationChange();
void onRemove(); void onRemove();
void onChangeStart(); void onChangeStart();
void onChangeStart( sal_Int16 nNodeType ); void onChangeStart( sal_Int16 nNodeType );
...@@ -80,6 +82,7 @@ public: ...@@ -80,6 +82,7 @@ public:
void preview( const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode ); void preview( const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode );
void remove( CustomAnimationEffectPtr& pEffect ); void remove( CustomAnimationEffectPtr& pEffect );
PathKind getCreatePathKind() const;
// Control // Control
virtual void StateChanged( StateChangedType nStateChange ) override; virtual void StateChanged( StateChangedType nStateChange ) override;
virtual void KeyInput( const KeyEvent& rKEvt ) override; virtual void KeyInput( const KeyEvent& rKEvt ) override;
...@@ -94,6 +97,7 @@ public: ...@@ -94,6 +97,7 @@ public:
void addUndo(); void addUndo();
float getDuration();
void updatePathFromMotionPathTag( const rtl::Reference< MotionPathTag >& xTag ); void updatePathFromMotionPathTag( const rtl::Reference< MotionPathTag >& xTag );
private: private:
...@@ -115,12 +119,15 @@ private: ...@@ -115,12 +119,15 @@ private:
static css::uno::Any getProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect ); static css::uno::Any getProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect );
bool setProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect, const css::uno::Any& rValue ); bool setProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect, const css::uno::Any& rValue );
void UpdateLook(); void UpdateLook();
void fillAnimationLB();
DECL_LINK_TYPED( implControlListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( implControlListBoxHdl, ListBox&, void );
DECL_LINK_TYPED( implClickHdl, Button*, void ); DECL_LINK_TYPED( implClickHdl, Button*, void );
DECL_LINK_TYPED( implPropertyHdl, LinkParamNone*, void ); DECL_LINK_TYPED( implPropertyHdl, LinkParamNone*, void );
DECL_LINK_TYPED( EventMultiplexerListener, tools::EventMultiplexerEvent&, void ); DECL_LINK_TYPED( EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
DECL_LINK_TYPED( lateInitCallback, Timer *, void ); DECL_LINK_TYPED( lateInitCallback, Timer *, void );
DECL_LINK_TYPED( UpdateAnimationLB, ListBox&, void );
DECL_LINK_TYPED( AnimationSelectHdl, ListBox&, void );
void implControlHdl(Control*); void implControlHdl(Control*);
private: private:
...@@ -129,7 +136,6 @@ private: ...@@ -129,7 +136,6 @@ private:
const CustomAnimationPresets* mpCustomAnimationPresets; const CustomAnimationPresets* mpCustomAnimationPresets;
VclPtr<PushButton> mpPBAddEffect; VclPtr<PushButton> mpPBAddEffect;
VclPtr<PushButton> mpPBChangeEffect;
VclPtr<PushButton> mpPBRemoveEffect; VclPtr<PushButton> mpPBRemoveEffect;
VclPtr<FixedText> mpFTEffect; VclPtr<FixedText> mpFTEffect;
VclPtr<FixedText> mpFTStart; VclPtr<FixedText> mpFTStart;
...@@ -145,11 +151,18 @@ private: ...@@ -145,11 +151,18 @@ private:
VclPtr<PushButton> mpPBMoveDown; VclPtr<PushButton> mpPBMoveDown;
VclPtr<PushButton> mpPBPlay; VclPtr<PushButton> mpPBPlay;
VclPtr<CheckBox> mpCBAutoPreview; VclPtr<CheckBox> mpCBAutoPreview;
VclPtr<FixedText> mpFTCategory;
VclPtr<ListBox> mpLBCategory;
VclPtr<FixedText> mpFTAnimation;
VclPtr<CategoryListBox> mpLBAnimation;
OUString maStrModify; OUString maStrModify;
OUString maStrProperty; OUString maStrProperty;
sal_Int32 mnPropertyType; sal_Int32 mnPropertyType;
sal_Int32 mnCurvePathPos;
sal_Int32 mnPolygonPathPos;
sal_Int32 mnFreeformPathPos;
EffectSequence maListSelection; EffectSequence maListSelection;
css::uno::Any maViewSelection; css::uno::Any maViewSelection;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="CustomAnimationCreate">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook" id="tabs">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="entrance">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Entrance</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="emphasis">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Emphasis</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="exit">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Exit</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="motion_paths">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Motion Paths</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="misc_effects">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Misc Effects</property>
</object>
<packing>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="0">help</action-widget>
</action-widgets>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkBox" id="CustomAnimationCreateTab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="sdlo-CategoryListBox" id="effect_list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="effect_speed_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Speed:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">effect_speed_list</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="effect_speed_list">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</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>
</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="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>
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