tdf#98034 - SIDEBAR: Add delay spinbox to Custom Animation tab
Change-Id: Ie13a5e04207475794fef75c568786f37eb2c406f Reviewed-on: https://gerrit.libreoffice.org/33230 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Heiko Tietze <tietze.heiko@googlemail.com> Reviewed-by: Akshay Deep <akshaydeepiitr@gmail.com>
This commit is contained in:
@@ -177,6 +177,9 @@ void CustomAnimationPane::initialize()
|
|||||||
get(mpLBCategory, "categorylb");
|
get(mpLBCategory, "categorylb");
|
||||||
get(mpFTAnimation, "effectlabel");
|
get(mpFTAnimation, "effectlabel");
|
||||||
get(mpLBAnimation, "effect_list");
|
get(mpLBAnimation, "effect_list");
|
||||||
|
get(mpFTStartDelay, "delay_label");
|
||||||
|
get(mpMFStartDelay, "delay_value");
|
||||||
|
|
||||||
mpLBAnimation->SetSelectHdl(LINK(this, CustomAnimationPane, AnimationSelectHdl));
|
mpLBAnimation->SetSelectHdl(LINK(this, CustomAnimationPane, AnimationSelectHdl));
|
||||||
get(mpCustomAnimationList, "custom_animation_list");
|
get(mpCustomAnimationList, "custom_animation_list");
|
||||||
mpCustomAnimationList->setController( dynamic_cast<ICustomAnimationListController*> ( this ) );
|
mpCustomAnimationList->setController( dynamic_cast<ICustomAnimationListController*> ( this ) );
|
||||||
@@ -212,6 +215,9 @@ void CustomAnimationPane::initialize()
|
|||||||
mpPBPlay->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) );
|
mpPBPlay->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) );
|
||||||
mpCBAutoPreview->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) );
|
mpCBAutoPreview->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) );
|
||||||
mpLBCategory->SetSelectHdl( LINK(this, CustomAnimationPane, UpdateAnimationLB) );
|
mpLBCategory->SetSelectHdl( LINK(this, CustomAnimationPane, UpdateAnimationLB) );
|
||||||
|
mpMFStartDelay->SetModifyHdl( LINK(this, CustomAnimationPane, DelayModifiedHdl) );
|
||||||
|
mpMFStartDelay->SetLoseFocusHdl(LINK( this, CustomAnimationPane, DelayLoseFocusHdl));
|
||||||
|
|
||||||
|
|
||||||
if(!mbHorizontal)
|
if(!mbHorizontal)
|
||||||
maStrModify = mpFTEffect->GetText();
|
maStrModify = mpFTEffect->GetText();
|
||||||
@@ -267,6 +273,8 @@ void CustomAnimationPane::dispose()
|
|||||||
mpPBPropertyMore.clear();
|
mpPBPropertyMore.clear();
|
||||||
mpFTDuration.clear();
|
mpFTDuration.clear();
|
||||||
mpCBXDuration.clear();
|
mpCBXDuration.clear();
|
||||||
|
mpFTStartDelay.clear();
|
||||||
|
mpMFStartDelay.clear();
|
||||||
mpCustomAnimationList.clear();
|
mpCustomAnimationList.clear();
|
||||||
mpPBMoveUp.clear();
|
mpPBMoveUp.clear();
|
||||||
mpPBMoveDown.clear();
|
mpPBMoveDown.clear();
|
||||||
@@ -506,6 +514,8 @@ void CustomAnimationPane::updateControls()
|
|||||||
mpLBCategory->Disable();
|
mpLBCategory->Disable();
|
||||||
mpFTAnimation->Disable();
|
mpFTAnimation->Disable();
|
||||||
mpLBAnimation->Disable();
|
mpLBAnimation->Disable();
|
||||||
|
mpFTStartDelay->Disable();
|
||||||
|
mpMFStartDelay->Disable();
|
||||||
mpLBAnimation->Clear();
|
mpLBAnimation->Clear();
|
||||||
mpCustomAnimationList->clear();
|
mpCustomAnimationList->clear();
|
||||||
return;
|
return;
|
||||||
@@ -536,6 +546,8 @@ void CustomAnimationPane::updateControls()
|
|||||||
mpLBStart->Enable(nSelectionCount > 0);
|
mpLBStart->Enable(nSelectionCount > 0);
|
||||||
mpLBProperty->Enable(nSelectionCount > 0);
|
mpLBProperty->Enable(nSelectionCount > 0);
|
||||||
mpPBPropertyMore->Enable(nSelectionCount > 0);
|
mpPBPropertyMore->Enable(nSelectionCount > 0);
|
||||||
|
mpFTStartDelay->Enable(nSelectionCount > 0);
|
||||||
|
mpMFStartDelay->Enable(nSelectionCount > 0);
|
||||||
|
|
||||||
mpFTProperty->SetText( maStrProperty );
|
mpFTProperty->SetText( maStrProperty );
|
||||||
|
|
||||||
@@ -600,6 +612,8 @@ void CustomAnimationPane::updateControls()
|
|||||||
mpFTProperty->Enable( false );
|
mpFTProperty->Enable( false );
|
||||||
mpLBProperty->Enable( false );
|
mpLBProperty->Enable( false );
|
||||||
mpPBPropertyMore->Enable( false );
|
mpPBPropertyMore->Enable( false );
|
||||||
|
mpFTStartDelay->Enable( false );
|
||||||
|
mpMFStartDelay->Enable( false );
|
||||||
}
|
}
|
||||||
sal_uInt32 nCategoryPos = LISTBOX_ENTRY_NOTFOUND;
|
sal_uInt32 nCategoryPos = LISTBOX_ENTRY_NOTFOUND;
|
||||||
switch(pEffect->getPresetClass())
|
switch(pEffect->getPresetClass())
|
||||||
@@ -662,12 +676,19 @@ void CustomAnimationPane::updateControls()
|
|||||||
}
|
}
|
||||||
|
|
||||||
mpPBPropertyMore->Enable();
|
mpPBPropertyMore->Enable();
|
||||||
|
|
||||||
|
mpFTStartDelay->Enable();
|
||||||
|
mpMFStartDelay->Enable();
|
||||||
|
double fBegin = pEffect->getBegin();
|
||||||
|
mpMFStartDelay->SetValue(fBegin*10.0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mpLBProperty->setSubControl( nullptr );
|
mpLBProperty->setSubControl( nullptr );
|
||||||
mpFTProperty->Enable( false );
|
mpFTProperty->Enable( false );
|
||||||
mpLBProperty->Enable( false );
|
mpLBProperty->Enable( false );
|
||||||
|
mpFTStartDelay->Enable( false );
|
||||||
|
mpMFStartDelay->Enable( false );
|
||||||
mpPBPropertyMore->Enable( false );
|
mpPBPropertyMore->Enable( false );
|
||||||
mpFTDuration->Enable(false);
|
mpFTDuration->Enable(false);
|
||||||
mpCBXDuration->Enable(false);
|
mpCBXDuration->Enable(false);
|
||||||
@@ -1288,15 +1309,17 @@ void CustomAnimationPane::changeSelection( STLPropertySet* pResultSet, STLProper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double fBegin = 0.0;
|
||||||
|
|
||||||
if( pResultSet->getPropertyState( nHandleBegin ) == STLPropertyState::Direct )
|
if( pResultSet->getPropertyState( nHandleBegin ) == STLPropertyState::Direct )
|
||||||
{
|
|
||||||
double fBegin = 0.0;
|
|
||||||
pResultSet->getPropertyValue( nHandleBegin ) >>= fBegin;
|
pResultSet->getPropertyValue( nHandleBegin ) >>= fBegin;
|
||||||
if( pEffect->getBegin() != fBegin )
|
else
|
||||||
{
|
fBegin = pEffect->getBegin();
|
||||||
pEffect->setBegin( fBegin );
|
|
||||||
bChanged = true;
|
if( pEffect->getBegin() != fBegin && pResultSet->getPropertyState( nHandleBegin ) == STLPropertyState::Direct)
|
||||||
}
|
{
|
||||||
|
pEffect->setBegin( fBegin );
|
||||||
|
bChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pResultSet->getPropertyState( nHandleDuration ) == STLPropertyState::Direct )
|
if( pResultSet->getPropertyState( nHandleDuration ) == STLPropertyState::Direct )
|
||||||
@@ -2011,6 +2034,32 @@ IMPL_LINK_NOARG(CustomAnimationPane, implPropertyHdl, LinkParamNone*, void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IMPL_LINK_NOARG(CustomAnimationPane, DelayModifiedHdl, Edit&, void)
|
||||||
|
{
|
||||||
|
addUndo();
|
||||||
|
}
|
||||||
|
|
||||||
|
IMPL_LINK_NOARG(CustomAnimationPane, DelayLoseFocusHdl, Control&, void)
|
||||||
|
{
|
||||||
|
double fBegin = mpMFStartDelay->GetValue();
|
||||||
|
|
||||||
|
//sequence rebuild only when the control loses focus
|
||||||
|
MainSequenceRebuildGuard aGuard( mpMainSequence );
|
||||||
|
|
||||||
|
// change selected effect
|
||||||
|
EffectSequence::iterator aIter( maListSelection.begin() );
|
||||||
|
const EffectSequence::iterator aEnd( maListSelection.end() );
|
||||||
|
while( aIter != aEnd )
|
||||||
|
{
|
||||||
|
CustomAnimationEffectPtr pEffect = (*aIter++);
|
||||||
|
pEffect->setBegin( fBegin/10.0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
mpMainSequence->rebuild();
|
||||||
|
updateControls();
|
||||||
|
mrBase.GetDocShell()->SetModified();
|
||||||
|
}
|
||||||
|
|
||||||
IMPL_LINK_NOARG(CustomAnimationPane, AnimationSelectHdl, ListBox&, void)
|
IMPL_LINK_NOARG(CustomAnimationPane, AnimationSelectHdl, ListBox&, void)
|
||||||
{
|
{
|
||||||
if( maListSelection.size() == 1 )
|
if( maListSelection.size() == 1 )
|
||||||
|
@@ -125,6 +125,8 @@ private:
|
|||||||
DECL_LINK( EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
|
DECL_LINK( EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
|
||||||
DECL_LINK( lateInitCallback, Timer *, void );
|
DECL_LINK( lateInitCallback, Timer *, void );
|
||||||
DECL_LINK( DurationModifiedHdl, Edit&, void );
|
DECL_LINK( DurationModifiedHdl, Edit&, void );
|
||||||
|
DECL_LINK( DelayModifiedHdl, Edit&, void );
|
||||||
|
DECL_LINK( DelayLoseFocusHdl, Control&, void );
|
||||||
DECL_LINK( UpdateAnimationLB, ListBox&, void );
|
DECL_LINK( UpdateAnimationLB, ListBox&, void );
|
||||||
DECL_LINK( AnimationSelectHdl, ListBox&, void );
|
DECL_LINK( AnimationSelectHdl, ListBox&, void );
|
||||||
void implControlHdl(Control*);
|
void implControlHdl(Control*);
|
||||||
@@ -145,6 +147,8 @@ private:
|
|||||||
VclPtr<PushButton> mpPBPropertyMore;
|
VclPtr<PushButton> mpPBPropertyMore;
|
||||||
VclPtr<FixedText> mpFTDuration;
|
VclPtr<FixedText> mpFTDuration;
|
||||||
VclPtr<MetricBox> mpCBXDuration;
|
VclPtr<MetricBox> mpCBXDuration;
|
||||||
|
VclPtr<FixedText> mpFTStartDelay;
|
||||||
|
VclPtr<MetricField> mpMFStartDelay;
|
||||||
VclPtr<CustomAnimationList> mpCustomAnimationList;
|
VclPtr<CustomAnimationList> mpCustomAnimationList;
|
||||||
VclPtr<PushButton> mpPBMoveUp;
|
VclPtr<PushButton> mpPBMoveUp;
|
||||||
VclPtr<PushButton> mpPBMoveDown;
|
VclPtr<PushButton> mpPBMoveDown;
|
||||||
|
@@ -3,6 +3,11 @@
|
|||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.0"/>
|
<requires lib="gtk+" version="3.0"/>
|
||||||
<requires lib="LibreOffice" version="1.0"/>
|
<requires lib="LibreOffice" version="1.0"/>
|
||||||
|
<object class="GtkAdjustment" id="adjustment1">
|
||||||
|
<property name="upper">999.99000000000001</property>
|
||||||
|
<property name="step_increment">1</property>
|
||||||
|
<property name="page_increment">10</property>
|
||||||
|
</object>
|
||||||
<object class="GtkImage" id="image1">
|
<object class="GtkImage" id="image1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
@@ -337,6 +342,37 @@
|
|||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="delay_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="label" translatable="yes">_Delay:</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinButton" id="delay_value:0.0sec">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="text" translatable="yes">0.0</property>
|
||||||
|
<property name="adjustment">adjustment1</property>
|
||||||
|
<property name="digits">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
|
Reference in New Issue
Block a user