diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-09 10:47:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-09 10:55:24 +0100 |
commit | ac696f8b2d4ef40d6bf50207bcab8d902cd06415 (patch) | |
tree | 7e14f853446a86623896aa49c979d736ec6b1902 /svx | |
parent | d8f53bbe2bb705fc067ee8cf653446916b469eb2 (diff) |
tweak conversion a bit
a) rework to remove the need for a ::Resize impl
b) move the explicit pixel size into relative APP_FONT size
c) lock down the target combobox size so it doesn't jump around
Change-Id: Iad995453c178234d1ad0f794b5193920dcd275fe
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 50 | ||||
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 5 | ||||
-rw-r--r-- | svx/source/dialog/imapwnd.hxx | 1 | ||||
-rw-r--r-- | svx/uiconfig/ui/imapdialog.ui | 127 | ||||
-rw-r--r-- | svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui | 5 | ||||
-rw-r--r-- | svx/uiconfig/ui/querysaveimagemapchangesdialog.ui | 5 |
6 files changed, 98 insertions, 95 deletions
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index c153103f752f..64bcedda3c67 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -125,12 +125,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeStatusBar(Window *pParent, return new StatusBar(pParent); } -SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW, - Window* _pParent ) : - SfxModelessDialog ( _pBindings, pCW, _pParent, "ImapDialog", "svx/ui/imapdialog.ui" ), - maImageList ( SVX_RES( IL_IMAPDLG ) ), - pCheckObj ( NULL ), - aIMapItem ( SID_IMAP_EXEC, *this, *_pBindings ) +SvxIMapDlg::SvxIMapDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, Window* _pParent) + : SfxModelessDialog(_pBindings, pCW, _pParent, "ImapDialog", "svx/ui/imapdialog.ui") + , maImageList(SVX_RES(IL_IMAPDLG)) + , pCheckObj(NULL) + , aIMapItem(SID_IMAP_EXEC, *this, *_pBindings) { get(m_pTbxIMapDlg1, "toolbar"); m_pTbxIMapDlg1->InsertSeparator(3, 5); @@ -180,10 +179,23 @@ SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW, get(m_pEdtText, "text"); get(m_pFtTarget, "targetft"); get(m_pCbbTarget, "target"); + + //lock this down so it doesn't jump around in size + //as entries are added later on + TargetList aTmpList; + SfxFrame::GetDefaultTargetList(aTmpList); + for (size_t i = 0, n = aTmpList.size(); i < n; ++i) + m_pCbbTarget->InsertEntry(aTmpList[i]); + Size aPrefSize(m_pCbbTarget->get_preferred_size()); + m_pCbbTarget->set_width_request(aPrefSize.Width()); + m_pCbbTarget->Clear(); + get(m_pStbStatus, "statusbar"); VclVBox* _pContainer = get<VclVBox>("container"); pIMapWnd = new IMapWindow( _pContainer, WB_BORDER, _pBindings->GetActiveFrame() ); + pIMapWnd->set_hexpand(true); + pIMapWnd->set_vexpand(true); pIMapWnd->Show(); ApplyImageList(); @@ -237,30 +249,6 @@ SvxIMapDlg::~SvxIMapDlg() delete pOwnData; } -void SvxIMapDlg::Resize() -{ - Size aMinSize( GetMinOutputSizePixel() ); - Size aNewSize( GetOutputSizePixel() ); - - if ( aNewSize.Height() >= aMinSize.Height() ) - { - VclVBox *_pMainBox = get<VclVBox>("mainbox"); - _pMainBox->SetSizePixel( aNewSize ); - - Size _aSize( m_pStbStatus->GetSizePixel() ); - Point aPoint( 0, aNewSize.Height() - _aSize.Height() ); - - // Position the EditWindow - VclVBox *_pContainer = get<VclVBox>("container"); - _aSize.Width() = aNewSize.Width() - 6; - _aSize.Height() = aPoint.Y() - _pContainer->GetPosPixel().Y() - 12; - - pIMapWnd->SetSizePixel( _aSize ); - - aLastSize = aNewSize; - } -} - bool SvxIMapDlg::Close() { bool bRet = true; @@ -317,7 +305,7 @@ const ImageMap& SvxIMapDlg::GetImageMap() const void SvxIMapDlg::SetTargetList( const TargetList& rTargetList ) { - TargetList aNewList( rTargetList ); + TargetList aNewList( rTargetList ); pIMapWnd->SetTargetList( aNewList ); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 3b62e39595af..67fe824c34b2 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -75,6 +75,11 @@ IMapWindow::~IMapWindow() delete[] pItemInfo; } +Size IMapWindow::GetOptimalSize() const +{ + return LogicToPixel(Size(270, 170), MAP_APPFONT); +} + void IMapWindow::SetImageMap( const ImageMap& rImageMap ) { ReplaceImageMap( rImageMap, false ); diff --git a/svx/source/dialog/imapwnd.hxx b/svx/source/dialog/imapwnd.hxx index 1d2ee7e6547e..f62a832c7758 100644 --- a/svx/source/dialog/imapwnd.hxx +++ b/svx/source/dialog/imapwnd.hxx @@ -107,6 +107,7 @@ protected: // GraphCtrl virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE; + virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; virtual void SdrObjCreated( const SdrObject& rObj ) SAL_OVERRIDE; diff --git a/svx/uiconfig/ui/imapdialog.ui b/svx/uiconfig/ui/imapdialog.ui index 8c249e12abc6..45be1786aee8 100644 --- a/svx/uiconfig/ui/imapdialog.ui +++ b/svx/uiconfig/ui/imapdialog.ui @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> <!-- interface-requires LibreOffice 1.0 --> <object class="GtkWindow" id="ImapDialog"> <property name="can_focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="border_width">6</property> <property name="title" translatable="yes">ImageMap Editor</property> <child> <object class="GtkBox" id="mainbox"> @@ -26,7 +28,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_APPLY</property> <property name="label" translatable="yes">Apply</property> <property name="icon_name">svx/res/id01.png</property> @@ -42,7 +43,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_OPEN</property> <property name="label" translatable="yes">Open...</property> <property name="icon_name">svx/res/id02.png</property> @@ -58,7 +58,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_SAVEAS</property> <property name="label" translatable="yes">Save...</property> <property name="icon_name">svx/res/id03.png</property> @@ -74,7 +73,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_SELECT</property> <property name="label" translatable="yes">Select</property> <property name="icon_name">svx/res/id04.png</property> @@ -90,7 +88,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_RECT</property> <property name="label" translatable="yes">Rectangle</property> <property name="icon_name">svx/res/id05.png</property> @@ -106,7 +103,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_CIRCLE</property> <property name="label" translatable="yes">Ellipse</property> <property name="icon_name">svx/res/id06.png</property> @@ -122,7 +118,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_POLY</property> <property name="label" translatable="yes">Polygon</property> <property name="icon_name">svx/res/id07.png</property> @@ -138,7 +133,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_FREEPOLY</property> <property name="label" translatable="yes">Freeform Polygon</property> <property name="icon_name">svx/res/id08.png</property> @@ -154,7 +148,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_POLYEDIT</property> <property name="label" translatable="yes">Edit Points</property> <property name="icon_name">svx/res/id030.png</property> @@ -170,7 +163,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_POLYMOVE</property> <property name="label" translatable="yes">Move Points</property> <property name="icon_name">svx/res/id031.png</property> @@ -186,7 +178,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_POLYINSERT</property> <property name="label" translatable="yes">Insert Points</property> <property name="icon_name">svx/res/id032.png</property> @@ -202,7 +193,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_POLYDELETE</property> <property name="label" translatable="yes">Delete Points</property> <property name="icon_name">svx/res/id033.png</property> @@ -218,7 +208,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_UNDO</property> <property name="label" translatable="yes">Undo </property> <property name="icon_name">svx/res/id040.png</property> @@ -234,7 +223,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_REDO</property> <property name="label" translatable="yes">Redo</property> <property name="icon_name">svx/res/id041.png</property> @@ -250,7 +238,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_ACTIVE</property> <property name="label" translatable="yes">Active</property> <property name="icon_name">svx/res/id016.png</property> @@ -266,7 +253,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_MACRO</property> <property name="label" translatable="yes">Macro...</property> <property name="icon_name">svx/res/id018.png</property> @@ -282,7 +268,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="use_action_appearance">False</property> <property name="action_name">TBI_PROPERTY</property> <property name="label" translatable="yes">Properties...</property> <property name="icon_name">svx/res/id019.png</property> @@ -304,13 +289,15 @@ <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="column_spacing">12</property> <child> <object class="GtkLabel" id="urlft"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes">Address:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">url</property> </object> <packing> <property name="left_attach">0</property> @@ -320,38 +307,71 @@ </packing> </child> <child> - <object class="GtkLabel" id="textft"> + <object class="svtlo-SvtURLBox" id="url"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="label" translatable="yes">Text:</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <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="targetft"> + <object class="GtkGrid" id="grid2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="label" translatable="yes">Frame:</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="text"> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="targetft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">Frame:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">target</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="GtkEntry" id="text"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">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> + </packing> + </child> + <child> + <object class="GtkComboBox" id="target"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_entry">True</property> + <child internal-child="entry"> + <object class="GtkEntry" id="combobox-entry"> + <property name="can_focus">True</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> </object> <packing> <property name="left_attach">1</property> @@ -361,32 +381,16 @@ </packing> </child> <child> - <object class="svtlo-SvtURLBox" id="url"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">3</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="target"> + <object class="GtkLabel" id="textft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="has_entry">True</property> - <child internal-child="entry"> - <object class="GtkEntry" id="combobox-entry"> - <property name="can_focus">False</property> - </object> - </child> + <property name="halign">start</property> + <property name="label" translatable="yes">Text:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">text</property> </object> <packing> - <property name="left_attach">3</property> + <property name="left_attach">0</property> <property name="top_attach">1</property> <property name="width">1</property> <property name="height">1</property> @@ -401,7 +405,6 @@ </child> <child> <object class="GtkBox" id="container:border"> - <property name="height_request">200</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> diff --git a/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui b/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui index 33e388e4a550..c7a6a4442a2c 100644 --- a/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui +++ b/svx/uiconfig/ui/querymodifyimagemapchangesdialog.ui @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> <object class="GtkMessageDialog" id="QueryModifyImageMapChangesDialog"> <property name="can_focus">False</property> <property name="border_width">12</property> @@ -26,6 +27,8 @@ <property name="label">gtk-cancel</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> diff --git a/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui b/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui index bf49e7315634..2a56108e5dcf 100644 --- a/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui +++ b/svx/uiconfig/ui/querysaveimagemapchangesdialog.ui @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> <interface> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> <object class="GtkMessageDialog" id="QuerySaveImageMapChangesDialog"> <property name="can_focus">False</property> <property name="border_width">12</property> @@ -26,6 +27,8 @@ <property name="label">gtk-cancel</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> |