Kaydet (Commit) a984387f authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SpellOptionsDialog

Change-Id: I813b166a8c4658e08b185a43a464b6b370b62c66
Reviewed-on: https://gerrit.libreoffice.org/69099
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 7953c8a9
......@@ -491,16 +491,16 @@ IMPL_LINK( SpellDialog, CheckGrammarHdl, Button*, pBox, void )
void SpellDialog::StartSpellOptDlg_Impl()
{
SfxItemSet aSet( SfxGetpApp()->GetPool(), svl::Items<SID_AUTOSPELL_CHECK,SID_AUTOSPELL_CHECK>{});
ScopedVclPtr<SfxSingleTabDialog> pDlg(
VclPtr<SfxSingleTabDialog>::Create(
this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui"));
VclPtr<SfxTabPage> pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), &aSet );
static_cast<SvxLinguTabPage*>(pPage.get())->HideGroups( GROUP_MODULES );
pDlg->SetTabPage( pPage );
if(RET_OK == pDlg->Execute())
SfxSingleTabDialogController aDlg(GetFrameWeld(), aSet, "cui/ui/spelloptionsdialog.ui", "SpellOptionsDialog");
TabPageParent aParent(aDlg.get_content_area(), &aDlg);
VclPtr<SfxTabPage> xPage = SvxLinguTabPage::Create(aParent, &aSet);
static_cast<SvxLinguTabPage*>(xPage.get())->HideGroups( GROUP_MODULES );
aDlg.SetTabPage(xPage);
if (RET_OK == aDlg.run())
{
InitUserDicts();
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
if(pOutSet)
OfaTreeOptionsDialog::ApplyLanguageOptions(*pOutSet);
}
......
......@@ -930,10 +930,6 @@ SvxLinguTabPage::SvxLinguTabPage(TabPageParent pParent, const SfxItemSet& rSet)
m_xLinguDicsCLB->set_column_fixed_widths(aWidths);
m_xLinguOptionsCLB->set_column_fixed_widths(aWidths);
m_xLinguModulesCLB->set_size_request(-1, m_xLinguModulesCLB->get_height_rows(3));
m_xLinguDicsCLB->set_size_request(-1, m_xLinguDicsCLB->get_height_rows(5));
m_xLinguOptionsCLB->set_size_request(-1, m_xLinguOptionsCLB->get_height_rows(5));
m_xLinguModulesCLB->connect_changed( LINK( this, SvxLinguTabPage, SelectHdl_Impl ));
m_xLinguModulesCLB->connect_row_activated(LINK(this, SvxLinguTabPage, BoxDoubleClickHdl_Impl));
m_xLinguModulesCLB->connect_toggled(LINK(this, SvxLinguTabPage, ModulesBoxCheckButtonHdl_Impl));
......@@ -1343,6 +1339,13 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
m_xLinguOptionsCLB->set_id(nEntry, OUString::number(nUserData));
m_xLinguOptionsCLB->thaw();
m_xLinguModulesCLB->set_size_request(m_xLinguModulesCLB->get_preferred_size().Width(),
m_xLinguModulesCLB->get_height_rows(3));
m_xLinguDicsCLB->set_size_request(m_xLinguDicsCLB->get_preferred_size().Width(),
m_xLinguDicsCLB->get_height_rows(5));
m_xLinguOptionsCLB->set_size_request(m_xLinguOptionsCLB->get_preferred_size().Width(),
m_xLinguOptionsCLB->get_height_rows(5));
}
IMPL_LINK(SvxLinguTabPage, BoxDoubleClickHdl_Impl, weld::TreeView&, rBox, void)
......
......@@ -41,6 +41,8 @@
<object class="GtkGrid" id="OptLinguPage">
<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="row_spacing">12</property>
<child>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="SpellOptionsDialog">
......@@ -7,7 +7,11 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="spelloptionsdialog|SpellOptionsDialog">Options</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
......@@ -80,8 +84,5 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</interface>
......@@ -6495,15 +6495,20 @@ public:
virtual Size get_preferred_size() const override
{
Size aRet(-1, -1);
GtkWidget* pParent = gtk_widget_get_parent(m_pWidget);
if (GTK_IS_SCROLLED_WINDOW(pParent))
{
return Size(gtk_scrolled_window_get_min_content_width(GTK_SCROLLED_WINDOW(pParent)),
aRet = Size(gtk_scrolled_window_get_min_content_width(GTK_SCROLLED_WINDOW(pParent)),
gtk_scrolled_window_get_min_content_height(GTK_SCROLLED_WINDOW(pParent)));
}
GtkRequisition size;
gtk_widget_get_preferred_size(m_pWidget, nullptr, &size);
return Size(size.width, size.height);
if (aRet.Width() == -1)
aRet.setWidth(size.width);
if (aRet.Height() == -1)
aRet.setHeight(size.height);
return aRet;
}
virtual void set_visible(bool visible) override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment