summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-24 09:43:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-24 10:05:23 +0100
commit5b98dcd94f08242f108a61928ba31c5ab5b3fe7a (patch)
tree541cde5cc349daceffde33c86a6cc94fcb9bc9f5 /cui
parent6a2bbceb295768f4b2f079523ff7864761d50776 (diff)
loop through all pages to get optimal size
Change-Id: Ie565ec33c8eaacb490eebcacec7662fde511e98a
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx30
-rw-r--r--cui/source/inc/iconcdlg.hxx1
-rw-r--r--cui/uiconfig/ui/hyperlinkdialog.ui3
3 files changed, 26 insertions, 8 deletions
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 97f548566ab3..33081c158a07 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -111,7 +111,10 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
aImage = Image( CUI_RES ( RID_SVXBMP_HLDOCNTP ) );
pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_NEWDOCUMENT, aStrTitle, aImage, SvxHyperlinkNewDocTp::Create );
pEntry->SetQuickHelpText( CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCNTP_HELP ) );
- SetCurPageId(RID_SVXPAGE_HYPERLINK_INTERNET);
+
+ // set OK/Cancel - button
+ GetOKButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_APPLYBUT) );
+ GetCancelButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_CLOSEBUT) );
// create itemset for tabpages
mpItemSet = new SfxItemSet( SFX_APP()->GetPool(), SID_HYPERLINK_GETLINK,
@@ -122,15 +125,32 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
SetInputSet (mpItemSet);
+ //loop through the pages and get their max bounds and lock that down
+ ShowPage(RID_SVXPAGE_HYPERLINK_NEWDOCUMENT);
+ VclBox *pBox = get_content_area();
+ Size aMaxPrefSize(pBox->get_preferred_size());
+ ShowPage(RID_SVXPAGE_HYPERLINK_DOCUMENT);
+ Size aSize(pBox->get_preferred_size());
+ aMaxPrefSize.Width() = std::max(aMaxPrefSize.Width(), aSize.Width());
+ aMaxPrefSize.Height() = std::max(aMaxPrefSize.Height(), aSize.Height());
+ ShowPage(RID_SVXPAGE_HYPERLINK_MAIL);
+ aSize = pBox->get_preferred_size();
+ aMaxPrefSize.Width() = std::max(aMaxPrefSize.Width(), aSize.Width());
+ aMaxPrefSize.Height() = std::max(aMaxPrefSize.Height(), aSize.Height());
+ ShowPage(RID_SVXPAGE_HYPERLINK_INTERNET);
+ aSize = pBox->get_preferred_size();
+ aMaxPrefSize.Width() = std::max(aMaxPrefSize.Width(), aSize.Width());
+ aMaxPrefSize.Height() = std::max(aMaxPrefSize.Height(), aSize.Height());
+ pBox->set_width_request(aMaxPrefSize.Width());
+ pBox->set_height_request(aMaxPrefSize.Height());
+
+ SetCurPageId(RID_SVXPAGE_HYPERLINK_INTERNET);
+
// Init Dialog
Start (false);
pBindings->Update( SID_READONLY_MODE );
- // set OK/Cancel - button
- GetOKButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_APPLYBUT) );
- GetCancelButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_CLOSEBUT) );
-
GetOKButton().SetClickHdl ( LINK ( this, SvxHpLinkDlg, ClickApplyHdl_Impl ) );
GetCancelButton().SetClickHdl( LINK ( this, SvxHpLinkDlg, ClickCloseHdl_Impl ) );
}
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index 8bc677c6af9e..dec537351518 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -139,7 +139,6 @@ private :
PushButton *m_pResetBtn;
VclVBox *m_pTabContainer;
-
const SfxItemSet* pSet;
SfxItemSet* pOutSet;
SfxItemSet* pExampleSet;
diff --git a/cui/uiconfig/ui/hyperlinkdialog.ui b/cui/uiconfig/ui/hyperlinkdialog.ui
index d547d6e84640..5a55417ab304 100644
--- a/cui/uiconfig/ui/hyperlinkdialog.ui
+++ b/cui/uiconfig/ui/hyperlinkdialog.ui
@@ -4,8 +4,6 @@
<requires lib="gtk+" version="3.0"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkDialog" id="HyperlinkDialog">
- <property name="width_request">550</property>
- <property name="height_request">400</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
@@ -102,6 +100,7 @@
<child>
<object class="cuilo-SvtIconChoiceCtrl" id="icon_control">
<property name="width_request">110</property>
+ <property name="height_request">400</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin">0</property>