summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/dlgname.cxx13
-rw-r--r--include/cui/dlgname.hxx4
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx14
-rw-r--r--sw/source/uibase/inc/frmpage.hxx2
4 files changed, 33 insertions, 0 deletions
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 84f21a86d616..fa12a158445f 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -90,7 +90,9 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(weld::Window* pParent, const
const OUString& rDescription,
bool const isDecorative)
: GenericDialogController(pParent, "cui/ui/objecttitledescdialog.ui", "ObjectTitleDescDialog")
+ , m_xTitleFT(m_xBuilder->weld_label("object_title_label"))
, m_xEdtTitle(m_xBuilder->weld_entry("object_title_entry"))
+ , m_xDescriptionFT(m_xBuilder->weld_label("desc_label"))
, m_xEdtDescription(m_xBuilder->weld_text_view("desc_entry"))
, m_xDecorativeCB(m_xBuilder->weld_check_button("decorative"))
{
@@ -104,6 +106,17 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(weld::Window* pParent, const
m_xEdtTitle->select_region(0, -1);
m_xDecorativeCB->set_active(isDecorative);
+ m_xDecorativeCB->connect_toggled(LINK(this, SvxObjectTitleDescDialog, DecorativeHdl));
+ DecorativeHdl(*m_xDecorativeCB);
+}
+
+IMPL_LINK_NOARG(SvxObjectTitleDescDialog, DecorativeHdl, weld::Toggleable&, void)
+{
+ bool const bEnable(!m_xDecorativeCB->get_active());
+ m_xEdtTitle->set_sensitive(bEnable);
+ m_xTitleFT->set_sensitive(bEnable);
+ m_xEdtDescription->set_sensitive(bEnable);
+ m_xDescriptionFT->set_sensitive(bEnable);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/cui/dlgname.hxx b/include/cui/dlgname.hxx
index 04fc5610e937..b402593832b1 100644
--- a/include/cui/dlgname.hxx
+++ b/include/cui/dlgname.hxx
@@ -105,13 +105,17 @@ class SvxObjectTitleDescDialog : public weld::GenericDialogController
{
private:
// title
+ std::unique_ptr<weld::Label> m_xTitleFT;
std::unique_ptr<weld::Entry> m_xEdtTitle;
// description
+ std::unique_ptr<weld::Label> m_xDescriptionFT;
std::unique_ptr<weld::TextView> m_xEdtDescription;
std::unique_ptr<weld::CheckButton> m_xDecorativeCB;
+ DECL_LINK(DecorativeHdl, weld::Toggleable&, void);
+
public:
// constructor
SvxObjectTitleDescDialog(weld::Window* pWindow, const OUString& rTitle, const OUString& rDesc,
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index dc4e98da5b84..f9cb766718b1 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2860,6 +2860,7 @@ SwFrameAddPage::SwFrameAddPage(weld::Container* pPage, weld::DialogController* p
, m_xNameED(m_xBuilder->weld_entry("name"))
, m_xAltNameFT(m_xBuilder->weld_label("altname_label"))
, m_xAltNameED(m_xBuilder->weld_entry("altname"))
+ , m_xDescriptionFT(m_xBuilder->weld_label("description_label"))
, m_xDescriptionED(m_xBuilder->weld_text_view("description"))
, m_xDecorativeCB(m_xBuilder->weld_check_button("decorative"))
, m_xSequenceFrame(m_xBuilder->weld_widget("frmSequence"))
@@ -2884,6 +2885,8 @@ SwFrameAddPage::SwFrameAddPage(weld::Container* pPage, weld::DialogController* p
m_xTextFlowLB->append(SvxFrameDirection::Vertical_LR_BT, SvxResId(RID_SVXSTR_PAGEDIR_LTR_BTT_VERT));
m_xTextFlowLB->append(SvxFrameDirection::Environment, SvxResId(RID_SVXSTR_FRAMEDIR_SUPER));
m_xDescriptionED->set_size_request(-1, m_xDescriptionED->get_preferred_size().Height());
+
+ m_xDecorativeCB->connect_toggled(LINK(this, SwFrameAddPage, DecorativeHdl));
}
SwFrameAddPage::~SwFrameAddPage()
@@ -3090,6 +3093,8 @@ void SwFrameAddPage::Reset(const SfxItemSet *rSet )
m_xVertAlignLB->set_active(nPos);
}
m_xVertAlignLB->save_value();
+
+ DecorativeHdl(*m_xDecorativeCB);
}
bool SwFrameAddPage::FillItemSet(SfxItemSet *rSet)
@@ -3178,6 +3183,15 @@ IMPL_LINK_NOARG(SwFrameAddPage, EditModifyHdl, weld::Entry&, void)
m_xAltNameFT->set_sensitive(bEnable);
}
+IMPL_LINK_NOARG(SwFrameAddPage, DecorativeHdl, weld::Toggleable&, void)
+{
+ bool const bEnable(!m_xDecorativeCB->get_active());
+ m_xAltNameED->set_sensitive(bEnable);
+ m_xAltNameFT->set_sensitive(bEnable);
+ m_xDescriptionED->set_sensitive(bEnable);
+ m_xDescriptionFT->set_sensitive(bEnable);
+}
+
void SwFrameAddPage::SetFormatUsed(bool bFormatUsed)
{
m_bFormat = bFormatUsed;
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 8270004838e2..6f05ca1d651a 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -281,6 +281,7 @@ class SwFrameAddPage final : public SfxTabPage
std::unique_ptr<weld::Entry> m_xNameED;
std::unique_ptr<weld::Label> m_xAltNameFT;
std::unique_ptr<weld::Entry> m_xAltNameED;
+ std::unique_ptr<weld::Label> m_xDescriptionFT;
std::unique_ptr<weld::TextView> m_xDescriptionED;
std::unique_ptr<weld::CheckButton> m_xDecorativeCB;
std::unique_ptr<weld::Widget> m_xSequenceFrame;
@@ -302,6 +303,7 @@ class SwFrameAddPage final : public SfxTabPage
std::unique_ptr<svx::FrameDirectionListBox> m_xTextFlowLB;
DECL_LINK(EditModifyHdl, weld::Entry&, void);
+ DECL_LINK(DecorativeHdl, weld::Toggleable&, void);
DECL_LINK(ChainModifyHdl, weld::ComboBox&, void);
static const WhichRangesContainer s_aAddPgRg;