From 802c52fb98958ec93d9791b3b4a88f3865211c47 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 29 Jul 2013 10:03:38 +0100 Subject: adjust bitmap page so buttons don't appear to jump... when swapping between tabs of the format area dialog Change-Id: I341e1661805ca49318732780de991c43898cdba5 --- cui/source/tabpages/tpbitmap.cxx | 21 +- cui/uiconfig/ui/bitmaptabpage.ui | 492 +++++++++++++++++++++------------------ 2 files changed, 268 insertions(+), 245 deletions(-) diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index eb3ed56522a7..d47155d6daec 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" @@ -69,7 +70,7 @@ SvxBitmapTabPage::SvxBitmapTabPage( Window* pParent, const SfxItemSet& rInAttrs aXFillAttr ( pXPool ), rXFSet ( aXFillAttr.GetItemSet() ) { - get(m_pBxPixelEditor,"boxEDITOR"); + get(m_pBxPixelEditor,"maingrid"); get(m_pCtlPixel,"CTL_PIXEL"); get(m_pLbColor,"LB_COLOR"); get(m_pLbBackgroundColor,"LB_BACKGROUND_COLOR"); @@ -84,21 +85,16 @@ SvxBitmapTabPage::SvxBitmapTabPage( Window* pParent, const SfxItemSet& rInAttrs get(m_pBtnSave,"BTN_SAVE"); // size of the bitmap listbox - Size aSize = LogicToPixel(Size(88, 110), MAP_APPFONT); + Size aSize = getDrawListBoxOptimalSize(this); m_pLbBitmaps->set_width_request(aSize.Width()); m_pLbBitmaps->set_height_request(aSize.Height()); - // size of the bitmap editor - Size aSize2 = LogicToPixel(Size(72, 72), MAP_APPFONT); - m_pCtlPixel->set_width_request(aSize2.Width()); - m_pCtlPixel->set_height_request(aSize2.Height()); - // size of the bitmap display - Size aSize3 = LogicToPixel(Size(88, 42), MAP_APPFONT); - m_pCtlPreview->set_width_request(aSize3.Width()); - m_pCtlPreview->set_height_request(aSize3.Height()); + Size aSize2 = getDrawPreviewOptimalSize(this); + m_pCtlPreview->set_width_request(aSize2.Width()); + m_pCtlPreview->set_height_request(aSize2.Height()); - m_pBitmapCtl = new SvxBitmapCtl(this, m_pCtlPreview->GetSizePixel()); + m_pBitmapCtl = new SvxBitmapCtl(this, aSize2); // this page needs ExchangeSupport SetExchangeSupport(); @@ -118,6 +114,7 @@ SvxBitmapTabPage::SvxBitmapTabPage( Window* pParent, const SfxItemSet& rInAttrs m_pLbColor->SetSelectHdl( LINK( this, SvxBitmapTabPage, ChangePixelColorHdl_Impl ) ); m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl ) ); + setPreviewsToSamePlace(pParent, this); } SvxBitmapTabPage::~SvxBitmapTabPage() @@ -275,7 +272,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet& ) ChangeBitmapHdl_Impl( this ); // determine button state - if( pBitmapList->Count() ) + if( pBitmapList.is() && pBitmapList->Count() ) { m_pBtnAdd->Enable(); m_pBtnModify->Enable(); diff --git a/cui/uiconfig/ui/bitmaptabpage.ui b/cui/uiconfig/ui/bitmaptabpage.ui index 2a0f6042d828..42c099877471 100644 --- a/cui/uiconfig/ui/bitmaptabpage.ui +++ b/cui/uiconfig/ui/bitmaptabpage.ui @@ -2,37 +2,126 @@ - + True False - 6 - 6 - 0 - none + True + True + 6 + vertical - + True False - 6 - 12 + True + True + 0 + none - + True False - 6 - 12 + True + True + 6 + 12 - + True False - vertical - 6 + True + True + 12 - + True False - 0 - Pattern Editor: + True + vertical + 6 + + + True + False + 0 + Pattern Editor: + + + False + True + 0 + + + + + True + False + start + start + + + Example + + + + + False + True + 1 + + + + + True + False + 0 + _Foreground color: + True + + + False + True + 2 + + + + + True + False + start + + + False + True + 3 + + + + + True + False + 0 + _Background color: + True + + + False + True + 4 + + + + + True + False + start + + + False + True + 5 + + False @@ -41,150 +130,44 @@ - + True False center start - - - False - True - 1 - - - - - True - False - 0 - _Foreground color: - True - - - False - True - 2 - - - - - True - False - start - - - False - True - 3 - - - - - True - False - 0 - _Background color: - True - - - False - True - 4 - - - - - True - False - start - - - False - True - 5 - - - - - False - True - 0 - - - - - True - False - center - start - vertical - 6 - - - True - False - True - - - False - True - 0 - - - - - True - False True - True - - - Example + vertical + 6 + + + True + False + True + + False + True + 0 + + + + + True + False + True + True + + + Example + + + + + True + True + 1 + - - - True - True - 1 - - - - - False - True - 1 - - - - - True - False - vertical - 6 - start - - - gtk-add - True - False - True - True - - - False - True - 0 - - - - - _Modify... - True - False - True - True False @@ -193,119 +176,162 @@ - - _Import... + True False - True - True - - - False - True - 2 - - - - - gtk-delete - True - False - True - True - - - False - True - 3 - - - - - True - False - 6 - 6 + vertical + 6 + start - + + gtk-add True - True + False True - True - Load Bitmap List - Load Bitmap List - center - True - image1 + True - 0 - 0 - 1 - 1 + False + True + 0 - + + _Modify True - True + False True - True - Save Bitmap List - Save Bitmap List - center - True - image2 + True + + + False + True + 1 + + + + + _Import + True + False + True + True - 1 - 0 - 1 - 1 + False + True + 2 - + + gtk-delete + True False - Bitmap + True + True - 0 - 1 - 1 - 1 + False + True + 3 - + + True + False + 6 + 6 + + + True + True + True + True + Load Bitmap List + Load Bitmap List + center + True + image1 + + + 0 + 0 + 1 + 1 + + + + + True + True + True + True + Save Bitmap List + Save Bitmap List + center + True + image2 + + + 1 + 0 + 1 + 1 + + + + + False + Bitmap + + + 0 + 1 + 1 + 1 + + + + + + + + False + True + 5 + True + False - True - 5 + False + 2 - - False - False - 2 - + + + True + False + Properties + + + + + - - - - True - False - Properties - - - - + + False + True + 0 + -- cgit