20#include <svx/svxids.hrc>
37 XATTR_FILLTRANSPARENCE, XATTR_FILLTRANSPARENCE,
38 XATTR_FILLFLOATTRANSPARENCE, XATTR_FILLFLOATTRANSPARENCE,
39 SDRATTR_SHADOWTRANSPARENCE, SDRATTR_SHADOWTRANSPARENCE
51 ActivateLinear(
false);
52 ActivateGradient(
false);
57 m_aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
58 m_aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
60 InvalidatePreview(
false);
67 ActivateGradient(
false);
71 ModifyTransparentHdl_Impl(*m_xMtrTransparent);
77 ActivateLinear(
false);
78 ActivateGradient(
true);
82 ModifiedTrgrHdl_Impl(
nullptr);
96 sal_uInt16
nPos = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
105 ModifiedTrgrHdl_Impl(&rListBox);
110 ModifiedTrgrHdl_Impl(
nullptr);
117 css::awt::GradientStyle eXGS =
static_cast<css::awt::GradientStyle
>(
m_xLbTrgrGradientType->get_active());
143 css::awt::GradientStyle eXGS =
static_cast<css::awt::GradientStyle
>(
m_xLbTrgrGradientType->get_active());
152 case css::awt::GradientStyle_LINEAR:
153 case css::awt::GradientStyle_AXIAL:
162 case css::awt::GradientStyle_RADIAL:
171 case css::awt::GradientStyle_ELLIPTICAL:
172 case css::awt::GradientStyle_SQUARE:
173 case css::awt::GradientStyle_RECT:
187 :
SfxTabPage(pPage, pController,
"cui/ui/transparencytabpage.ui",
"TransparencyTabPage", &rInAttrs)
188 , rOutAttrs(rInAttrs)
192 , aXFillAttr(rInAttrs.GetPool())
194 , m_xRbtTransOff(m_xBuilder->weld_radio_button(
"RBT_TRANS_OFF"))
195 , m_xRbtTransLinear(m_xBuilder->weld_radio_button(
"RBT_TRANS_LINEAR"))
196 , m_xRbtTransGradient(m_xBuilder->weld_radio_button(
"RBT_TRANS_GRADIENT"))
197 , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button(
"MTR_TRANSPARENT",
FieldUnit::
PERCENT))
198 , m_xGridGradient(m_xBuilder->weld_widget(
"gridGradient"))
199 , m_xLbTrgrGradientType(m_xBuilder->weld_combo_box(
"LB_TRGR_GRADIENT_TYPES"))
200 , m_xFtTrgrCenterX(m_xBuilder->weld_label(
"FT_TRGR_CENTER_X"))
201 , m_xMtrTrgrCenterX(m_xBuilder->weld_metric_spin_button(
"MTR_TRGR_CENTER_X",
FieldUnit::
PERCENT))
202 , m_xFtTrgrCenterY(m_xBuilder->weld_label(
"FT_TRGR_CENTER_Y"))
203 , m_xMtrTrgrCenterY(m_xBuilder->weld_metric_spin_button(
"MTR_TRGR_CENTER_Y",
FieldUnit::
PERCENT))
204 , m_xFtTrgrAngle(m_xBuilder->weld_label(
"FT_TRGR_ANGLE"))
205 , m_xMtrTrgrAngle(m_xBuilder->weld_metric_spin_button(
"MTR_TRGR_ANGLE",
FieldUnit::
DEGREE))
206 , m_xMtrTrgrBorder(m_xBuilder->weld_metric_spin_button(
"MTR_TRGR_BORDER",
FieldUnit::
PERCENT))
207 , m_xMtrTrgrStartValue(m_xBuilder->weld_metric_spin_button(
"MTR_TRGR_START_VALUE",
FieldUnit::
PERCENT))
208 , m_xMtrTrgrEndValue(m_xBuilder->weld_metric_spin_button(
"MTR_TRGR_END_VALUE",
FieldUnit::
PERCENT))
209 , m_xCtlBitmapBorder(m_xBuilder->weld_widget(
"bitmap_border"))
210 , m_xCtlXRectBorder(m_xBuilder->weld_widget(
"trans_border"))
211 , m_xCtlBitmapPreview(new
weld::CustomWeld(*m_xBuilder,
"CTL_IMAGE_PREVIEW", m_aCtlBitmapPreview))
212 , m_xCtlXRectPreview(new
weld::CustomWeld(*m_xBuilder,
"CTL_TRANS_PREVIEW", m_aCtlXRectPreview))
241 return std::make_unique<SvxTransparenceTabPage>(pPage, pController, *rAttrs);
250 bool bGradActive = (eStateGradient == SfxItemState::SET &&
static_cast<const XFillFloatTransparenceItem*
>(pGradientItem)->IsEnabled());
253 bool bGradUsed = (eStateGradient == SfxItemState::DONTCARE);
254 bool bLinearUsed = (eStateLinear == SfxItemState::DONTCARE);
256 bool bModified(
false);
257 bool bSwitchOffLinear(
false);
258 bool bSwitchOffGradient(
false);
272 rAttrs->
Put(aShadowItem);
274 bSwitchOffGradient =
true;
306 bSwitchOffLinear =
true;
313 bSwitchOffGradient =
true;
314 bSwitchOffLinear =
true;
318 if(bSwitchOffGradient && (bGradActive || bGradUsed))
331 if(bSwitchOffLinear && (bLinearActive || bLinearUsed))
336 rAttrs->
Put(aShadowItem);
347 bool bGradActive = (pGradientItem && pGradientItem->
IsEnabled());
353 bool bLinearActive = (pLinearItem && pLinearItem->GetValue() != 0);
367 m_xMtrTrgrStartValue->set_value(
static_cast<sal_uInt16
>(((
static_cast<sal_uInt16
>(aStart.
GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT);
368 m_xMtrTrgrEndValue->set_value(
static_cast<sal_uInt16
>(((
static_cast<sal_uInt16
>(aEnd.
GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT);
378 sal_uInt16 nTransp = pLinearItem->GetValue();
389 else if(bLinearActive)
437 return DeactivateRC::LeavePage;
516 aStartBColor.
clamp();
528 aColorStops.emplace_back(0.0, aStartBColor);
529 aColorStops.emplace_back(1.0, aEndBColor);
sal_uInt16 GetValue() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetExchangeSupport()
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
bool InitPreview(const SfxItemSet &rSet)
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrStartValue
basegfx::BColorStops createColorStops()
virtual ~SvxTransparenceTabPage() override
void ActivateGradient(bool bActivate)
std::unique_ptr< weld::Widget > m_xCtlXRectBorder
XFillAttrSetItem aXFillAttr
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrCenterX
basegfx::BColorStops maColorStops
std::unique_ptr< weld::Label > m_xFtTrgrCenterX
const SfxItemSet & rOutAttrs
SvxXRectPreview m_aCtlBitmapPreview
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::Widget > m_xGridGradient
void InvalidatePreview(bool bEnable=true)
std::unique_ptr< weld::CustomWeld > m_xCtlXRectPreview
std::unique_ptr< weld::CustomWeld > m_xCtlBitmapPreview
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::ComboBox > m_xLbTrgrGradientType
std::unique_ptr< weld::Widget > m_xCtlBitmapBorder
std::unique_ptr< weld::RadioButton > m_xRbtTransOff
std::unique_ptr< weld::RadioButton > m_xRbtTransGradient
virtual void ChangesApplied() override
SvxTransparenceTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
void ModifiedTrgrHdl_Impl(const weld::ComboBox *)
virtual void PageCreated(const SfxAllItemSet &aSet) override
std::unique_ptr< weld::MetricSpinButton > m_xMtrTransparent
linear transparency
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrBorder
void SetControlState_Impl(css::awt::GradientStyle eXGS)
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrAngle
SvxXRectPreview m_aCtlXRectPreview
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrCenterY
void SetPageType(PageType nInType)
std::unique_ptr< weld::MetricSpinButton > m_xMtrTrgrEndValue
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
void ActivateLinear(bool bActivate)
std::unique_ptr< weld::RadioButton > m_xRbtTransLinear
static const WhichRangesContainer pTransparenceRanges
std::unique_ptr< weld::Label > m_xFtTrgrCenterY
virtual void ActivatePage(const SfxItemSet &rSet) override
void SetDlgType(sal_uInt16 nInType)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::Label > m_xFtTrgrAngle
void SetAttributes(const SfxItemSet &rItemSet)
void SetEnabled(bool bEnable)
const basegfx::BGradient & GetGradientValue() const
sal_uInt16 GetBorder() const
sal_uInt16 GetXOffset() const
const basegfx::BColorStops & GetColorStops() const
Degree10 GetAngle() const
css::awt::GradientStyle GetGradientStyle() const
sal_uInt16 GetYOffset() const
virtual tools::Long GetValue() const override
#define LINK(Instance, Class, Member)
static constexpr auto Items
SdrPercentItem makeSdrShadowTransparenceItem(sal_uInt16 nTransp)
UNDERLYING_TYPE get() const
IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransOffHdl_Impl, weld::Toggleable &, void)
IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl, weld::ComboBox &, rListBox, void)
constexpr OUStringLiteral PERCENT(u"Percent")
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillBackgroundItem > XATTR_FILLBACKGROUND(XATTR_FILL_FIRST+19)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)