[Libreoffice-commits] core.git: include/svx svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk
Caolán McNamara
caolanm at redhat.com
Thu Oct 6 10:42:25 UTC 2016
include/svx/dialogs.hrc | 4
include/svx/sidebar/AreaPropertyPanelBase.hxx | 2
include/svx/sidebar/AreaTransparencyGradientPopup.hxx | 23
svx/Library_svx.mk | 1
svx/UIConfig_svx.mk | 1
svx/source/sidebar/area/AreaPropertyPanel.cxx | 1
svx/source/sidebar/area/AreaPropertyPanel.hrc | 2
svx/source/sidebar/area/AreaPropertyPanel.src | 179 ------
svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 5
svx/source/sidebar/area/AreaTransparencyGradientControl.cxx | 327 ------------
svx/source/sidebar/area/AreaTransparencyGradientControl.hxx | 79 --
svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx | 160 +++++
svx/uiconfig/ui/floatingareastyle.ui | 308 +++++++++++
13 files changed, 484 insertions(+), 608 deletions(-)
New commits:
commit c7a2bbfa34233953fb7e675ec9ecd22c4ea96e1c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 6 10:36:33 2016 +0100
convert AreaTransparencyGradientPopup to .ui
and
1) merge with AreaTransparencyGradientControl
2) grab focus for keyboard a11y like similar popups
3) use degree symbol instead of "degrees" text
and it now grows nicely to fit everything in correctly
Change-Id: I326f3393165f7a098d739be70b644b29dd5238f0
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 68d27d3..c6aa5c2 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -197,8 +197,6 @@
#define RID_SVXIMG_NOTCHECKED (RID_SVX_START + 243)
#define RID_SVXIMG_CHECKED (RID_SVX_START + 244)
-#define RID_POPUPPANEL_AREAPAGE_TRGR (RID_SVX_START + 320)
-
#define RID_SIDEBAR_LINE_PANEL (RID_SVX_START + 321)
#define RID_SIDEBAR_EMPTY_PANEL (RID_SVX_START + 327)
@@ -1007,8 +1005,6 @@
#define IMG_RADIAL (RID_SVX_SIDEBAR_BEGIN + 33)
#define IMG_SQUARE (RID_SVX_SIDEBAR_BEGIN + 34)
#define IMG_LINEAR (RID_SVX_SIDEBAR_BEGIN + 35)
-#define IMG_ROT_LEFT (RID_SVX_SIDEBAR_BEGIN + 36)
-#define IMG_ROT_RIGHT (RID_SVX_SIDEBAR_BEGIN + 37)
#define RID_SVX_SIDEBAR_END (RID_SVX_START + 1279)
#define RID_SVXIMG_GREENCHECK (RID_SVX_START + 1280)
diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index 18c5817..46ff5a4 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -53,8 +53,6 @@ class XFillBitmapItem;
namespace svx { namespace sidebar {
-class AreaTransparencyGradientControl;
-
class SVX_DLLPUBLIC AreaPropertyPanelBase
: public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
diff --git a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
index 519224b..833d6d8 100644
--- a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
+++ b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
@@ -19,7 +19,10 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX
+#include <vcl/edit.hxx>
+#include <vcl/field.hxx>
#include <vcl/floatwin.hxx>
+#include <vcl/toolbox.hxx>
class XFillFloatTransparenceItem;
@@ -31,9 +34,25 @@ class AreaPropertyPanelBase;
class AreaTransparencyGradientPopup : public FloatingWindow
{
private:
- VclPtr<AreaTransparencyGradientControl> m_xControl;
+ AreaPropertyPanelBase& mrAreaPropertyPanel;
+ VclPtr<VclContainer> maCenterGrid;
+ VclPtr<VclContainer> maAngleGrid;
+ VclPtr<MetricField> maMtrTrgrCenterX;
+ VclPtr<MetricField> maMtrTrgrCenterY;
+ VclPtr<MetricField> maMtrTrgrAngle;
+ VclPtr<ToolBox> maBtnLeft45;
+ VclPtr<ToolBox> maBtnRight45;
+ VclPtr<MetricField> maMtrTrgrStartValue;
+ VclPtr<MetricField> maMtrTrgrEndValue;
+ VclPtr<MetricField> maMtrTrgrBorder;
+
+ void InitStatus(XFillFloatTransparenceItem* pGradientItem);
+ void ExecuteValueModify(sal_uInt8 nStartCol, sal_uInt8 nEndCol);
+ DECL_LINK(ModifiedTrgrHdl_Impl, Edit&, void);
+ DECL_LINK(Left_Click45_Impl, ToolBox*, void);
+ DECL_LINK(Right_Click45_Impl, ToolBox*, void);
public:
- AreaTransparencyGradientPopup(vcl::Window* pParent, AreaPropertyPanelBase& rPanel);
+ AreaTransparencyGradientPopup(AreaPropertyPanelBase& rPanel);
virtual ~AreaTransparencyGradientPopup() override;
void Rearrange (XFillFloatTransparenceItem* pItem);
virtual void dispose() override;
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 3f801e7..e564af8 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -193,7 +193,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/sidebar/paragraph/ParaSpacingControl \
svx/source/sidebar/area/AreaPropertyPanel \
svx/source/sidebar/area/AreaPropertyPanelBase \
- svx/source/sidebar/area/AreaTransparencyGradientControl \
svx/source/sidebar/area/AreaTransparencyGradientPopup \
svx/source/sidebar/shadow/ShadowPropertyPanel \
svx/source/sidebar/graphic/GraphicPropertyPanel \
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 502e880..bd9c6d8 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/docrecoverysavedialog \
svx/uiconfig/ui/extrustiondepthdialog \
svx/uiconfig/ui/findreplacedialog \
+ svx/uiconfig/ui/floatingareastyle \
svx/uiconfig/ui/floatingcontour \
svx/uiconfig/ui/floatinglineproperty \
svx/uiconfig/ui/floatingundoredo \
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index e2610a7..e5f762b 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -16,7 +16,6 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "AreaTransparencyGradientControl.hxx"
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include <sfx2/sidebar/ControlFactory.hxx>
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hrc b/svx/source/sidebar/area/AreaPropertyPanel.hrc
index d627b63..fabe373 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hrc
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hrc
@@ -34,8 +34,6 @@
#define MTR_TRGR_END_VALUE 18
#define FT_TRGR_BORDER 19
#define MTR_TRGR_BORDER 20
-#define STR_HELP_LEFT 24
-#define STR_HELP_RIGHT 25
#define BTN_LEFT_SECOND 22
#define BTN_RIGHT_FIRST 23
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.src b/svx/source/sidebar/area/AreaPropertyPanel.src
index 555273c..205de67 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.src
+++ b/svx/source/sidebar/area/AreaPropertyPanel.src
@@ -45,184 +45,5 @@ Image IMG_LINEAR
{
ImageBitmap = Bitmap{File = "symphony/linear.png";};
};
-Image IMG_ROT_LEFT
-{
- ImageBitmap = Bitmap{File = "symphony/rotate_left.png";};
-};
-Image IMG_ROT_RIGHT
-{
- ImageBitmap = Bitmap{File = "symphony/rotate_right.png";};
-};
-
-Control RID_POPUPPANEL_AREAPAGE_TRGR
-{
- OutputSize = TRUE;
- DialogControl = TRUE;
- Border = FALSE;
-
- FixedText FT_TRGR_CENTER_X
- {
- Size = MAP_APPFONT ( CONTROL_WIDTH , FIXED_TEXT_HEIGHT ) ;
- Text [ en-US ] = "Center ~X:";
- };
- MetricField MTR_TRGR_CENTER_X
- {
- Border = TRUE ;
- Size = MAP_APPFONT ( CONTROL_WIDTH , MBOX_HEIGHT ) ;
- HelpID = HID_PPROPERTYPANEL_AREA_MTR_TRGR_CENTER_X ;
- QuickHelpText [ en-US ] = "Specify the horizontal offset percentage from the center for the gradient shading style. 50% is the horizontal center." ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_PERCENT ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_CENTER_Y
- {
- Size = MAP_APPFONT ( CONTROL_WIDTH + POPUPPANEL_MARGIN_HORIZONTAL, FIXED_TEXT_HEIGHT ) ;//wj
- Text [ en-US ] = "Center ~Y:";
- };
- MetricField MTR_TRGR_CENTER_Y
- {
- Border = TRUE ;
- Size = MAP_APPFONT ( CONTROL_WIDTH , MBOX_HEIGHT ) ;
- HelpID = HID_PPROPERTYPANEL_AREA_MTR_TRGR_CENTER_Y ;
- QuickHelpText [ en-US ] = "Specify the vertical offset percentage from the center for the gradient shading style. 50% is the vertical center." ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_PERCENT ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_ANGLE
- {
- Size = MAP_APPFONT ( CONTROL_WIDTH * 2 + POPUPPANEL_MARGIN_HORIZONTAL + CONTROL_SPACING_HORIZONTAL, FIXED_TEXT_HEIGHT ) ;//wj
- Text [ en-US ] = "~Angle:";
- };
- MetricField MTR_TRGR_ANGLE
- {
- Border = TRUE ;
- Size = MAP_APPFONT ( CONTROL_WIDTH , MBOX_HEIGHT ) ;
- HelpID = HID_PPROPERTYPANEL_AREA_MTR_TRGR_ANGLE ;
- QuickHelpText [ en-US ] = "Specify the angle of rotation for the gradient shading style." ;
- TabStop = FALSE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = -9999 ;
- Maximum = 9999 ;
- Unit = FUNIT_CUSTOM ;
- SpinSize = 1 ;
- CustomUnitText [ en-US ] = " degrees";
- };
- FixedText FT_TRGR_START_VALUE
- {
- Size = MAP_APPFONT ( CONTROL_WIDTH , FIXED_TEXT_HEIGHT ) ;
- Text [ en-US ] = "~Start value:";
- };
- MetricField MTR_TRGR_START_VALUE
- {
- Border = TRUE ;
- Size = MAP_APPFONT ( CONTROL_WIDTH , MBOX_HEIGHT ) ;
- HelpID = HID_PPROPERTYPANEL_AREA_MTR_TRGR_SVALUE ;
- QuickHelpText [ en-US ] = "Enter a transparency value for the beginning point of the gradient, where 0% is fully opaque and 100% is fully transparent." ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_PERCENT ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_END_VALUE
- {
- Size = MAP_APPFONT (CONTROL_WIDTH + POPUPPANEL_MARGIN_HORIZONTAL, FIXED_TEXT_HEIGHT ) ; //wj
- Text [ en-US ] = "~End value:";
- };
- MetricField MTR_TRGR_END_VALUE
- {
- Border = TRUE ;
- Size = MAP_APPFONT ( CONTROL_WIDTH , MBOX_HEIGHT ) ;
- HelpID = HID_PPROPERTYPANEL_AREA_MTR_TRGR_EVALUE ;
- QuickHelpText [ en-US ] = "Enter a transparency value for the endpoint of the gradient, where 0% is fully opaque and 100% is fully transparent." ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_PERCENT ;
- Last = 100 ;
- SpinSize = 5 ;
- };
- FixedText FT_TRGR_BORDER
- {
- Size = MAP_APPFONT ( CONTROL_WIDTH * 2 + POPUPPANEL_MARGIN_HORIZONTAL + CONTROL_SPACING_HORIZONTAL, FIXED_TEXT_HEIGHT ) ;
- Text [ en-US ] = "~Border:";
- };
- MetricField MTR_TRGR_BORDER
- {
- Border = TRUE ;
- Size = MAP_APPFONT ( CONTROL_WIDTH , MBOX_HEIGHT ) ;
- HelpID = HID_PPROPERTYPANEL_AREA_MTR_TRGR_BORDER ;
- QuickHelpText [ en-US ] = "Specify the border value of gradient transparency." ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Maximum = 100 ;
- StrictFormat = TRUE ;
- Unit = FUNIT_PERCENT ;
- Last = 100 ;
- SpinSize = 5 ;
- };
-
- ToolBox BTN_LEFT_SECOND
- {
- Border = FALSE ;
- HelpID = HID_PPROPERTYPANEL_AREA_BTN_LEFT_SECOND ;
- SVLook = TRUE ;
- Border = FALSE ;
- TabStop = TRUE ;
- Text = "Rotate Left";
- ItemList =
- {
- ToolBoxItem
- {
- Identifier = TBI_LEFT ;
- Text = "Rotate Left" ;
- };
- };
- };
- ToolBox BTN_RIGHT_FIRST
- {
- Border = FALSE ;
- HelpID = HID_PPROPERTYPANEL_AREA_BTN_RIGHT_FIRST ;
- SVLook = TRUE ;
- Border = FALSE ;
- TabStop = TRUE ;
- Text = "Rotate Right";
- ItemList =
- {
- ToolBoxItem
- {
- Identifier = TBI_RIGHT ;
- Text = "Rotate Right" ;
- };
- };
- };
- String STR_HELP_LEFT
- {
- Text [ en-US ] = "Rotate counterclockwise by 45 degrees." ;
- };
- String STR_HELP_RIGHT
- {
- Text [ en-US ] = "Rotate clockwise by 45 degrees." ;
- };
-};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index a62d414..7de151c 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -16,7 +16,6 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "AreaTransparencyGradientControl.hxx"
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include <sfx2/sidebar/SidebarController.hxx>
@@ -1322,10 +1321,10 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ModifyTransSliderHdl, Slider*, void)
IMPL_LINK( AreaPropertyPanelBase, ClickTrGrHdl_Impl, ToolBox*, pToolBox, void )
{
if (!mxTrGrPopup)
- mxTrGrPopup = VclPtr<AreaTransparencyGradientPopup>::Create(pToolBox, *this);
+ mxTrGrPopup = VclPtr<AreaTransparencyGradientPopup>::Create(*this);
mxTrGrPopup->Rearrange(mpFloatTransparenceItem.get());
OSL_ASSERT( pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == UNO_SIDEBARGRADIENT);
- mxTrGrPopup->StartPopupMode(pToolBox, FloatWinPopupFlags::Down);
+ mxTrGrPopup->StartPopupMode(pToolBox, FloatWinPopupFlags::GrabFocus);
}
IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl, ListBox&, void)
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
deleted file mode 100644
index 922f104..0000000
--- a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
+++ /dev/null
@@ -1,327 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include "AreaTransparencyGradientControl.hxx"
-#include <svx/sidebar/AreaPropertyPanelBase.hxx>
-#include "AreaPropertyPanel.hrc"
-
-#include <svx/dialogs.hrc>
-#include <svx/dialmgr.hxx>
-#include <svx/xflftrit.hxx>
-#include <sfx2/sidebar/ResourceDefinitions.hrc>
-#include <sfx2/bindings.hxx>
-#include <sfx2/dispatch.hxx>
-
-namespace svx { namespace sidebar {
-
-// positioning helpers
-#define APOS1_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MapUnit::MapAppFont))
-#define APOS2_1 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
-#define APOS1_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL), MapUnit::MapAppFont))
-#define APOS2_2 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
-#define APOS1_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
-#define APOS1_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
-#define APOS2_3 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
-#define APOS2_4 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL), MapUnit::MapAppFont))
-#define APOS1_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
-#define APOS1_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
-#define APOS2_5 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 2*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
-#define APOS2_6 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL+CONTROL_WIDTH+CONTROL_SPACING_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+2*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
-#define APOS1_7 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 3*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL+MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
-#define APOS1_8 Point(LogicToPixel(Point(POPUPPANEL_MARGIN_HORIZONTAL,POPUPPANEL_MARGIN_VERTICAL + 4*(FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL)+3*(MBOX_HEIGHT+CONTROL_SPACING_VERTICAL)), MapUnit::MapAppFont))
-#define APOS_Left_Right_1 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y1), MapUnit::MapAppFont))
-#define APOS_Left_Right_2 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y1), MapUnit::MapAppFont))
-#define APOS_Left_Right_3 Point(LogicToPixel(Point(LEFT_RIGHT_X1,LEFT_RIGHT_Y2), MapUnit::MapAppFont))
-#define APOS_Left_Right_4 Point(LogicToPixel(Point(LEFT_RIGHT_X2,LEFT_RIGHT_Y2), MapUnit::MapAppFont))
-
-AreaTransparencyGradientControl::AreaTransparencyGradientControl (
- vcl::Window* pParent,
- AreaPropertyPanelBase& rPanel)
- : Control( pParent,SVX_RES(RID_POPUPPANEL_AREAPAGE_TRGR)),
- maFtTrgrCenterX(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_X))),
- maMtrTrgrCenterX(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_X))),
- maFtTrgrCenterY(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_Y))),
- maMtrTrgrCenterY(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_Y))),
- maFtTrgrAngle(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_ANGLE))),
- maMtrTrgrAngle(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_ANGLE))),
- maBtnLeft45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_LEFT_SECOND))),
- maBtnRight45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_RIGHT_FIRST))),
- maFtTrgrStartValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_START_VALUE))),
- maMtrTrgrStartValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_START_VALUE))),
- maFtTrgrEndValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_END_VALUE))),
- maMtrTrgrEndValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_END_VALUE))),
- maFtTrgrBorder(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_BORDER))),
- maMtrTrgrBorder(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_BORDER))),
- maRotLeft( SVX_RES(IMG_ROT_LEFT)),
- maRotRight( SVX_RES(IMG_ROT_RIGHT)),
- mrAreaPropertyPanel(rPanel)
-{
- Link<Edit&,void> aLink = LINK( this, AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl);
- maMtrTrgrCenterX->SetModifyHdl( aLink );
- maMtrTrgrCenterY->SetModifyHdl( aLink );
- maMtrTrgrAngle->SetModifyHdl( aLink );
- maMtrTrgrBorder->SetModifyHdl( aLink );
- maMtrTrgrStartValue->SetModifyHdl( aLink );
- maMtrTrgrEndValue->SetModifyHdl( aLink );
- maBtnLeft45->SetSelectHdl( LINK( this, AreaTransparencyGradientControl, Left_Click45_Impl) );
- maBtnRight45->SetSelectHdl( LINK( this, AreaTransparencyGradientControl, Right_Click45_Impl) );
- maBtnLeft45->SetItemImage(1,maRotLeft);
- Size aTbxSize = maBtnLeft45->CalcWindowSizePixel();
- maBtnLeft45->SetOutputSizePixel( aTbxSize );
- maBtnLeft45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_LEFT)); //acc wj
-
- maBtnRight45->SetItemImage(1,maRotRight);
- aTbxSize = maBtnRight45->CalcWindowSizePixel();
- maBtnRight45->SetOutputSizePixel( aTbxSize );
- maBtnRight45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_RIGHT)); //acc wj
-
- maBtnLeft45->SetBackground(Wallpaper());
- maBtnLeft45->SetPaintTransparent(true);
- maBtnRight45->SetBackground(Wallpaper());
- maBtnRight45->SetPaintTransparent(true);
-
- FreeResource();
-}
-
-AreaTransparencyGradientControl::~AreaTransparencyGradientControl()
-{
- disposeOnce();
-}
-
-void AreaTransparencyGradientControl::dispose()
-{
- maFtTrgrCenterX.disposeAndClear();
- maMtrTrgrCenterX.disposeAndClear();
- maFtTrgrCenterY.disposeAndClear();
- maMtrTrgrCenterY.disposeAndClear();
- maFtTrgrAngle.disposeAndClear();
- maMtrTrgrAngle.disposeAndClear();
- maBtnLeft45.disposeAndClear();
- maBtnRight45.disposeAndClear();
- maFtTrgrStartValue.disposeAndClear();
- maMtrTrgrStartValue.disposeAndClear();
- maFtTrgrEndValue.disposeAndClear();
- maMtrTrgrEndValue.disposeAndClear();
- maFtTrgrBorder.disposeAndClear();
- maMtrTrgrBorder.disposeAndClear();
- Control::dispose();
-}
-
-void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGradientItem)
-{
- InitStatus(pGradientItem);
- const XGradient& rGradient = pGradientItem->GetGradientValue();
- css::awt::GradientStyle eXGS(rGradient.GetGradientStyle());
- Size aSize(POP_WIDTH,POP_HEIGHT);
- aSize = LogicToPixel( aSize, MapMode(MapUnit::MapAppFont) );
- Size aSize2(POP_WIDTH,POP_HEIGHT2);
- aSize2 = LogicToPixel( aSize2, MapMode(MapUnit::MapAppFont) );
- long aPosY = 0;
- Point aPointAngle;
- Size aSizeAngle = maMtrTrgrAngle->GetSizePixel();
- Size aTbxSize = maBtnLeft45->CalcWindowSizePixel();
-
- switch(eXGS)
- {
- case css::awt::GradientStyle_LINEAR:
- case css::awt::GradientStyle_AXIAL:
- maFtTrgrCenterX->Hide();
- maMtrTrgrCenterX->Hide();
- maFtTrgrCenterY->Hide();
- maMtrTrgrCenterY->Hide();
- maFtTrgrAngle->Show();
- maFtTrgrAngle->SetPosPixel(APOS1_1);
- maMtrTrgrAngle->Show();
- maMtrTrgrAngle->SetPosPixel(APOS2_1);
- maFtTrgrStartValue->SetPosPixel(APOS1_3);
- maMtrTrgrStartValue->SetPosPixel(APOS1_4);
- maFtTrgrEndValue->SetPosPixel(APOS2_3);
- maMtrTrgrEndValue->SetPosPixel(APOS2_4);
- maFtTrgrBorder->SetPosPixel(APOS1_5);
- maMtrTrgrBorder->SetPosPixel(APOS1_6);
-
- maBtnLeft45->Show();
- maBtnRight45->Show();
-
- aPointAngle = maMtrTrgrAngle->GetPosPixel();
- aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight();
-
- maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_1.getX(), aPosY));
- maBtnRight45->SetPosPixel(Point(APOS_Left_Right_2.getX(), aPosY));
-
- SetSizePixel(aSize2);
- break;
-
- case css::awt::GradientStyle_RADIAL:
- maFtTrgrCenterX->Show();
- maFtTrgrCenterX->SetPosPixel(APOS1_1);
- maMtrTrgrCenterX->Show();
- maMtrTrgrCenterX->SetPosPixel(APOS2_1);
- maFtTrgrCenterY->Show();
- maFtTrgrCenterY->SetPosPixel(APOS1_2);
- maMtrTrgrCenterY->Show();
- maMtrTrgrCenterY->SetPosPixel(APOS2_2);
- maFtTrgrAngle->Hide();
- maMtrTrgrAngle->Hide();
- maFtTrgrStartValue->SetPosPixel(APOS1_3);
- maMtrTrgrStartValue->SetPosPixel(APOS1_4);
- maFtTrgrEndValue->SetPosPixel(APOS2_3);
- maMtrTrgrEndValue->SetPosPixel(APOS2_4);
- maFtTrgrBorder->SetPosPixel(APOS1_5);
- maMtrTrgrBorder->SetPosPixel(APOS1_6);
-
- maBtnLeft45->Hide();
- maBtnRight45->Hide();
-
- SetSizePixel(aSize2);
-
- break;
-
- case css::awt::GradientStyle_ELLIPTICAL:
- case css::awt::GradientStyle_SQUARE:
- case css::awt::GradientStyle_RECT:
- maFtTrgrCenterX->Show();
- maFtTrgrCenterX->SetPosPixel(APOS1_1);
- maMtrTrgrCenterX->Show();
- maMtrTrgrCenterX->SetPosPixel(APOS2_1);
- maFtTrgrCenterY->Show();
- maFtTrgrCenterY->SetPosPixel(APOS1_2);
- maMtrTrgrCenterY->Show();
- maMtrTrgrCenterY->SetPosPixel(APOS2_2);
- maFtTrgrAngle->Show();
- maFtTrgrAngle->SetPosPixel(APOS1_3);
- maMtrTrgrAngle->Show();
- maMtrTrgrAngle->SetPosPixel(APOS1_4);
-
- maFtTrgrStartValue->SetPosPixel(APOS1_5);
- maMtrTrgrStartValue->SetPosPixel(APOS1_6);
- maFtTrgrEndValue->SetPosPixel(APOS2_5);
- maMtrTrgrEndValue->SetPosPixel(APOS2_6);
- maFtTrgrBorder->SetPosPixel(APOS1_7);
- maMtrTrgrBorder->SetPosPixel(APOS1_8);
-
- maBtnLeft45->Show();
- maBtnRight45->Show();
-
- aPointAngle = maMtrTrgrAngle->GetPosPixel();
- aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight();
-
- maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_3.getX(), aPosY));
- maBtnRight45->SetPosPixel(Point(APOS_Left_Right_4.getX(), aPosY));
-
- SetSizePixel(aSize);
-
- break;
-
- default:
- break;
- }
-}
-
-void AreaTransparencyGradientControl::InitStatus(XFillFloatTransparenceItem* pGradientItem)
-{
- const XGradient& rGradient = pGradientItem->GetGradientValue();
-
- XGradient aGradient;
-
- if (rGradient.GetXOffset() == AreaPropertyPanelBase::DEFAULT_CENTERX
- && rGradient.GetYOffset() == AreaPropertyPanelBase::DEFAULT_CENTERY
- && (rGradient.GetAngle() / 10) == AreaPropertyPanelBase::DEFAULT_ANGLE
- && ((sal_uInt16)((((sal_uInt16)rGradient.GetStartColor().GetRed() + 1) * 100) / 255))
- == AreaPropertyPanelBase::DEFAULT_STARTVALUE
- && ((sal_uInt16)((((sal_uInt16)rGradient.GetEndColor().GetRed() + 1) * 100) / 255))
- == AreaPropertyPanelBase::DEFAULT_ENDVALUE
- && rGradient.GetBorder() == AreaPropertyPanelBase::DEFAULT_BORDER)
- {
- aGradient = mrAreaPropertyPanel.GetGradient(rGradient.GetGradientStyle());
- }
- else
- {
- aGradient = rGradient;
- }
- maMtrTrgrCenterX->SetValue(aGradient.GetXOffset());
- maMtrTrgrCenterY->SetValue(aGradient.GetYOffset());
- maMtrTrgrAngle->SetValue(aGradient.GetAngle() / 10);
- maMtrTrgrStartValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetStartColor().GetRed() + 1) * 100) / 255));
- maMtrTrgrEndValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetEndColor().GetRed() + 1) * 100) / 255));
- maMtrTrgrBorder->SetValue(aGradient.GetBorder());
-}
-
-void AreaTransparencyGradientControl::ExecuteValueModify( sal_uInt8 nStartCol, sal_uInt8 nEndCol )
-{
- //Added
- sal_Int16 aMtrValue = (sal_Int16)maMtrTrgrAngle->GetValue();
- while(aMtrValue<0)
- aMtrValue += 360;
- sal_uInt16 nVal = aMtrValue/360;
- nVal = aMtrValue - nVal*360;
- maMtrTrgrAngle->SetValue(nVal);
- //End of new code
- XGradient aTmpGradient(
- Color(nStartCol, nStartCol, nStartCol),
- Color(nEndCol, nEndCol, nEndCol),
- (css::awt::GradientStyle)(mrAreaPropertyPanel.GetSelectedTransparencyTypeIndex()-2),
- (sal_uInt16)maMtrTrgrAngle->GetValue() * 10,
- (sal_uInt16)maMtrTrgrCenterX->GetValue(),
- (sal_uInt16)maMtrTrgrCenterY->GetValue(),
- (sal_uInt16)maMtrTrgrBorder->GetValue(),
- 100, 100);
-
- mrAreaPropertyPanel.SetGradient(aTmpGradient);
-
- SfxItemPool* pPool = nullptr;
- bool bEnable = true;
- XFillFloatTransparenceItem aGradientItem(pPool,aTmpGradient, bEnable );
-
- mrAreaPropertyPanel.setFillFloatTransparence(aGradientItem);
-}
-
-IMPL_LINK_NOARG(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl, Edit&, void)
-{
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
- ExecuteValueModify( nStartCol, nEndCol );
-}
-
-IMPL_LINK_NOARG(AreaTransparencyGradientControl, Left_Click45_Impl, ToolBox *, void)
-{
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
- sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
- if(aTemp>=315)
- aTemp -= 360;
- aTemp += 45;
- maMtrTrgrAngle->SetValue(aTemp);
- ExecuteValueModify( nStartCol, nEndCol );
-}
-
-IMPL_LINK_NOARG(AreaTransparencyGradientControl, Right_Click45_Impl, ToolBox *, void)
-{
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
- sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
- if(aTemp<45)
- aTemp += 360;
- aTemp -= 45;
- maMtrTrgrAngle->SetValue(aTemp);
- ExecuteValueModify( nStartCol, nEndCol );
-}
-
-} } // end of namespace svx::sidebar
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
deleted file mode 100644
index 452da99..0000000
--- a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTCONTROL_HXX
-#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTCONTROL_HXX
-
-
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/toolbox.hxx>
-#include <svx/xenum.hxx>
-#include <com/sun/star/awt/GradientStyle.hpp>
-
-class XFillFloatTransparenceItem;
-class SfxBindings;
-
-namespace svx { namespace sidebar {
-
-class AreaPropertyPanelBase;
-
-class AreaTransparencyGradientControl : public Control
-{
-public:
- AreaTransparencyGradientControl (
- vcl::Window* pParent,
- AreaPropertyPanelBase& rPanel);
- virtual ~AreaTransparencyGradientControl() override;
- virtual void dispose() override;
-
- void Rearrange(XFillFloatTransparenceItem* pGradientItem);
- void InitStatus(XFillFloatTransparenceItem* pGradientItem);
- void ExecuteValueModify( sal_uInt8 nStartCol, sal_uInt8 nEndCol );
-
-private:
- VclPtr<FixedText> maFtTrgrCenterX;
- VclPtr<MetricField> maMtrTrgrCenterX;
- VclPtr<FixedText> maFtTrgrCenterY;
- VclPtr<MetricField> maMtrTrgrCenterY;
- VclPtr<FixedText> maFtTrgrAngle;
- VclPtr<MetricField> maMtrTrgrAngle;
- VclPtr<ToolBox> maBtnLeft45;
- VclPtr<ToolBox> maBtnRight45;
- VclPtr<FixedText> maFtTrgrStartValue;
- VclPtr<MetricField> maMtrTrgrStartValue;
- VclPtr<FixedText> maFtTrgrEndValue;
- VclPtr<MetricField> maMtrTrgrEndValue;
- VclPtr<FixedText> maFtTrgrBorder;
- VclPtr<MetricField> maMtrTrgrBorder;
- Image maRotLeft;
- Image maRotRight;
-
- AreaPropertyPanelBase& mrAreaPropertyPanel;
- DECL_LINK( ModifiedTrgrHdl_Impl, Edit&, void );
- DECL_LINK( Left_Click45_Impl, ToolBox*, void );
- DECL_LINK( Right_Click45_Impl, ToolBox*, void );
-};
-
-
-} } // end of namespace svx::sidebar
-
-#endif // INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTCONTROL_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
index 0e64683..f05087e 100644
--- a/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
+++ b/svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx
@@ -16,15 +16,39 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+
+#include <sfx2/app.hxx>
#include <svx/sidebar/AreaTransparencyGradientPopup.hxx>
-#include "AreaTransparencyGradientControl.hxx"
+#include <svx/sidebar/AreaPropertyPanelBase.hxx>
+#include <svx/xflftrit.hxx>
+#include <svx/xgrad.hxx>
namespace svx { namespace sidebar {
-AreaTransparencyGradientPopup::AreaTransparencyGradientPopup(vcl::Window* pParent, AreaPropertyPanelBase& rPanel)
- : FloatingWindow(pParent, WB_BORDER | WB_SYSTEMWINDOW)
- , m_xControl(VclPtr<AreaTransparencyGradientControl>::Create(this, rPanel))
+AreaTransparencyGradientPopup::AreaTransparencyGradientPopup(AreaPropertyPanelBase& rPanel)
+ : FloatingWindow(SfxGetpApp()->GetTopWindow(), "FloatingAreaStyle", "svx/ui/floatingareastyle.ui")
+ , mrAreaPropertyPanel(rPanel)
{
+ get(maCenterGrid, "centergrid");
+ get(maAngleGrid, "anglegrid");
+ get(maMtrTrgrCenterX, "centerx");
+ get(maMtrTrgrCenterY, "centery");
+ get(maMtrTrgrAngle, "angle");
+ get(maBtnLeft45, "lefttoolbox");
+ get(maBtnRight45, "righttoolbox");
+ get(maMtrTrgrStartValue, "start");
+ get(maMtrTrgrEndValue, "end");
+ get(maMtrTrgrBorder, "border");
+
+ Link<Edit&,void> aLink = LINK(this, AreaTransparencyGradientPopup, ModifiedTrgrHdl_Impl);
+ maMtrTrgrCenterX->SetModifyHdl(aLink);
+ maMtrTrgrCenterY->SetModifyHdl(aLink);
+ maMtrTrgrAngle->SetModifyHdl(aLink);
+ maMtrTrgrBorder->SetModifyHdl(aLink);
+ maMtrTrgrStartValue->SetModifyHdl(aLink);
+ maMtrTrgrEndValue->SetModifyHdl(aLink);
+ maBtnLeft45->SetSelectHdl(LINK(this, AreaTransparencyGradientPopup, Left_Click45_Impl));
+ maBtnRight45->SetSelectHdl(LINK(this, AreaTransparencyGradientPopup, Right_Click45_Impl));
}
AreaTransparencyGradientPopup::~AreaTransparencyGradientPopup()
@@ -32,15 +56,135 @@ AreaTransparencyGradientPopup::~AreaTransparencyGradientPopup()
disposeOnce();
}
-void AreaTransparencyGradientPopup::Rearrange(XFillFloatTransparenceItem* pItem)
+void AreaTransparencyGradientPopup::InitStatus(XFillFloatTransparenceItem* pGradientItem)
+{
+ const XGradient& rGradient = pGradientItem->GetGradientValue();
+
+ XGradient aGradient;
+
+ if (rGradient.GetXOffset() == AreaPropertyPanelBase::DEFAULT_CENTERX
+ && rGradient.GetYOffset() == AreaPropertyPanelBase::DEFAULT_CENTERY
+ && (rGradient.GetAngle() / 10) == AreaPropertyPanelBase::DEFAULT_ANGLE
+ && ((sal_uInt16)((((sal_uInt16)rGradient.GetStartColor().GetRed() + 1) * 100) / 255))
+ == AreaPropertyPanelBase::DEFAULT_STARTVALUE
+ && ((sal_uInt16)((((sal_uInt16)rGradient.GetEndColor().GetRed() + 1) * 100) / 255))
+ == AreaPropertyPanelBase::DEFAULT_ENDVALUE
+ && rGradient.GetBorder() == AreaPropertyPanelBase::DEFAULT_BORDER)
+ {
+ aGradient = mrAreaPropertyPanel.GetGradient(rGradient.GetGradientStyle());
+ }
+ else
+ {
+ aGradient = rGradient;
+ }
+ maMtrTrgrCenterX->SetValue(aGradient.GetXOffset());
+ maMtrTrgrCenterY->SetValue(aGradient.GetYOffset());
+ maMtrTrgrAngle->SetValue(aGradient.GetAngle() / 10);
+ maMtrTrgrStartValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetStartColor().GetRed() + 1) * 100) / 255));
+ maMtrTrgrEndValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetEndColor().GetRed() + 1) * 100) / 255));
+ maMtrTrgrBorder->SetValue(aGradient.GetBorder());
+}
+
+void AreaTransparencyGradientPopup::Rearrange(XFillFloatTransparenceItem* pGradientItem)
+{
+ InitStatus(pGradientItem);
+ const XGradient& rGradient = pGradientItem->GetGradientValue();
+ css::awt::GradientStyle eXGS(rGradient.GetGradientStyle());
+
+ switch(eXGS)
+ {
+ case css::awt::GradientStyle_LINEAR:
+ case css::awt::GradientStyle_AXIAL:
+ maCenterGrid->Hide();
+ maAngleGrid->Show();
+ break;
+ case css::awt::GradientStyle_RADIAL:
+ maCenterGrid->Show();
+ maAngleGrid->Hide();
+ break;
+ case css::awt::GradientStyle_ELLIPTICAL:
+ case css::awt::GradientStyle_SQUARE:
+ case css::awt::GradientStyle_RECT:
+ maCenterGrid->Show();
+ maAngleGrid->Show();
+ break;
+ default:
+ break;
+ }
+}
+
+void AreaTransparencyGradientPopup::ExecuteValueModify(sal_uInt8 nStartCol, sal_uInt8 nEndCol)
+{
+ //Added
+ sal_Int16 aMtrValue = (sal_Int16)maMtrTrgrAngle->GetValue();
+ while(aMtrValue<0)
+ aMtrValue += 360;
+ sal_uInt16 nVal = aMtrValue/360;
+ nVal = aMtrValue - nVal*360;
+ maMtrTrgrAngle->SetValue(nVal);
+ //End of new code
+ XGradient aTmpGradient(
+ Color(nStartCol, nStartCol, nStartCol),
+ Color(nEndCol, nEndCol, nEndCol),
+ (css::awt::GradientStyle)(mrAreaPropertyPanel.GetSelectedTransparencyTypeIndex()-2),
+ (sal_uInt16)maMtrTrgrAngle->GetValue() * 10,
+ (sal_uInt16)maMtrTrgrCenterX->GetValue(),
+ (sal_uInt16)maMtrTrgrCenterY->GetValue(),
+ (sal_uInt16)maMtrTrgrBorder->GetValue(),
+ 100, 100);
+
+ mrAreaPropertyPanel.SetGradient(aTmpGradient);
+
+ SfxItemPool* pPool = nullptr;
+ bool bEnable = true;
+ XFillFloatTransparenceItem aGradientItem(pPool, aTmpGradient, bEnable );
+
+ mrAreaPropertyPanel.setFillFloatTransparence(aGradientItem);
+}
+
+IMPL_LINK_NOARG(AreaTransparencyGradientPopup, ModifiedTrgrHdl_Impl, Edit&, void)
+{
+ sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
+ sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
+ ExecuteValueModify( nStartCol, nEndCol );
+}
+
+IMPL_LINK_NOARG(AreaTransparencyGradientPopup, Left_Click45_Impl, ToolBox *, void)
+{
+ sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
+ sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
+ sal_uInt16 nTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
+ if (nTemp>=315)
+ nTemp -= 360;
+ nTemp += 45;
+ maMtrTrgrAngle->SetValue(nTemp);
+ ExecuteValueModify(nStartCol, nEndCol);
+}
+
+IMPL_LINK_NOARG(AreaTransparencyGradientPopup, Right_Click45_Impl, ToolBox *, void)
{
- m_xControl->Rearrange(pItem);
- SetSizePixel(m_xControl->GetOutputSizePixel());
+ sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
+ sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
+ sal_uInt16 nTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
+ if (nTemp<45)
+ nTemp += 360;
+ nTemp -= 45;
+ maMtrTrgrAngle->SetValue(nTemp);
+ ExecuteValueModify(nStartCol, nEndCol);
}
void AreaTransparencyGradientPopup::dispose()
{
- m_xControl.disposeAndClear();
+ maCenterGrid.clear();
+ maAngleGrid.clear();
+ maMtrTrgrCenterX.clear();
+ maMtrTrgrCenterY.clear();
+ maMtrTrgrAngle.clear();
+ maBtnLeft45.clear();
+ maBtnRight45.clear();
+ maMtrTrgrStartValue.clear();
+ maMtrTrgrEndValue.clear();
+ maMtrTrgrBorder.clear();
FloatingWindow::dispose();
}
diff --git a/svx/uiconfig/ui/floatingareastyle.ui b/svx/uiconfig/ui/floatingareastyle.ui
new file mode 100644
index 0000000..74da941
--- /dev/null
+++ b/svx/uiconfig/ui/floatingareastyle.ui
@@ -0,0 +1,308 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">359</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment2">
+ <property name="upper">100</property>
+ <property name="step_increment">5</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkWindow" id="FloatingAreaStyle">
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border_width">4</property>
+ <property name="resizable">False</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">popup-menu</property>
+ <property name="skip_pager_hint">True</property>
+ <property name="deletable">False</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="row_spacing">12</property>
+ <child>
+ <object class="GtkGrid" id="anglegrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">_Angle:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">angle:0degrees</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">12</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkSpinButton" id="angle:0degrees">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Specify the angle of rotation for the gradient shading style.</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkToolbar" id="lefttoolbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkToolButton" id="left">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Rotate counterclockwise by 45 degrees.</property>
+ <property name="icon_name">svx/res/symphony/rotate_left.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="righttoolbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkToolButton" id="right">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Rotate clockwise by 45 degrees.</property>
+ <property name="icon_name">svx/res/symphony/rotate_right.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">_Start value:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">start:0%</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">_End value:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">end:0%</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="start:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Enter a transparency value for the beginning point of the gradient, where 0% is fully opaque and 100% is fully transparent.</property>
+ <property name="adjustment">adjustment2</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="end:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Enter a transparency value for the endpoint of the gradient, where 0% is fully opaque and 100% is fully transparent.</property>
+ <property name="text" translatable="yes">0</property>
+ <property name="adjustment">adjustment2</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">_Border:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">border:0%</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="border:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Specify the border value of gradient transparency.</property>
+ <property name="text" translatable="yes">0</property>
+ <property name="adjustment">adjustment2</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="centergrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Center _X:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">centerx:0%</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Center _Y:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">centery:0%</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="centerx:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Specify the horizontal offset percentage from the center for the gradient shading style. 50% is the horizontal center.</property>
+ <property name="text" translatable="yes">0</property>
+ <property name="adjustment">adjustment2</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="centery:0%">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Specify the vertical offset percentage from the center for the gradient shading style. 50% is the vertical center.</property>
+ <property name="text" translatable="yes">0</property>
+ <property name="adjustment">adjustment2</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
More information about the Libreoffice-commits
mailing list