Kaydet (Commit) cc43153f authored tarafından Rishabh Kumar's avatar Rishabh Kumar Kaydeden (comit) Caolán McNamara

tdf#87702: Addition of Shadow sidebar tab

Change-Id: I75b368c0a8088926c765dbc46c6a4ce7c9d8b9f0
Reviewed-on: https://gerrit.libreoffice.org/16375Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 64bc8b45
......@@ -41,7 +41,10 @@ const sal_uInt16 SvxShadowTabPage::pShadowRanges[] =
SDRATTR_SHADOWCOLOR,
SDRATTR_SHADOWTRANSPARENCE,
SID_ATTR_FILL_SHADOW,
SID_ATTR_FILL_SHADOW,
SID_ATTR_SHADOW_COLOR,
SID_ATTR_SHADOW_TRANSPARENCE,
SID_ATTR_SHADOW_XDISTANCE,
SID_ATTR_SHADOW_YDISTANCE,
0
};
......
......@@ -1008,8 +1008,12 @@
#define SID_PARASPACE_DECREASE ( SID_SVX_START + 1146 )
#define SID_OBJECT_CROP ( SID_SVX_START + 1147 )
#define SID_ATTR_SHADOW_TRANSPARENCE ( SID_SVX_START + 1148 )
#define SID_ATTR_SHADOW_COLOR ( SID_SVX_START + 1149 )
#define SID_ATTR_SHADOW_XDISTANCE ( SID_SVX_START + 1150 )
#define SID_ATTR_SHADOW_YDISTANCE ( SID_SVX_START + 1151 )
#define SID_EDIT_POSTIT ( SID_SVX_START + 1148 )
#define SID_EDIT_POSTIT ( SID_SVX_START + 1152 )
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
#define SID_SVX_FIRSTFREE (SID_EDIT_POSTIT + 1)
......
......@@ -368,6 +368,38 @@
</prop>
</node>
<node oor:name="ShadowPropertyPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Shadow</value>
</prop>
<prop oor:name="Id" oor:type="xs:string">
<value>ShadowPropertyPanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
<value>PropertyDeck</value>
</prop>
<prop oor:name="DefaultMenuCommand">
<value>.uno:FormatArea</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
Calc, Draw, visible ;
Calc, OLE, hidden ;
DrawImpress, 3DObject, visible ;
DrawImpress, Draw, visible ;
DrawImpress, Graphic, hidden ;
DrawImpress, TextObject, hidden ;
DrawImpress, OLE, hidden ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
<value>private:resource/toolpanel/SvxPanelFactory/ShadowPropertyPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
<value>300</value>
</prop>
</node>
<node oor:name="LinePropertyPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Line</value>
......
......@@ -72,6 +72,14 @@ interface TableDraw
StateMethod = GetDrawAttrState;
Export = FALSE;
]
SID_ATTR_SHADOW_COLOR
[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
SID_ATTR_SHADOW_TRANSPARENCE
[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
SID_ATTR_SHADOW_XDISTANCE
[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
SID_ATTR_SHADOW_YDISTANCE
[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
SID_ATTR_FILL_COLOR [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
SID_ATTR_FILL_GRADIENT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; Export = FALSE; ]
......
......@@ -96,6 +96,8 @@
#include <avmedia/mediaitem.hxx>
#include <sfx2/frame.hxx>
#include "attrib.hxx"
#include <svx/sdprcitm.hxx>
#include <svx/sdmetitm.hxx>
#define SvxDrawToolItem SfxAllEnumItem
#define SvxDrawAlignItem SfxAllEnumItem
......
......@@ -147,6 +147,10 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
// #i25616#
case SID_ATTR_FILL_SHADOW:
case SID_ATTR_SHADOW_TRANSPARENCE:
case SID_ATTR_SHADOW_COLOR:
case SID_ATTR_SHADOW_XDISTANCE:
case SID_ATTR_SHADOW_YDISTANCE:
{
// Wenn ToolBar vertikal :
if ( !rReq.GetArgs() )
......@@ -173,7 +177,10 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
// #i25616#
case SID_ATTR_FILL_SHADOW:
case SID_ATTR_SHADOW_TRANSPARENCE:
case SID_ATTR_SHADOW_COLOR:
case SID_ATTR_SHADOW_XDISTANCE:
case SID_ATTR_SHADOW_YDISTANCE:
ExecuteAreaDlg( rReq );
break;
......
......@@ -1849,6 +1849,26 @@ interface DrawView
ExecMethod = FuTemporary ;
StateMethod = GetAttrState ;
]
SID_ATTR_SHADOW_COLOR
[
ExecMethod = FuTemporary ;
StateMethod = GetAttrState ;
]
SID_ATTR_SHADOW_TRANSPARENCE
[
ExecMethod = FuTemporary ;
StateMethod = GetAttrState ;
]
SID_ATTR_SHADOW_XDISTANCE
[
ExecMethod = FuTemporary;
StateMethod = GetAttrState;
]
SID_ATTR_SHADOW_YDISTANCE
[
ExecMethod = FuTemporary;
StateMethod = GetAttrState;
]
SID_ATTR_TEXT_FITTOSIZE // ole : no, status : ?
[
ExecMethod = FuTemporary ;
......
......@@ -243,6 +243,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ATTR_FILL_HATCH:
case SID_ATTR_FILL_BITMAP:
case SID_ATTR_FILL_SHADOW:
case SID_ATTR_SHADOW_COLOR:
case SID_ATTR_SHADOW_TRANSPARENCE:
case SID_ATTR_SHADOW_XDISTANCE:
case SID_ATTR_SHADOW_YDISTANCE:
case SID_ATTR_FILL_TRANSPARENCE:
case SID_ATTR_FILL_FLOATTRANSPARENCE:
......@@ -269,6 +273,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
switch( rReq.GetSlot() )
{
case SID_ATTR_FILL_SHADOW:
case SID_ATTR_SHADOW_COLOR:
case SID_ATTR_SHADOW_TRANSPARENCE:
case SID_ATTR_SHADOW_XDISTANCE:
case SID_ATTR_SHADOW_YDISTANCE:
case SID_ATTR_FILL_STYLE:
case SID_ATTR_FILL_COLOR:
case SID_ATTR_FILL_GRADIENT:
......
......@@ -390,6 +390,10 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
case SID_ATTR_FILL_HATCH:
case SID_ATTR_FILL_BITMAP:
case SID_ATTR_FILL_SHADOW:
case SID_ATTR_SHADOW_COLOR:
case SID_ATTR_SHADOW_TRANSPARENCE:
case SID_ATTR_SHADOW_XDISTANCE:
case SID_ATTR_SHADOW_YDISTANCE:
case SID_ATTR_FILL_TRANSPARENCE:
case SID_ATTR_FILL_FLOATTRANSPARENCE:
case SID_ATTR_LINE_STYLE:
......
......@@ -189,6 +189,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/area/AreaPropertyPanel \
svx/source/sidebar/area/AreaTransparencyGradientControl \
svx/source/sidebar/area/AreaTransparencyGradientPopup \
svx/source/sidebar/shadow/ShadowPropertyPanel \
svx/source/sidebar/graphic/GraphicPropertyPanel \
svx/source/sidebar/line/LinePropertyPanel \
svx/source/sidebar/line/LineWidthControl \
......
......@@ -59,6 +59,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/redlineviewpage \
svx/uiconfig/ui/savemodifieddialog \
svx/uiconfig/ui/sidebararea \
svx/uiconfig/ui/sidebarshadow \
svx/uiconfig/ui/sidebargraphic \
svx/uiconfig/ui/sidebarinsert \
svx/uiconfig/ui/sidebarline \
......
......@@ -10375,6 +10375,7 @@ SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
......@@ -10397,6 +10398,113 @@ SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
GroupId = GID_DOCUMENT;
]
XColorItem FillShadowColor SID_ATTR_SHADOW_COLOR
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = FALSE,
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = GID_DOCUMENT;
]
SdrPercentItem FillShadowTransparency SID_ATTR_SHADOW_TRANSPARENCE
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = FALSE,
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = GID_DOCUMENT;
]
SdrMetricItem FillShadowXDistance SID_ATTR_SHADOW_XDISTANCE
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = FALSE,
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = GID_DOCUMENT;
]
SdrMetricItem FillShadowYDistance SID_ATTR_SHADOW_YDISTANCE
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = FALSE,
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = FALSE,
GroupId = GID_DOCUMENT;
]
SvxShadowedItem Shadowed SID_ATTR_CHAR_SHADOWED
......
......@@ -362,6 +362,9 @@ item String SvxBitmapListItem;
item String SfxLockBytesItem;
item String SvxFontListItem;
item String avmedia_MediaItem;
item INT32 XColorItem;
item INT16 SdrPercentItem;
item INT32 SdrMetricItem;
item BYTE SfxGlobalNameItem;
......
......@@ -21,6 +21,7 @@
#include "styles/StylesPropertyPanel.hxx"
#include "paragraph/ParaPropertyPanel.hxx"
#include "area/AreaPropertyPanel.hxx"
#include "shadow/ShadowPropertyPanel.hxx"
#include "graphic/GraphicPropertyPanel.hxx"
#include "line/LinePropertyPanel.hxx"
#include "possize/PosSizePropertyPanel.hxx"
......@@ -157,6 +158,10 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
{
pControl = AreaPropertyPanel::Create(pParentWindow, xFrame, pBindings);
}
else if (rsResourceURL.endsWith("/ShadowPropertyPanel"))
{
pControl = ShadowPropertyPanel::Create(pParentWindow, xFrame, pBindings);
}
else if (rsResourceURL.endsWith("/GraphicPropertyPanel"))
{
pControl = GraphicPropertyPanel::Create(pParentWindow, xFrame, pBindings);
......
This diff is collapsed.
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
#include <vcl/slider.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/vclptr.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <vcl/ctrl.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <svl/intitem.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
#include <vcl/slider.hxx>
#include <boost/scoped_ptr.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
#include <sfx2/request.hxx>
#include <svx/dlgctrl.hxx>
namespace svx { namespace sidebar {
class ShadowPropertyPanel
: public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
virtual ~ShadowPropertyPanel();
virtual void dispose() SAL_OVERRIDE;
static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
virtual void DataChanged(
const DataChangedEvent& rEvent) SAL_OVERRIDE;
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
const SfxPoolItem* pState,
const bool bIsEnabled) SAL_OVERRIDE;
SfxBindings* GetBindings() { return mpBindings;}
void Initialize();
ShadowPropertyPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
private:
VclPtr<CheckBox> mpShowShadow;
VclPtr<MetricBox> mpShadowDistance;
VclPtr<ColorLB> mpLBShadowColor;
VclPtr<MetricBox> mpShadowAngle;
VclPtr<FixedText> mpFTAngle;
VclPtr<FixedText> mpFTDistance;
VclPtr<FixedText> mpFTTransparency;
VclPtr<FixedText> mpFTColor;
VclPtr<Slider> mpShadowTransSlider;
VclPtr<MetricField> mpShadowTransMetric;
XColorListRef pColorList;
bool bDisabled;
::sfx2::sidebar::ControllerItem maShadowController;
::sfx2::sidebar::ControllerItem maShadowTransController;
::sfx2::sidebar::ControllerItem maShadowColorController;
::sfx2::sidebar::ControllerItem maShadowXDistanceController;
::sfx2::sidebar::ControllerItem maShadowYDistanceController;
css::uno::Reference<css::frame::XFrame> mxFrame;
SfxBindings* mpBindings;
long nX,nY,nXY;
static void SetupIcons();
void InsertDistanceValues();
void InsertAngleValues();
void SetTransparencyValue(long);
void UpdateControls();
sal_uInt32 ParseText(OUString pStr);
DECL_LINK(ClickShadowHdl, void*);
DECL_LINK(ModifyShadowColorHdl, void*);
DECL_LINK(ModifyShadowTransMetricHdl, void*);
DECL_LINK(ModifyShadowDistanceHdl, void*);
DECL_LINK(ModifyShadowTransSliderHdl, void*);
};
}
}
#endif
......@@ -323,6 +323,10 @@ SdrItemPool::SdrItemPool(
// set own ItemInfos
mpLocalItemInfos[SDRATTR_SHADOW-SDRATTR_START]._nSID=SID_ATTR_FILL_SHADOW;
mpLocalItemInfos[SDRATTR_SHADOWCOLOR-SDRATTR_START]._nSID=SID_ATTR_SHADOW_COLOR;
mpLocalItemInfos[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]._nSID=SID_ATTR_SHADOW_TRANSPARENCE;
mpLocalItemInfos[SDRATTR_SHADOWXDIST-SDRATTR_START]._nSID=SID_ATTR_SHADOW_XDISTANCE;
mpLocalItemInfos[SDRATTR_SHADOWYDIST-SDRATTR_START]._nSID=SID_ATTR_SHADOW_YDISTANCE;
mpLocalItemInfos[SDRATTR_TEXT_FITTOSIZE-SDRATTR_START]._nSID=SID_ATTR_TEXT_FITTOSIZE;
mpLocalItemInfos[SDRATTR_GRAFCROP-SDRATTR_START]._nSID=SID_ATTR_GRAF_CROP;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">-180</property>
<property name="upper">360</property>
</object>
<object class="GtkGrid" id="ShadowPropertyPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkGrid" id="grid3">
<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>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="SHOW_SHADOW">
<property name="label" translatable="yes">Enable</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="angle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Angle</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="distance">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Distance</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="VclComboBoxNumeric" id="LB_ANGLE:0degrees">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="VclComboBoxNumeric" id="LB_DISTANCE:0pt">
<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">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="transparency_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Transparency:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkSpinButton" id="FIELD_TRANSPARENCY:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkScale" id="transparency_slider">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="round_digits">1</property>
<property name="draw_value">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="color">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Color:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="svxlo-ColorLB" id="LB_SHADOW_COLOR">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
</interface>
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