Kaydet (Commit) 558faa30 authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) Samuel Mehrbrodt

Page margin popup converted to use outside sidebar

Change-Id: I3c4cc20fc8f2818677a77f848a1566bb56ceb7c6
Reviewed-on: https://gerrit.libreoffice.org/29363Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 2bebc1fc
......@@ -2875,6 +2875,14 @@
<value>1</value>
</prop>
</node>
<node oor:name=".uno:PageMargin" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Page Margin</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
</node>
</node>
</oor:component-data>
......@@ -679,6 +679,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/sidebar/PageOrientationControl \
sw/source/uibase/sidebar/PageOrientationPopup \
sw/source/uibase/sidebar/PageMarginControl \
sw/source/uibase/sidebar/PageMarginPopup \
sw/source/uibase/sidebar/PageSizeControl \
sw/source/uibase/sidebar/PageSizePopup \
sw/source/uibase/sidebar/PageColumnControl \
......
......@@ -208,6 +208,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/notebookbar_groups \
sw/uiconfig/swriter/ui/notebookbar_single \
sw/uiconfig/swriter/ui/pagecolumncontrol \
sw/uiconfig/swriter/ui/pagemargincontrol \
sw/uiconfig/swriter/ui/pageorientationcontrol \
sw/uiconfig/swriter/ui/pagesizecontrol \
sw/uiconfig/swriter/ui/paradialog \
......
/* -*- 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_SW_INC_PAGEMARGINPOPUP_HXX
#define INCLUDED_SW_INC_PAGEMARGINPOPUP_HXX
#include <sfx2/tbxctrl.hxx>
#include <swdllapi.h>
#include <vcl/vclenum.hxx>
#include <functional>
class SW_DLLPUBLIC PageMarginPopup : public SfxToolBoxControl
{
public:
SFX_DECL_TOOLBOX_CONTROL();
PageMarginPopup(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
virtual ~PageMarginPopup() override;
virtual VclPtr<SfxPopupWindow> CreatePopupWindow() override;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -859,6 +859,7 @@
#define SID_ATTR_PAGE_FOOTER_LRMARGIN (FN_SIDEBAR + 8)
#define SID_ATTR_PAGE_FOOTER_SPACING (FN_SIDEBAR + 9)
#define SID_ATTR_PAGE_FOOTER_LAYOUT (FN_SIDEBAR + 10)
#define SID_ATTR_PAGE_MARGIN (FN_SIDEBAR + 11)
//Member IDs for Fill / SetVariable of items
#define MID_STYLE 0xe0
......
......@@ -522,6 +522,11 @@ interface BaseTextEditView
StateMethod = StateTabWin ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
SID_ATTR_PAGE_MARGIN
[
StateMethod = StateTabWin ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
SID_THESAURUS // status(final|play)
[
......
......@@ -7471,6 +7471,24 @@ SvxLongLRSpaceItem SwPageLRMargin SID_ATTR_PAGE_LRSPACE
GroupId = GID_FORMAT;
]
SfxVoidItem PageMargin SID_ATTR_PAGE_MARGIN
[
AutoUpdate = FALSE,
FastCall = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = FALSE,
MenuConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_FORMAT;
]
SfxBoolItem SwPageHeaderItem SID_ATTR_PAGE_HEADER
[
......
......@@ -19,265 +19,31 @@
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include "PropertyPanel.hrc"
#include "PagePropertyPanel.hrc"
#include "helpid.h"
Image IMG_PAGE_NARROW
String STR_MARGIN_TOOLTIP_LEFT
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_narrow_24x24.png";};
Text [ en-US ] = "Left: ";
};
Image IMG_PAGE_NORMAL
String STR_MARGIN_TOOLTIP_RIGHT
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_nomal_24x24.png";};
Text [ en-US ] = ". Right: ";
};
Image IMG_PAGE_WIDE
String STR_MARGIN_TOOLTIP_INNER
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_wide_24x24.png";};
Text [ en-US ] = "Inner: ";
};
Image IMG_PAGE_MIRRORED
String STR_MARGIN_TOOLTIP_OUTER
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_mirror_24x24.png";};
Text [ en-US ] = ". Outer: ";
};
Image IMG_PAGE_MARGIN_CUSTOM
String STR_MARGIN_TOOLTIP_TOP
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_copy_24x24.png";};
Text [ en-US ] = ". Top: ";
};
Image IMG_PAGE_NARROW_L
String STR_MARGIN_TOOLTIP_BOT
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnarrow_24x24.png";};
};
Image IMG_PAGE_NORMAL_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnormal_24x24.png";};
};
Image IMG_PAGE_WIDE_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatwide_24x24.png";};
};
Image IMG_PAGE_MIRRORED_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatmirror_24x24.png";};
};
Image IMG_PAGE_MARGIN_CUSTOM_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatcopy_24x24.png";};
};
// popup for page style's margin attributes
Control RID_POPUP_SWPAGE_MARGIN
{
OutputSize = TRUE;
DialogControl = TRUE;
Border = FALSE;
Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_WIDTH, MARGIN_PANEL_HEIGHT );
Control VS_MARGIN
{
Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y );
Size = MAP_APPFONT ( VS_WIDTH , ITEM_HEIGHT*5);
HelpID = HID_SWPAGE_VS_MARGIN;
TabStop = TRUE ;
Text = "Margin";
};
FixedText FT_CUSTOM
{
Pos = MAP_APPFONT ( FT_CUSTOM_X, FT_CUSTOM_Y );
Size = MAP_APPFONT ( MBOX_WIDTH + 30, TEXT_HEIGHT) ;
Text [ en-US ] = "Custom:";
};
FixedText FT_LEFT
{
Pos = MAP_APPFONT ( FT_X, FT_LEFT_Y );
Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ;
Text [ en-US ] = "~Left:";
};
FixedText FT_INNER
{
Pos = MAP_APPFONT ( FT_X, FT_LEFT_Y );
Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ;
Text [ en-US ] = "I~nner:";
};
MetricField MF_SWLEFT_MARGIN
{
Border = TRUE;
Pos = MAP_APPFONT ( MF_X , LEFT_MF_Y );
Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT );
HelpID = HID_SWPAGE_LEFT_MARGIN;
Left = TRUE;
Repeat = TRUE;
Spin = TRUE;
Maximum = 9999;
DecimalDigits = 2;
Unit = FUNIT_CM;
Last = 9999;
SpinSize = 10;
};
FixedText FT_RIGHT
{
Pos = MAP_APPFONT ( FT_X, FT_RIGHT_Y );
Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ;
Text [ en-US ] = "~Right:";
};
FixedText FT_OUTER
{
Pos = MAP_APPFONT ( FT_X, FT_RIGHT_Y );
Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ;
Text [ en-US ] = "O~uter:";
};
MetricField MF_SWRIGHT_MARGIN
{
Border = TRUE;
Pos = MAP_APPFONT ( MF_X , RIGHT_MF_Y );
Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT );
HelpID = HID_SWPAGE_RIGHT_MARGIN;
Left = TRUE;
Repeat = TRUE;
Spin = TRUE;
Maximum = 9999;
DecimalDigits = 2;
Unit = FUNIT_CM;
Last = 9999;
SpinSize = 10;
};
FixedText FT_TOP
{
Pos = MAP_APPFONT ( FT_X, FT_TOP_Y );
Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ;
Text [ en-US ] = "~Top:";
};
MetricField MF_SWTOP_MARGIN
{
Border = TRUE;
Pos = MAP_APPFONT ( MF_X , TOP_MF_Y );
Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT );
HelpID = HID_SWPAGE_TOP_MARGIN;
Left = TRUE;
Repeat = TRUE;
Spin = TRUE;
Maximum = 9999;
DecimalDigits = 2;
Unit = FUNIT_CM;
Last = 9999;
SpinSize = 10;
};
FixedText FT_BOTTOM
{
Pos = MAP_APPFONT ( FT_X, FT_BOTTOM_Y );
Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ;
Text [ en-US ] = "~Bottom:";
};
MetricField MF_SWBOTTOM_MARGIN
{
Border = TRUE;
Pos = MAP_APPFONT ( MF_X , BOTTOM_MF_Y );
Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT );
HelpID = HID_SWPAGE_BOTTOM_MARGIN;
Left = TRUE;
Repeat = TRUE;
Spin = TRUE;
Maximum = 9999;
DecimalDigits = 2;
Unit = FUNIT_CM;
Last = 9999;
SpinSize = 10;
};
MetricField FLD_WIDTH_HEIGHT
{
Border = TRUE;
Left = TRUE;
Repeat = TRUE;
Spin = TRUE;
Maximum = 9999;
DecimalDigits = 2;
Unit = FUNIT_CM;
Last = 9999;
SpinSize = 10;
};
Image IMG_NARROW
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_narrow_24x24.png";};
};
Image IMG_NORMAL
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_nomal_24x24.png";};
};
Image IMG_WIDE
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_wide_24x24.png";};
};
Image IMG_MIRRORED
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_mirror_24x24.png";};
};
Image IMG_NARROW_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnarrow_24x24.png";};
};
Image IMG_NORMAL_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnormal_24x24.png";};
};
Image IMG_WIDE_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatwide_24x24.png";};
};
Image IMG_MIRRORED_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatmirror_24x24.png";};
};
Image IMG_CUSTOM
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/last_custom_common.png";};
};
Image IMG_CUSTOM_DIS
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/last_custom_common_grey.png";};
};
String STR_LCVALUE
{
Text [ en-US ] = "Last Custom Values";
};
String STR_NARROW
{
Text [ en-US ] = "Narrow";
};
String STR_NORMAL
{
Text [ en-US ] = "Normal";
};
String STR_WIDE
{
Text [ en-US ] = "Wide";
};
String STR_MIRRORED
{
Text [ en-US ] = "Mirrored";
};
String STR_MARGIN_TOOLTIP_LEFT
{
Text [ en-US ] = "Left: ";
};
String STR_MARGIN_TOOLTIP_RIGHT
{
Text [ en-US ] = ". Right: ";
};
String STR_MARGIN_TOOLTIP_INNER
{
Text [ en-US ] = "Inner: ";
};
String STR_MARGIN_TOOLTIP_OUTER
{
Text [ en-US ] = ". Outer: ";
};
String STR_MARGIN_TOOLTIP_TOP
{
Text [ en-US ] = ". Top: ";
};
String STR_MARGIN_TOOLTIP_BOT
{
Text [ en-US ] = ". Bottom: ";
};
Text [ en-US ] = ". Bottom: ";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -111,6 +111,7 @@
#include <svx/rubydialog.hxx>
#include <svtools/colorcfg.hxx>
#include <PageSizePopup.hxx>
#include <PageMarginPopup.hxx>
#include <PageOrientationPopup.hxx>
#include <PageColumnPopup.hxx>
......@@ -294,6 +295,7 @@ void SwDLL::RegisterControls()
svx::TextUnderlinePopup::RegisterControl(SID_ATTR_CHAR_UNDERLINE, pMod);
svx::ParaULSpacingControl::RegisterControl(SID_ATTR_PARA_ULSPACE, pMod);
svx::ParaLRSpacingControl::RegisterControl(SID_ATTR_PARA_LRSPACE, pMod);
PageMarginPopup::RegisterControl(SID_ATTR_PAGE_MARGIN, pMod);
PageOrientationPopup::RegisterControl(SID_ATTR_PAGE_ORIENTATION, pMod);
PageColumnPopup::RegisterControl(SID_ATTR_PAGE_COLUMN, pMod);
PageSizePopup::RegisterControl(SID_ATTR_PAGE_SIZE, pMod);
......
......@@ -19,7 +19,6 @@
#include "PageColumnControl.hxx"
#include "PagePropertyPanel.hxx"
#include "PagePropertyPanel.hrc"
#include <cmdid.h>
#include <swtypes.hxx>
......
......@@ -21,6 +21,10 @@
#include <svx/tbxctl.hxx>
#include <vcl/button.hxx>
#include <svx/pageitem.hxx>
#include <editeng/sizeitem.hxx>
#include <svl/intitem.hxx>
#include <editeng/sizeitem.hxx>
namespace sw { namespace sidebar {
......
......@@ -29,6 +29,9 @@
#include <vcl/field.hxx>
#include <svtools/unitconv.hxx>
#include <vector>
#include <vcl/layout.hxx>
#include <svx/tbxctl.hxx>
#define SWPAGE_NARROW_VALUE 720
#define SWPAGE_NORMAL_VALUE 1136
......@@ -36,84 +39,78 @@
#define SWPAGE_WIDE_VALUE2 2880
#define SWPAGE_WIDE_VALUE3 1800
namespace svx { namespace sidebar {
class ValueSetWithTextControl;
} }
class ValueSet;
static const long MINBODY = 284; //0.5 cm in twips
namespace sw { namespace sidebar {
class PagePropertyPanel;
class PageMarginControl
: public svx::sidebar::PopupControl
class PageMarginControl : public SfxPopupWindow
{
public:
PageMarginControl(
vcl::Window* pParent,
PagePropertyPanel& rPanel,
const SvxLongLRSpaceItem& aPageLRMargin,
const SvxLongULSpaceItem& aPageULMargin,
const bool bMirrored,
const Size& rPageSize,
const bool bLandscape,
const FieldUnit eFUnit,
const MapUnit eUnit );
PageMarginControl( sal_uInt16 nId );
virtual ~PageMarginControl() override;
virtual void dispose() override;
private:
VclPtr< svx::sidebar::ValueSetWithTextControl> mpMarginValueSet;
VclPtr<FixedText> maCustom;
VclPtr<FixedText> maLeft;
VclPtr<FixedText> maInner;
VclPtr<MetricField> maLeftMarginEdit;
VclPtr<FixedText> maRight;
VclPtr<FixedText> maOuter;
VclPtr<MetricField> maRightMarginEdit;
VclPtr<FixedText> maTop;
VclPtr<MetricField> maTopMarginEdit;
VclPtr<FixedText> maBottom;
VclPtr<MetricField> maBottomMarginEdit;
VclPtr<PushButton> m_pNarrow;
VclPtr<PushButton> m_pNormal;
VclPtr<PushButton> m_pWide;
VclPtr<PushButton> m_pMirrored;
VclPtr<PushButton> m_pLast;
VclPtr<FixedText> m_pLeft;
VclPtr<FixedText> m_pRight;
VclPtr<FixedText> m_pInner;
VclPtr<FixedText> m_pOuter;
VclPtr<VclVBox> m_pContainer;
VclPtr<MetricField> m_pLeftMarginEdit;
VclPtr<MetricField> m_pRightMarginEdit;
VclPtr<MetricField> m_pTopMarginEdit;
VclPtr<MetricField> m_pBottomMarginEdit;
// hidden metric field
VclPtr<MetricField> maWidthHeightField;
VclPtr<MetricField> m_pWidthHeightField;
long mnPageLeftMargin;
long mnPageRightMargin;
long mnPageTopMargin;
long mnPageBottomMargin;
bool mbMirrored;
long m_nPageLeftMargin;
long m_nPageRightMargin;
long m_nPageTopMargin;
long m_nPageBottomMargin;
bool m_bMirrored;
const MapUnit meUnit;
const MapUnit m_eUnit;
bool mbUserCustomValuesAvailable;
long mnUserCustomPageLeftMargin;
long mnUserCustomPageRightMargin;
long mnUserCustomPageTopMargin;
long mnUserCustomPageBottomMargin;
bool mbUserCustomMirrored;
Size m_aPageSize;
bool mbCustomValuesUsed;
bool m_bUserCustomValuesAvailable;
long m_nUserCustomPageLeftMargin;
long m_nUserCustomPageRightMargin;
long m_nUserCustomPageTopMargin;
long m_nUserCustomPageBottomMargin;
bool m_bUserCustomMirrored;
PagePropertyPanel& mrPagePropPanel;
bool m_bCustomValuesUsed;
DECL_LINK_TYPED( ImplMarginHdl, ValueSet*, void );
DECL_LINK_TYPED( SelectMarginHdl, Button*, void );
DECL_LINK_TYPED( ModifyLRMarginHdl, Edit&, void );
DECL_LINK_TYPED( ModifyULMarginHdl, Edit&, void );
static void ExecuteMarginLRChange(
const long nPageLeftMargin,
const long nPageRightMargin );
static void ExecuteMarginULChange(
const long nPageTopMargin,
const long nPageBottomMargin );
static void ExecutePageLayoutChange( const bool bMirrored );
void SetMetricFieldMaxValues(const Size& rPageSize);
bool GetUserCustomValues();
void StoreUserCustomValues();
void FillValueSet(
const bool bLandscape,
const bool bUserCustomValuesAvailable );
void SelectValueSetItem();
void FillHelpText( const bool bUserCustomValuesAvailable );
};
} } // end of namespace sw::sidebar
......
/* -*- 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 <PageMarginPopup.hxx>
#include "PageMarginControl.hxx"
#include <svx/pageitem.hxx>
#include <vcl/toolbox.hxx>
SFX_IMPL_TOOLBOX_CONTROL(PageMarginPopup, SfxVoidItem);
PageMarginPopup::PageMarginPopup(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
: SfxToolBoxControl(nSlotId, nId, rTbx)
{
rTbx.SetItemBits(nId, ToolBoxItemBits::DROPDOWNONLY | rTbx.GetItemBits(nId));
}
PageMarginPopup::~PageMarginPopup()
{
}
VclPtr<SfxPopupWindow> PageMarginPopup::CreatePopupWindow()
{
VclPtr<sw::sidebar::PageMarginControl> pControl = VclPtr<sw::sidebar::PageMarginControl>::Create(GetSlotId());
pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
SetPopupWindow(pControl);
return pControl;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 <rcid.hrc>
#include "PropertyPanel.hrc"
// global definitions
#define IMG_PAGE_NARROW (RC_SIDEBAR_BEGIN + 2)
#define IMG_PAGE_NORMAL (RC_SIDEBAR_BEGIN + 3)
#define IMG_PAGE_WIDE (RC_SIDEBAR_BEGIN + 4)
#define IMG_PAGE_MIRRORED (RC_SIDEBAR_BEGIN + 5)
#define IMG_PAGE_MARGIN_CUSTOM (RC_SIDEBAR_BEGIN + 6)
#define IMG_PAGE_NARROW_L (RC_SIDEBAR_BEGIN + 7)
#define IMG_PAGE_NORMAL_L (RC_SIDEBAR_BEGIN + 8)
#define IMG_PAGE_WIDE_L (RC_SIDEBAR_BEGIN + 9)
#define IMG_PAGE_MIRRORED_L (RC_SIDEBAR_BEGIN + 10)
#define IMG_PAGE_MARGIN_CUSTOM_L (RC_SIDEBAR_BEGIN+ 11)
// local
#define MF_SWLEFT_MARGIN 18
#define MF_SWRIGHT_MARGIN 19
#define MF_SWTOP_MARGIN 20
#define MF_SWBOTTOM_MARGIN 21
#define VS_SIZE 23
#define STR_LCVALUE 24
#define FT_CUSTOM 25
#define FLD_WIDTH_HEIGHT 26
#define IMG_NARROW 32
#define IMG_NORMAL 33
#define IMG_WIDE 34
#define IMG_MIRRORED 35
#define STR_NARROW 36
#define STR_NORMAL 37
#define STR_WIDE 38
#define STR_MIRRORED 39
#define VS_MARGIN 40
#define IMG_CUSTOM 41
#define FT_LEFT 42
#define FT_RIGHT 43
#define FT_TOP 44
#define FT_BOTTOM 45
#define FT_INNER 46
#define FT_OUTER 47
#define VS_COLUMN 49
#define MBOX_WIDTH 50
#define IMG_NARROW_L 109
#define IMG_NORMAL_L 110
#define IMG_WIDE_L 111
#define IMG_MIRRORED_L 112
#define IMG_CUSTOM_DIS 121
#define STR_MARGIN_TOOLTIP_LEFT 122
#define STR_MARGIN_TOOLTIP_RIGHT 123
#define STR_MARGIN_TOOLTIP_INNER 124
#define STR_MARGIN_TOOLTIP_OUTER 125
#define STR_MARGIN_TOOLTIP_TOP 126
#define STR_MARGIN_TOOLTIP_BOT 127
#define POPUP_MARGIN 4
#define VS_WIDTH 78
#define ITEM_HEIGHT 17
#define ITEM_HEIGHT2 15
// Position
#define FT_CUSTOM_X POPUP_MARGIN + OFFSET_X
#define FT_CUSTOM_Y POPUPPANEL_MARGIN_SMALL * 2 + ITEM_HEIGHT * 5
#define POP_BORDER_X POPUP_MARGIN + OFFSET_X + 1
#define POP_BORDER_Y POPUPPANEL_MARGIN_SMALL * 3 + ITEM_HEIGHT * 5 + TEXT_HEIGHT
#define BD_HEIGHT MBOX_HEIGHT*4 + CONTROL_SPACING_VERTICAL*5
#define FT_X POP_BORDER_X + CONTROL_SPACING_HORIZONTAL
#define MF_X FT_X + 25 + CONTROL_SPACING_HORIZONTAL
#define LEFT_MF_Y POP_BORDER_Y + CONTROL_SPACING_VERTICAL
#define RIGHT_MF_Y LEFT_MF_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
#define TOP_MF_Y RIGHT_MF_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
#define BOTTOM_MF_Y TOP_MF_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
#define FT_LEFT_Y LEFT_MF_Y + 1
#define FT_RIGHT_Y RIGHT_MF_Y + 1
#define FT_TOP_Y TOP_MF_Y + 1
#define FT_BOTTOM_Y BOTTOM_MF_Y + 1
#define MARGIN_PANEL_HEIGHT POP_BORDER_Y + BD_HEIGHT + POPUP_MARGIN + OFFSET_Y
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -49,35 +49,9 @@ namespace svx { namespace sidebar {
namespace sw { namespace sidebar {
class PagePropertyPanel
: public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
class PagePropertyPanel : public PanelLayout
{
public:
// interface of ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
const SfxPoolItem* pState,
const bool bIsEnabled) override;
SfxBindings* GetBindings() const
{
return mpBindings;
}
VclPtr< svx::sidebar::PopupControl> CreatePageMarginControl( svx::sidebar::PopupContainer* pParent );
void ExecuteMarginLRChange(
const long nPageLeftMargin,
const long nPageRightMargin );
void ExecuteMarginULChange(
const long nPageTopMargin,
const long nPageBottomMargin );
void ExecutePageLayoutChange( const bool bMirrored );
void ClosePageMarginPopup();
void StartUndo();
void EndUndo();
PagePropertyPanel(
vcl::Window* pParent,
......@@ -86,66 +60,6 @@ namespace sw { namespace sidebar {
private:
virtual ~PagePropertyPanel() override;
virtual void dispose() override;
SfxBindings* mpBindings;
// toolboxes - on click open corresponding popup
VclPtr<ToolBox> mpToolBoxMargin;
Image* maImgSize;
Image* maImgSize_L;
Image mImgNarrow;
Image mImgNormal;
Image mImgWide;
Image mImgMirrored;
Image mImgMarginCustom;
Image mImgNarrow_L;
Image mImgNormal_L;
Image mImgWide_L;
Image mImgMirrored_L;
Image mImgMarginCustom_L;
// item keeping the following page style attributes:
// - page orientation
// - page usage - only left, only right, both, mirrored
// item also hold the numbering type for the page style which should
// be kept stable.
std::unique_ptr<SvxPageItem> mpPageItem;
// item keeping the page style's left and right margins
std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
// item keeping the page style's top and bottom margins
std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
// item keeping the page style's page size
std::unique_ptr<SvxSizeItem> mpPageSizeItem;
FieldUnit meFUnit;
MapUnit meUnit;
// controller items
::sfx2::sidebar::ControllerItem m_aSwPagePgULControl;
::sfx2::sidebar::ControllerItem m_aSwPagePgLRControl;
::sfx2::sidebar::ControllerItem m_aSwPagePgSizeControl;
::sfx2::sidebar::ControllerItem m_aSwPagePgMetricControl;
// popups
svx::sidebar::Popup maMarginPopup;
const css::uno::Reference< css::document::XUndoManager > mxUndoManager;
bool mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify;
// handler for popup toolboxes to show the popups
DECL_LINK_TYPED(ClickMarginHdl, ToolBox*, void);
void Initialize();
void MetricState( SfxItemState eState, const SfxPoolItem* pState );
// helper to adjust popup toolbox' images
void ChangeMarginImage();
};
} } // end of namespace ::sw::sidebar
......
......@@ -19,7 +19,6 @@
#include "PageSizeControl.hxx"
#include "PagePropertyPanel.hxx"
#include "PagePropertyPanel.hrc"
#include <cmdid.h>
#include <swtypes.hxx>
......@@ -34,6 +33,8 @@
#include <vcl/settings.hxx>
#include <svl/itempool.hxx>
#include <svl/intitem.hxx>
#include <editeng/sizeitem.hxx>
namespace
{
......
......@@ -21,7 +21,12 @@
#include "rcid.hrc"
#define RID_POPUP_SWPAGE_MARGIN (RC_PROPERTYPANEL_BEGIN + 3)
#define STR_MARGIN_TOOLTIP_LEFT (RC_PROPERTYPANEL_BEGIN + 1)
#define STR_MARGIN_TOOLTIP_RIGHT (RC_PROPERTYPANEL_BEGIN + 2)
#define STR_MARGIN_TOOLTIP_INNER (RC_PROPERTYPANEL_BEGIN + 3)
#define STR_MARGIN_TOOLTIP_OUTER (RC_PROPERTYPANEL_BEGIN + 4)
#define STR_MARGIN_TOOLTIP_TOP (RC_PROPERTYPANEL_BEGIN + 5)
#define STR_MARGIN_TOOLTIP_BOT (RC_PROPERTYPANEL_BEGIN + 6)
#endif
......
......@@ -18,7 +18,6 @@
*/
#include "WrapPropertyPanel.hxx"
#include "PropertyPanel.hrc"
#include <cmdid.h>
#include <swtypes.hxx>
......
......@@ -39,11 +39,6 @@
<property name="can_focus">False</property>
<property name="pixbuf">cmd/lc_fontwork.png</property>
</object>
<object class="GtkImage" id="FormatColumnsImg">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">cmd/lc_formatcolumns.png</property>
</object>
<object class="GtkImage" id="GalleryImg">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -2806,18 +2801,18 @@
</packing>
</child>
<child>
<object class="sfxlo-BigToolBox" id="columnbox">
<object class="sfxlo-BigToolBox" id="sizebox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="show_arrow">False</property>
<child>
<object class="GtkMenuToolButton" id="Columns">
<object class="GtkMenuToolButton" id="Size">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="is_important">True</property>
<property name="action_name">.uno:PageColumnType</property>
<property name="action_name">.uno:AttributePageSize</property>
<property name="use_underline">True</property>
</object>
<packing>
......@@ -2833,18 +2828,18 @@
</packing>
</child>
<child>
<object class="sfxlo-BigToolBox" id="sizebox">
<object class="sfxlo-BigToolBox" id="columnbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="show_arrow">False</property>
<child>
<object class="GtkMenuToolButton" id="Size">
<object class="GtkMenuToolButton" id="Columns">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="is_important">True</property>
<property name="action_name">.uno:AttributePageSize</property>
<property name="action_name">.uno:PageColumnType</property>
<property name="use_underline">True</property>
</object>
<packing>
......@@ -2880,18 +2875,6 @@
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
......@@ -2899,15 +2882,25 @@
</packing>
</child>
<child>
<object class="vcllo-SmallButton" id="FormatColumns">
<object class="sfxlo-BigToolBox" id="marginbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="action_name">.uno:FormatColumns</property>
<property name="image">FormatColumnsImg</property>
<property name="relief">none</property>
<property name="image_position">top</property>
<property name="always_show_image">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="show_arrow">False</property>
<child>
<object class="GtkMenuToolButton" id="Margin">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="is_important">True</property>
<property name="action_name">.uno:PageMargin</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......
This diff is collapsed.
......@@ -2,6 +2,7 @@
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkGrid" id="PagePropertyPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -54,7 +55,7 @@
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Size</property>
<property name="action_name">.uno:Size</property>
<property name="action_name">.uno:AttributePageSize</property>
<property name="label">toolbutton3</property>
<property name="use_underline">True</property>
</object>
......@@ -82,7 +83,7 @@
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Columns</property>
<property name="action_name">.uno:Column</property>
<property name="action_name">.uno:PageColumnType</property>
<property name="label">toolbutton4</property>
<property name="use_underline">True</property>
</object>
......@@ -109,7 +110,7 @@
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Margin</property>
<property name="action_name">.uno:Margin</property>
<property name="action_name">.uno:PageMargin</property>
<property name="label">toolbutton2</property>
<property name="use_underline">True</property>
</object>
......
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