cui/source/inc/cuitabarea.hxx | 10 - cui/source/tabpages/tppattern.cxx | 326 ++++++++---------------------------- cui/uiconfig/ui/patterntabpage.ui | 344 +++++++++++++++++++------------------- 3 files changed, 261 insertions(+), 419 deletions(-)
New commits: commit 74aa685bf35358202efb9e17901be9a232845c2b Author: Rishabh Kumar <[email protected]> Date: Wed Jul 20 22:51:49 2016 +0530 [GSoC] Redesign of Pattern tab 1. New Pattern Listbox for presets. 2. Context menu for Rename and Delete. 3. Rearrangement of controls. 4. Remove Save and Load buttons. Change-Id: I7edaf2496837443967711a307c01cdba284270d0 Reviewed-on: https://gerrit.libreoffice.org/27352 Tested-by: Jenkins <[email protected]> Reviewed-by: Samuel Mehrbrodt <[email protected]> diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index fac2bb1..881568a 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -564,12 +564,11 @@ private: VclPtr<ColorLB> m_pLbColor; VclPtr<ColorLB> m_pLbBackgroundColor; VclPtr<PatternLB> m_pLbPatterns; + VclPtr<SvxPresetListBox> m_pPatternLB; VclPtr<SvxXRectPreview> m_pCtlPreview; VclPtr<PushButton> m_pBtnAdd; VclPtr<PushButton> m_pBtnModify; VclPtr<PushButton> m_pBtnDelete; - VclPtr<PushButton> m_pBtnLoad; - VclPtr<PushButton> m_pBtnSave; SvxBitmapCtl* m_pBitmapCtl; @@ -594,11 +593,10 @@ private: DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); - DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK_TYPED( ChangePatternHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ChangePatternHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( ChangeColorHdl_Impl, ListBox&, void ); - DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); - DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); + DECL_LINK_TYPED( ClickRenameHdl_Impl, SvxPresetListBox*, void ); + DECL_LINK_TYPED( ClickDeleteHdl_Impl, SvxPresetListBox*, void ); long CheckChanges_Impl(); diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index b967c75..3c1e155 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -101,27 +101,18 @@ SvxPatternTabPage::SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& r m_aXFillAttr ( rInAttrs.GetPool() ), m_rXFSet ( m_aXFillAttr.GetItemSet() ) { - get(m_pBxPixelEditor,"maingrid"); get(m_pCtlPixel,"CTL_PIXEL"); get(m_pLbColor,"LB_COLOR"); get(m_pLbBackgroundColor,"LB_BACKGROUND_COLOR"); get(m_pCtlPreview,"CTL_PREVIEW"); - get(m_pLbPatterns,"LB_PATTERN"); + get(m_pPatternLB, "patternpresetlist"); get(m_pBtnAdd,"BTN_ADD"); get(m_pBtnModify,"BTN_MODIFY"); - get(m_pBtnDelete,"BTN_DELETE"); - get(m_pBtnLoad,"BTN_LOAD"); - get(m_pBtnSave,"BTN_SAVE"); - - // size of the bitmap listbox - Size aSize = getDrawListBoxOptimalSize(this); - m_pLbPatterns->set_width_request(aSize.Width()); - m_pLbPatterns->set_height_request(aSize.Height()); // size of the bitmap display - Size aSize2 = getDrawPreviewOptimalSize(this); - m_pCtlPreview->set_width_request(aSize2.Width()); - m_pCtlPreview->set_height_request(aSize2.Height()); + Size aSize = getDrawPreviewOptimalSize(this); + m_pCtlPreview->set_width_request(aSize.Width()); + m_pCtlPreview->set_height_request(aSize.Height()); m_pBitmapCtl = new SvxBitmapCtl; @@ -134,11 +125,10 @@ SvxPatternTabPage::SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& r m_pBtnAdd->SetClickHdl( LINK( this, SvxPatternTabPage, ClickAddHdl_Impl ) ); m_pBtnModify->SetClickHdl( LINK( this, SvxPatternTabPage, ClickModifyHdl_Impl ) ); - m_pBtnDelete->SetClickHdl( LINK( this, SvxPatternTabPage, ClickDeleteHdl_Impl ) ); - m_pBtnLoad->SetClickHdl( LINK( this, SvxPatternTabPage, ClickLoadHdl_Impl ) ); - m_pBtnSave->SetClickHdl( LINK( this, SvxPatternTabPage, ClickSaveHdl_Impl ) ); - m_pLbPatterns->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangePatternHdl_Impl ) ); + m_pPatternLB->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangePatternHdl_Impl ) ); + m_pPatternLB->SetRenameHdl( LINK( this, SvxPatternTabPage, ClickRenameHdl_Impl ) ); + m_pPatternLB->SetDeleteHdl( LINK( this, SvxPatternTabPage, ClickDeleteHdl_Impl ) ); m_pLbColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); @@ -154,17 +144,12 @@ void SvxPatternTabPage::dispose() { delete m_pBitmapCtl; m_pBitmapCtl = nullptr; - m_pBxPixelEditor.clear(); m_pCtlPixel.clear(); m_pLbColor.clear(); m_pLbBackgroundColor.clear(); - m_pLbPatterns.clear(); m_pCtlPreview.clear(); m_pBtnAdd.clear(); m_pBtnModify.clear(); - m_pBtnDelete.clear(); - m_pBtnLoad.clear(); - m_pBtnSave.clear(); SvxTabPage::dispose(); } @@ -172,7 +157,7 @@ void SvxPatternTabPage::Construct() { m_pLbColor->Fill( m_pColorList ); m_pLbBackgroundColor->CopyEntries( *m_pLbColor ); - m_pLbPatterns->Fill( m_pPatternList ); + m_pPatternLB->FillPresetListBox( *m_pPatternList ); } @@ -239,10 +224,11 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& ) if( *m_pPageType == PT_BITMAP && *m_pPos != LISTBOX_ENTRY_NOTFOUND ) { - m_pLbPatterns->SelectEntryPos( *m_pPos ); + sal_uInt16 nId = m_pPatternLB->GetItemId( static_cast<size_t>( *m_pPos ) ); + m_pPatternLB->SelectItem( nId ); } // colors could have been deleted - ChangePatternHdl_Impl( *m_pLbPatterns ); + ChangePatternHdl_Impl( m_pPatternLB ); *m_pPageType = PT_BITMAP; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -270,11 +256,11 @@ bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs ) if(PT_BITMAP == *m_pPageType) { _rOutAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP)); - sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); - if(LISTBOX_ENTRY_NOTFOUND != nPos) + size_t nPos = m_pPatternLB->GetSelectItemPos(); + if(VALUESET_ITEM_NOTFOUND != nPos) { - const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap(nPos); - const OUString aString(m_pLbPatterns->GetSelectEntry()); + const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) ); + const OUString aString( m_pPatternLB->GetItemText( m_pPatternLB->GetSelectItemId() ) ); _rOutAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject())); } @@ -303,21 +289,17 @@ void SvxPatternTabPage::Reset( const SfxItemSet* ) m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - ChangePatternHdl_Impl( *m_pLbPatterns ); + ChangePatternHdl_Impl( m_pPatternLB ); // determine button state if( m_pPatternList.is() && m_pPatternList->Count() ) { m_pBtnAdd->Enable(); m_pBtnModify->Enable(); - m_pBtnDelete->Enable(); - m_pBtnSave->Enable(); } else { m_pBtnModify->Disable(); - m_pBtnDelete->Disable(); - m_pBtnSave->Disable(); } } @@ -329,14 +311,14 @@ VclPtr<SfxTabPage> SvxPatternTabPage::Create( vcl::Window* pWindow, } -IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ListBox&, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void) { std::unique_ptr<GraphicObject> pGraphicObject; - int nPos(m_pLbPatterns->GetSelectEntryPos()); + size_t nPos = m_pPatternLB->GetSelectItemPos(); - if(LISTBOX_ENTRY_NOTFOUND != nPos) + if(VALUESET_ITEM_NOTFOUND != nPos) { - pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(nPos)->GetGraphicObject())); + pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetGraphicObject())); } else { @@ -354,12 +336,11 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ListBox&, void) if(!pGraphicObject) { - m_pLbPatterns->SelectEntryPos(0); - nPos = m_pLbPatterns->GetSelectEntryPos(); - - if(LISTBOX_ENTRY_NOTFOUND != nPos) + sal_uInt16 nPosition = m_pPatternLB->GetItemId( 0 ); + m_pPatternLB->SelectItem( nPosition ); + if( nPosition != 0 ) { - pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(nPos)->GetGraphicObject())); + pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(0)->GetGraphicObject())); } } } @@ -376,7 +357,6 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ListBox&, void) if(bIs8x8) { m_pCtlPixel->SetPaintable( true ); - m_pBxPixelEditor->Enable(); m_pBtnModify->Enable(); m_pBtnAdd->Enable(); @@ -426,7 +406,6 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ListBox&, void) { m_pCtlPixel->Reset(); m_pCtlPixel->SetPaintable( false ); - m_pBxPixelEditor->Disable(); m_pBtnModify->Disable(); m_pBtnAdd->Disable(); } @@ -440,8 +419,8 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ListBox&, void) long SvxPatternTabPage::CheckChanges_Impl() { - sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) + size_t nPos = m_pPatternLB->GetSelectItemPos(); + if( nPos != VALUESET_ITEM_NOTFOUND ) { if( m_bPtrnChanged ) { @@ -476,9 +455,9 @@ long SvxPatternTabPage::CheckChanges_Impl() } } } - nPos = m_pLbPatterns->GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - *m_pPos = nPos; + nPos = m_pPatternLB->GetSelectItemPos(); + if( nPos != VALUESET_ITEM_NOTFOUND ) + *m_pPos = static_cast<sal_Int32>(nPos); return 0L; } @@ -565,14 +544,15 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) if( pEntry ) { - m_pPatternList->Insert( pEntry ); - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - m_pLbPatterns->Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry ); - m_pLbPatterns->SelectEntryPos( m_pLbPatterns->GetEntryCount() - 1 ); + m_pPatternList->Insert( pEntry, nCount ); + sal_Int32 nId = m_pPatternLB->GetItemId( nCount - 1 ); + Bitmap aBitmap = m_pPatternList->GetBitmapForPreview( nCount, m_pPatternLB->GetIconSize() ); + m_pPatternLB->InsertItem( nId + 1, Image(aBitmap), aName ); + m_pPatternLB->SelectItem( nId + 1 ); *m_pnPatternListState |= ChangeType::MODIFIED; - ChangePatternHdl_Impl( *m_pLbPatterns ); + ChangePatternHdl_Impl( m_pPatternLB ); } } @@ -580,8 +560,6 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) if( m_pPatternList->Count() ) { m_pBtnModify->Enable(); - m_pBtnDelete->Enable(); - m_pBtnSave->Enable(); } } @@ -592,9 +570,37 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) { - sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); + sal_uInt16 nId = m_pPatternLB->GetSelectItemId(); + size_t nPos = m_pPatternLB->GetSelectItemPos(); - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) + if ( nPos != VALUESET_ITEM_NOTFOUND ) + { + OUString aName( m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetName() ); + + const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx()); + + // #i123497# Need to replace the existing entry with a new one (old returned needs to be deleted) + XBitmapEntry* pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName); + delete m_pPatternList->Replace(pEntry, nPos); + + Bitmap aBitmap = m_pPatternList->GetBitmapForPreview( static_cast<sal_uInt16>( nPos ), m_pPatternLB->GetIconSize() ); + m_pPatternLB->RemoveItem(nId); + m_pPatternLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); + m_pPatternLB->SelectItem( nId ); + + *m_pnPatternListState |= ChangeType::MODIFIED; + + m_bPtrnChanged = false; + } +} + + +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void) +{ + size_t nPos = m_pPatternLB->GetSelectItemPos(); + sal_Int32 nId = m_pPatternLB->GetSelectItemId(); + + if ( nPos != VALUESET_ITEM_NOTFOUND ) { ResMgr& rMgr = CUI_MGR(); OUString aDesc( ResId( RID_SVXSTR_DESC_NEW_PATTERN, rMgr ) ); @@ -608,7 +614,6 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) long nCount = m_pPatternList->Count(); bool bLoop = true; - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); while( bLoop && pDlg->Execute() == RET_OK ) { @@ -617,8 +622,8 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) for( long i = 0; i < nCount && bDifferent; i++ ) { - if( aName == m_pPatternList->GetBitmap( i )->GetName() && - aName != aOldName ) + if( aName == m_pPatternList->GetBitmap( i )->GetName() + && aName != aOldName ) bDifferent = false; } @@ -626,14 +631,11 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) { bLoop = false; - const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx()); - - // #i123497# Need to replace the existing entry with a new one (old returned needs to be deleted) - XBitmapEntry* pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName); - delete m_pPatternList->Replace(pEntry, nPos); + XBitmapEntry* pEntry = m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) ); + pEntry->SetName( aName ); - m_pLbPatterns->Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos ); - m_pLbPatterns->SelectEntryPos( nPos ); + m_pPatternLB->SetItemText( nId, aName ); + m_pPatternLB->SelectItem( nId ); *m_pnPatternListState |= ChangeType::MODIFIED; @@ -652,24 +654,26 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) } -IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickDeleteHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void) { - sal_Int32 nPos = m_pLbPatterns->GetSelectEntryPos(); + sal_uInt16 nId = m_pPatternLB->GetSelectItemId(); + size_t nPos = m_pPatternLB->GetSelectItemPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) + if( nPos != VALUESET_ITEM_NOTFOUND ) { ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" ); if( aQueryBox->Execute() == RET_YES ) { - delete m_pPatternList->Remove( nPos ); - m_pLbPatterns->RemoveEntry( nPos ); - m_pLbPatterns->SelectEntryPos( 0 ); + delete m_pPatternList->Remove( static_cast<sal_uInt16>(nPos) ); + m_pPatternLB->RemoveItem( nId ); + nId = m_pPatternLB->GetItemId(0); + m_pPatternLB->SelectItem( nId ); m_pCtlPreview->Invalidate(); m_pCtlPixel->Invalidate(); - ChangePatternHdl_Impl( *m_pLbPatterns ); + ChangePatternHdl_Impl( m_pPatternLB ); *m_pnPatternListState |= ChangeType::MODIFIED; } @@ -678,179 +682,9 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickDeleteHdl_Impl, Button*, void) if( !m_pPatternList->Count() ) { m_pBtnModify->Disable(); - m_pBtnDelete->Disable(); - m_pBtnSave->Disable(); } } - -IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickLoadHdl_Impl, Button*, void) -{ - sal_uInt16 nReturn = RET_YES; - ResMgr& rMgr = CUI_MGR(); - - if ( *m_pnPatternListState & ChangeType::MODIFIED ) - { - nReturn = ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog() - ,"AskSaveList" - ,"cui/ui/querysavelistdialog.ui")->Execute(); - - if ( nReturn == RET_YES ) - m_pPatternList->Save(); - } - - if ( nReturn != RET_CANCEL ) - { - ::sfx2::FileDialogHelper aDlg( css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ); - OUString aStrFilterType( "*.sop" ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - OUString aPalettePath(SvtPathOptions().GetPalettePath()); - OUString aLastDir; - sal_Int32 nIndex = 0; - do - { - aLastDir = aPalettePath.getToken(0, ';', nIndex); - } - while (nIndex >= 0); - - INetURLObject aFile(aLastDir); - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - - if ( aDlg.Execute() == ERRCODE_NONE ) - { - EnterWait(); - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - // save table - XPatternListRef pBmpList = XPropertyList::AsPatternList( - XPropertyList::CreatePropertyList( - XPATTERN_LIST, aPathURL.GetMainURL(INetURLObject::NO_DECODE), - "")); - pBmpList->SetName( aURL.getName() ); - if( pBmpList->Load() ) - { - m_pPatternList = pBmpList; - static_cast<SvxAreaTabDialog*>( GetParentDialog() )->SetNewPatternList( m_pPatternList ); - - m_pLbPatterns->Clear(); - m_pLbPatterns->Fill( m_pPatternList ); - Reset( &m_rOutAttrs ); - - m_pPatternList->SetName( aURL.getName() ); - - // determining (possibly cutting) the name - // displaying it in the GroupBox - OUString aString( ResId( RID_SVXSTR_TABLE, rMgr ) ); - aString += ": "; - - if ( aURL.getBase().getLength() > 18 ) - { - aString += aURL.getBase().copy( 0, 15 ); - aString += "..."; - } - else - aString += aURL.getBase(); - - *m_pnPatternListState |= ChangeType::CHANGED; - *m_pnPatternListState &= ~ChangeType::MODIFIED; - LeaveWait(); - } - else - { - LeaveWait(); - ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog() - ,"NoLoadedFileDialog" - ,"cui/ui/querynoloadedfiledialog.ui")->Execute(); - } - } - } - - // determine button state - if( m_pPatternList->Count() ) - { - m_pBtnModify->Enable(); - m_pBtnDelete->Enable(); - m_pBtnSave->Enable(); - } - else - { - m_pBtnModify->Disable(); - m_pBtnDelete->Disable(); - m_pBtnSave->Disable(); - } -} - - -IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickSaveHdl_Impl, Button*, void) -{ - ::sfx2::FileDialogHelper aDlg( css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE ); - OUString aStrFilterType( "*.sop" ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - - OUString aPalettePath(SvtPathOptions().GetPalettePath()); - OUString aLastDir; - sal_Int32 nIndex = 0; - do - { - aLastDir = aPalettePath.getToken(0, ';', nIndex); - } - while (nIndex >= 0); - - INetURLObject aFile(aLastDir); - SAL_WARN_IF( aFile.GetProtocol() == INetProtocol::NotValid, "cui.tabpages", "invalid URL" ); - - if( !m_pPatternList->GetName().isEmpty() ) - { - aFile.Append( m_pPatternList->GetName() ); - - if( aFile.getExtension().isEmpty() ) - aFile.SetExtension( "sop" ); - } - - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - m_pPatternList->SetName( aURL.getName() ); - m_pPatternList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( m_pPatternList->Save() ) - { - // determining (possibly cutting) the name - // displaying it in the GroupBox - OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); - aString += ": "; - - if ( aURL.getBase().getLength() > 18 ) - { - aString += aURL.getBase().copy( 0, 15 ); - aString += "..."; - } - else - aString += aURL.getBase(); - - *m_pnPatternListState |= ChangeType::SAVED; - *m_pnPatternListState &= ~ChangeType::MODIFIED; - } - else - { - ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog() - ,"NoSaveFileDialog" - ,"cui/ui/querynosavefiledialog.ui")->Execute(); - } - } -} - - IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangeColorHdl_Impl, ListBox&, void) { ChangeColor_Impl(); diff --git a/cui/uiconfig/ui/patterntabpage.ui b/cui/uiconfig/ui/patterntabpage.ui index 26db14c..430e54d 100644 --- a/cui/uiconfig/ui/patterntabpage.ui +++ b/cui/uiconfig/ui/patterntabpage.ui @@ -3,59 +3,58 @@ <interface> <requires lib="gtk+" version="3.0"/> <!-- interface-requires LibreOffice 1.0 --> - <object class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">res/sc05501.png</property> - </object> - <object class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="pixbuf">res/sc05502.png</property> - </object> <object class="GtkBox" id="PatternTabPage"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> <property name="border_width">6</property> - <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkFrame" id="frame1"> + <object class="GtkFrame" id="frame3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> <property name="label_xalign">0</property> <property name="shadow_type">none</property> <child> - <object class="GtkAlignment" id="alignment1"> + <object class="GtkAlignment" id="alignment3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkBox" id="box2"> + <object class="GtkBox" id="box3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="spacing">12</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkBox" id="maingrid"> + <object class="svxcorelo-SvxPresetListBox" id="patternpresetlist"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="orientation">vertical</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButtonBox" id="buttonbox1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">center</property> <property name="spacing">6</property> + <property name="layout_style">start</property> <child> - <object class="GtkLabel" id="FT_PIXEL_EDIT"> + <object class="GtkButton" id="BTN_ADD"> + <property name="label">gtk-add</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Pattern Editor:</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> @@ -64,73 +63,100 @@ </packing> </child> <child> - <object class="svxlo-SvxPixelCtl" id="CTL_PIXEL"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="valign">start</property> - <child internal-child="accessible"> - <object class="AtkObject" id="CTL_PIXEL-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes">Pattern Editor</property> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="FT_COLOR"> + <object class="GtkButton" id="BTN_MODIFY"> + <property name="label" translatable="yes">_Modify</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_Foreground color:</property> + <property name="receives_default">True</property> <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="svxlo-ColorLB" id="LB_BACKGROUND_COLOR"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> + <property name="position">1</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Pattern</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="box9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">3</property> <child> - <object class="GtkLabel" id="FT_BACKGROUND_COLOR"> + <object class="GtkLabel" id="label4"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> - <property name="label" translatable="yes">_Background color:</property> - <property name="use_underline">True</property> + <property name="label" translatable="yes">Pattern Editor:</property> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</property> + <property name="fill">False</property> + <property name="position">0</property> </packing> </child> <child> - <object class="svxlo-ColorLB" id="LB_COLOR"> + <object class="svxlo-SvxPixelCtl" id="CTL_PIXEL"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> + <property name="valign">start</property> + <child internal-child="accessible"> + <object class="AtkObject" id="CTL_PIXEL-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Pattern Editor</property> + </object> + </child> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> + <property name="fill">False</property> + <property name="position">1</property> </packing> </child> </object> @@ -141,65 +167,55 @@ </packing> </child> <child> - <object class="GtkBox" id="box3"> + <object class="GtkBox" id="box8"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">start</property> - <property name="hexpand">True</property> <property name="orientation">vertical</property> - <property name="spacing">6</property> + <property name="spacing">3</property> <child> - <object class="svxlo-PatternLB" id="LB_PATTERN:border"> + <object class="GtkLabel" id="label5"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="vexpand">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Foreground Color:</property> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> + <property name="fill">False</property> <property name="position">0</property> </packing> </child> <child> - <object class="svxlo-SvxXRectPreview" id="CTL_PREVIEW"> + <object class="svxlo-ColorLB" id="LB_COLOR"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="CTL_PREVIEW-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes">Example</property> - </object> - </child> + <property name="halign">start</property> </object> <packing> - <property name="expand">True</property> - <property name="fill">True</property> + <property name="expand">False</property> + <property name="fill">False</property> <property name="position">1</property> </packing> </child> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> + <property name="fill">False</property> <property name="position">1</property> </packing> </child> <child> - <object class="GtkButtonBox" id="buttonbox1"> + <object class="GtkBox" id="box7"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="orientation">vertical</property> - <property name="spacing">6</property> - <property name="layout_style">start</property> + <property name="spacing">3</property> <child> - <object class="GtkButton" id="BTN_ADD"> - <property name="label">gtk-add</property> + <object class="GtkLabel" id="label6"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Background Color:</property> </object> <packing> <property name="expand">False</property> @@ -208,89 +224,83 @@ </packing> </child> <child> - <object class="GtkButton" id="BTN_MODIFY"> - <property name="label" translatable="yes">_Modify</property> + <object class="svxlo-ColorLB" id="LB_BACKGROUND_COLOR"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> + <property name="halign">start</property> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> + <property name="fill">False</property> <property name="position">1</property> </packing> </child> - <child> - <object class="GtkButton" id="BTN_DELETE"> - <property name="label">gtk-delete</property> - <property name="visible">True</property> - <property name="can_focus">False</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">3</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="grid4"> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Options</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="orientation">vertical</property> + <child> + <object class="svxlo-SvxXRectPreview" id="CTL_PREVIEW"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="column_spacing">6</property> - <child> - <object class="GtkButton" id="BTN_LOAD"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Load Pattern List</property> - <property name="tooltip_text" translatable="yes">Load Pattern List</property> - <property name="halign">center</property> - <property name="hexpand">True</property> - <property name="image">image1</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="BTN_SAVE"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Save Pattern List</property> - <property name="tooltip_text" translatable="yes">Save Pattern List</property> - <property name="halign">center</property> - <property name="hexpand">True</property> - <property name="image">image2</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="CTL_PREVIEW-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Example</property> </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> - <property name="secondary">True</property> - </packing> - </child> - </object> <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">2</property> + <property name="position">0</property> </packing> </child> </object> @@ -298,10 +308,10 @@ </object> </child> <child type="label"> - <object class="GtkLabel" id="label1"> + <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Properties</property> + <property name="label" translatable="yes">Preview</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -310,8 +320,8 @@ </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> + <property name="fill">False</property> + <property name="position">2</property> </packing> </child> </object> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
