diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-29 10:03:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-29 10:29:37 +0100 |
commit | 802c52fb98958ec93d9791b3b4a88f3865211c47 (patch) | |
tree | 206c2218eb1cad25b02bfe5fb5af9a08a1223663 | |
parent | 876fdf014124543d242ea415698c5f0a5a002b98 (diff) |
adjust bitmap page so buttons don't appear to jump...
when swapping between tabs of the format area dialog
Change-Id: I341e1661805ca49318732780de991c43898cdba5
-rw-r--r-- | cui/source/tabpages/tpbitmap.cxx | 21 | ||||
-rw-r--r-- | 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 <unotools/ucbstreamhelper.hxx> #include <unotools/pathoptions.hxx> #include <sfx2/app.hxx> +#include <sfx2/dialoghelper.hxx> #include <sfx2/filedlghelper.hxx> #include <unotools/localfilehelper.hxx> #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 @@ <interface> <!-- interface-requires gtk+ 3.0 --> <!-- interface-requires LibreOffice 1.0 --> - <object class="GtkFrame" id="BitmapTabPage"> + <object class="GtkBox" id="BitmapTabPage"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="margin_left">6</property> - <property name="margin_top">6</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> <child> - <object class="GtkAlignment" id="alignment1"> + <object class="GtkFrame" id="frame1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="top_padding">6</property> - <property name="left_padding">12</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="GtkBox" id="box1"> + <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="margin_right">6</property> - <property name="spacing">12</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="boxEDITOR"> + <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> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="spacing">12</property> <child> - <object class="GtkLabel" id="FT_PIXEL_EDIT"> + <object class="GtkBox" id="maingrid"> <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="vexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="FT_PIXEL_EDIT"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Pattern Editor:</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </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">Example</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"> + <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="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_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> + </packing> + </child> + <child> + <object class="GtkLabel" id="FT_BACKGROUND_COLOR"> + <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> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</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">5</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> @@ -41,150 +130,44 @@ </packing> </child> <child> - <object class="svxlo-SvxPixelCtl" id="CTL_PIXEL"> + <object class="GtkBox" id="box3"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">center</property> <property name="valign">start</property> - </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"> - <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="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_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> - </packing> - </child> - <child> - <object class="GtkLabel" id="FT_BACKGROUND_COLOR"> - <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> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">4</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">5</property> - </packing> - </child> - </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">center</property> - <property name="valign">start</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> - <child> - <object class="svxlo-BitmapLB" id="LB_BITMAPS:border"> - <property name="visible">True</property> - <property name="can_focus">False</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="svxlo-SvxXRectPreview" id="CTL_PREVIEW"> - <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> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="svxlo-BitmapLB" id="LB_BITMAPS:border"> + <property name="visible">True</property> + <property name="can_focus">False</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="svxlo-SvxXRectPreview" id="CTL_PREVIEW"> + <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> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> - </object> - <packing> - <property name="expand">True</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="GtkButtonBox" id="buttonbox1"> - <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> - <child> - <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="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="BTN_MODIFY"> - <property name="label" translatable="yes">_Modify...</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> </object> <packing> <property name="expand">False</property> @@ -193,119 +176,162 @@ </packing> </child> <child> - <object class="GtkButton" id="BTN_IMPORT"> - <property name="label" translatable="yes">_Import...</property> + <object class="GtkButtonBox" id="buttonbox1"> <property name="visible">True</property> <property name="can_focus">False</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="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"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <property name="layout_style">start</property> <child> - <object class="GtkButton" id="BTN_LOAD"> + <object class="GtkButton" id="BTN_ADD"> + <property name="label">gtk-add</property> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can_focus">False</property> <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Load Bitmap List</property> - <property name="tooltip_text" translatable="yes">Load Bitmap List</property> - <property name="halign">center</property> - <property name="hexpand">True</property> - <property name="image">image1</property> + <property name="use_stock">True</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> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkButton" id="BTN_SAVE"> + <object class="GtkButton" id="BTN_MODIFY"> + <property name="label" translatable="yes">_Modify</property> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="can_focus">False</property> <property name="receives_default">True</property> - <property name="has_tooltip">True</property> - <property name="tooltip_markup" translatable="yes">Save Bitmap List</property> - <property name="tooltip_text" translatable="yes">Save Bitmap List</property> - <property name="halign">center</property> - <property name="hexpand">True</property> - <property name="image">image2</property> + <property name="use_underline">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="BTN_IMPORT"> + <property name="label" translatable="yes">_Import</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + <property name="use_underline">True</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> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> </packing> </child> <child> - <object class="GtkLabel" id="FT_BITMAPS_HIDDEN"> + <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="label" translatable="yes">Bitmap</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> </packing> </child> <child> - <placeholder/> + <object class="GtkGrid" id="grid4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</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 Bitmap List</property> + <property name="tooltip_text" translatable="yes">Load Bitmap 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 Bitmap List</property> + <property name="tooltip_text" translatable="yes">Save Bitmap List</property> + <property name="halign">center</property> + <property name="hexpand">True</property> + <property name="image">image2</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> + <child> + <object class="GtkLabel" id="FT_BITMAPS_HIDDEN"> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Bitmap</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <placeholder/> + </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">True</property> - <property name="position">5</property> + <property name="fill">False</property> + <property name="position">2</property> </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> </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">Properties</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </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">Properties</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> </child> </object> <object class="GtkImage" id="image1"> |