summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icon-themes/breeze/cmd/lc_orientation.png (renamed from icon-themes/breeze/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png)bin255 -> 255 bytes
-rw-r--r--icon-themes/galaxy/cmd/lc_orientation.png (renamed from icon-themes/galaxy/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png)bin1521 -> 1521 bytes
-rw-r--r--icon-themes/sifr/cmd/lc_orientation.png (renamed from icon-themes/sifr/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png)bin286 -> 286 bytes
-rw-r--r--icon-themes/tango/cmd/lc_orientation.png (renamed from icon-themes/tango/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png)bin1124 -> 1124 bytes
-rw-r--r--include/svx/svxids.hrc1
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu8
-rw-r--r--svx/sdi/svx.sdi19
-rw-r--r--sw/Library_sw.mk1
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/PageOrientationPopup.hxx41
-rw-r--r--sw/sdi/_viewsh.sdi4
-rw-r--r--sw/source/ui/sidebar/PagePropertyPanel.src42
-rw-r--r--sw/source/uibase/app/swmodule.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.cxx197
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.hxx35
-rw-r--r--sw/source/uibase/sidebar/PageOrientationPopup.cxx46
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.cxx116
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.hrc7
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.hxx9
-rw-r--r--sw/source/uibase/sidebar/PropertyPanel.hrc1
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx1
-rw-r--r--sw/uiconfig/swriter/ui/notebookbar.ui179
-rw-r--r--sw/uiconfig/swriter/ui/pageorientationcontrol.ui71
-rw-r--r--sw/uiconfig/swriter/ui/sidebarpage.ui26
24 files changed, 476 insertions, 331 deletions
diff --git a/icon-themes/breeze/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png b/icon-themes/breeze/cmd/lc_orientation.png
index 145970538814..145970538814 100644
--- a/icon-themes/breeze/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png
+++ b/icon-themes/breeze/cmd/lc_orientation.png
Binary files differ
diff --git a/icon-themes/galaxy/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png b/icon-themes/galaxy/cmd/lc_orientation.png
index a951f0d17cd1..a951f0d17cd1 100644
--- a/icon-themes/galaxy/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png
+++ b/icon-themes/galaxy/cmd/lc_orientation.png
Binary files differ
diff --git a/icon-themes/sifr/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png b/icon-themes/sifr/cmd/lc_orientation.png
index d8c0eda58aa4..d8c0eda58aa4 100644
--- a/icon-themes/sifr/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png
+++ b/icon-themes/sifr/cmd/lc_orientation.png
Binary files differ
diff --git a/icon-themes/tango/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png b/icon-themes/tango/cmd/lc_orientation.png
index 28eed4df7f97..28eed4df7f97 100644
--- a/icon-themes/tango/sw/res/sidebar/pageproppanel/portraitcopy_24x24.png
+++ b/icon-themes/tango/cmd/lc_orientation.png
Binary files differ
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 81eb9f44a0e0..7157993b2030 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -242,6 +242,7 @@
#define SID_ATTR_PAGE ( SID_SVX_START + 50 )
#define SID_ATTR_PAGE_SIZE ( SID_SVX_START + 51 )
#define SID_ATTR_PAGE_MAXSIZE ( SID_SVX_START + 52 )
+#define SID_ATTR_PAGE_ORIENTATION ( SID_SVX_START + 53 )
#define SID_ATTR_PAGE_PAPERBIN ( SID_SVX_START + 54 )
#define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 56 )
#define SID_ATTR_PAGE_EXT2 ( SID_SVX_START + 57 )
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index a5b7fcbd4867..a8072e8c3a63 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -2817,6 +2817,14 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:Orientation" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Orientation</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 38082bedc946..f5f83ae7ecf3 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -6099,6 +6099,25 @@ SvxPageItem AttributePage SID_ATTR_PAGE
]
+SvxPageItem Orientation SID_ATTR_PAGE_ORIENTATION
+
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_FORMAT;
+]
+
+
SvxAutoKernItem PairKerning SID_ATTR_CHAR_AUTOKERN
[
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index c563c9c6b816..7288a85d6292 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -677,6 +677,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/shells/txtnum \
sw/source/uibase/sidebar/StylePresetsPanel \
sw/source/uibase/sidebar/PageOrientationControl \
+ sw/source/uibase/sidebar/PageOrientationPopup \
sw/source/uibase/sidebar/PageMarginControl \
sw/source/uibase/sidebar/PageSizeControl \
sw/source/uibase/sidebar/PageColumnControl \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 397d3b35a34a..ad698ec57b0d 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -206,6 +206,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/notebookbar \
sw/uiconfig/swriter/ui/notebookbar_groups \
sw/uiconfig/swriter/ui/notebookbar_single \
+ sw/uiconfig/swriter/ui/pageorientationcontrol \
sw/uiconfig/swriter/ui/paradialog \
sw/uiconfig/swriter/ui/picturedialog \
sw/uiconfig/swriter/ui/picturepage \
diff --git a/sw/inc/PageOrientationPopup.hxx b/sw/inc/PageOrientationPopup.hxx
new file mode 100644
index 000000000000..7726104a562f
--- /dev/null
+++ b/sw/inc/PageOrientationPopup.hxx
@@ -0,0 +1,41 @@
+/* -*- 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_PAGEORIENTATIONPOPUP_HXX
+#define INCLUDED_SW_INC_PAGEORIENTATIONPOPUP_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include <swdllapi.h>
+#include <vcl/vclenum.hxx>
+#include <functional>
+
+class SW_DLLPUBLIC PageOrientationPopup : public SfxToolBoxControl
+{
+public:
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ PageOrientationPopup(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+ virtual ~PageOrientationPopup();
+
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() override;
+};
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 27779439a342..99f3fb657d60 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -402,6 +402,10 @@ interface BaseTextEditView
ExecMethod = Execute ;
StateMethod = GetState ;
]
+ SID_ATTR_PAGE_ORIENTATION // status()
+ [
+ StateMethod = GetState ;
+ ]
SID_ATTR_PAGE_SIZE // status(final|play)
[
ExecMethod = Execute ;
diff --git a/sw/source/ui/sidebar/PagePropertyPanel.src b/sw/source/ui/sidebar/PagePropertyPanel.src
index f38b73b72044..785861dd758d 100644
--- a/sw/source/ui/sidebar/PagePropertyPanel.src
+++ b/sw/source/ui/sidebar/PagePropertyPanel.src
@@ -22,14 +22,6 @@
#include "PagePropertyPanel.hrc"
#include "helpid.h"
-Image IMG_PAGE_PORTRAIT
-{
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/portraitcopy_24x24.png";};
-};
-Image IMG_PAGE_LANDSCAPE
-{
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/Landscapecopy_24x24.png";};
-};
Image IMG_PAGE_NARROW
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_narrow_24x24.png";};
@@ -191,40 +183,6 @@ Image IMG_PAGE_COLUMN_NONE_L
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columncopy_24x24.png";};
};
-// popup for page orientation attribute
-Control RID_POPUP_SWPAGE_ORIENTATION
-{
- OutputSize = TRUE;
- DialogControl = TRUE;
- Border = FALSE;
- Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_WIDTH, ITEM_HEIGHT*2 + POPUPPANEL_MARGIN_SMALL*2 );
-
- Control VS_ORIENTATION
- {
- Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y);
- Size = MAP_APPFONT ( VS_WIDTH , ITEM_HEIGHT*2);
- HelpID = HID_SWPAGE_VS_ORIENTATION;
- TabStop = TRUE ;
- Text = "Orientation";
- };
- Image IMG_PORTRAIT
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/portraitcopy_24x24.png";};
- };
- Image IMG_LANDSCAPE
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/Landscapecopy_24x24.png";};
- };
- String STR_PORTRAIT
- {
- Text [ en-US ] = "Portrait";
- };
- String STR_LANDSCAPE
- {
- Text [ en-US ] = "Landscape";
- };
-};
-
// popup for page style's margin attributes
Control RID_POPUP_SWPAGE_MARGIN
{
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 2b0b33cc5783..e41b621ddd79 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -110,6 +110,7 @@
#include <barcfg.hxx>
#include <svx/rubydialog.hxx>
#include <svtools/colorcfg.hxx>
+#include <PageOrientationPopup.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/moduleoptions.hxx>
@@ -291,6 +292,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);
+ PageOrientationPopup::RegisterControl(SID_ATTR_PAGE_ORIENTATION, pMod);
SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx
index 6fecc469f525..20e3bb83b7f8 100644
--- a/sw/source/uibase/sidebar/PageOrientationControl.cxx
+++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx
@@ -18,47 +18,50 @@
*/
#include "PageOrientationControl.hxx"
-#include "PagePropertyPanel.hxx"
-#include "PagePropertyPanel.hrc"
+#include "PageMarginControl.hxx"
#include <swtypes.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/dispatch.hxx>
+#include <svx/svxids.hrc>
+#include <cmdid.h>
-#include <svx/sidebar/ValueSetWithTextControl.hxx>
-#include <vcl/settings.hxx>
+namespace {
+ const css::uno::Reference< css::document::XUndoManager > getUndoManager( const css::uno::Reference< css::frame::XFrame >& rxFrame )
+ {
+ const css::uno::Reference< css::frame::XController >& xController = rxFrame->getController();
+ if ( xController.is() )
+ {
+ const css::uno::Reference< css::frame::XModel >& xModel = xController->getModel();
+ if ( xModel.is() )
+ {
+ const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW );
+ if ( xSuppUndo.is() )
+ {
+ const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW );
+ return xUndoManager;
+ }
+ }
+ }
+
+ return css::uno::Reference< css::document::XUndoManager > ();
+ }
+}
namespace sw { namespace sidebar {
-PageOrientationControl::PageOrientationControl(
- vcl::Window* pParent,
- PagePropertyPanel& rPanel,
- const bool bLandscape )
- : svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_ORIENTATION) )
- , mpOrientationValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::ControlType::ImageText, this, SW_RES(VS_ORIENTATION) ) )
- , mbLandscape( bLandscape )
- , mrPagePropPanel(rPanel)
+PageOrientationControl::PageOrientationControl( sal_uInt16 nId )
+ : SfxPopupWindow( nId, "PageOrientationControl", "modules/swriter/ui/pageorientationcontrol.ui" )
+ , mpPageItem( new SvxPageItem(SID_ATTR_PAGE) )
+ , mpPageSizeItem( new SvxSizeItem(SID_ATTR_PAGE_SIZE) )
+ , mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) )
+ , mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) )
{
- mpOrientationValueSet->SetStyle( mpOrientationValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT );
- mpOrientationValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+ get(m_pPortrait, "portrait");
+ get(m_pLandscape, "landscape");
- // initialize <ValueSetWithText> control
- {
- mpOrientationValueSet->AddItem(Image(SW_RES(IMG_PORTRAIT)), nullptr,
- SW_RES(STR_PORTRAIT), nullptr);
- mpOrientationValueSet->AddItem(Image(SW_RES(IMG_LANDSCAPE)), nullptr,
- SW_RES(STR_LANDSCAPE), nullptr );
- }
-
- mpOrientationValueSet->SetSelectHdl(LINK(this, PageOrientationControl,ImplOrientationHdl ));
- mpOrientationValueSet->SetNoSelection();
- mpOrientationValueSet->StartSelection();
- mpOrientationValueSet->Show();
- mpOrientationValueSet->SelectItem( mbLandscape ? 2 : 1 );
- mpOrientationValueSet->GrabFocus();
- mpOrientationValueSet->SetFormat();
- mpOrientationValueSet->Invalidate();
- mpOrientationValueSet->StartSelection();
-
- FreeResource();
+ m_pPortrait->SetClickHdl( LINK( this, PageOrientationControl,ImplOrientationHdl ) );
+ m_pLandscape->SetClickHdl( LINK( this, PageOrientationControl,ImplOrientationHdl ) );
}
PageOrientationControl::~PageOrientationControl()
@@ -68,26 +71,130 @@ PageOrientationControl::~PageOrientationControl()
void PageOrientationControl::dispose()
{
- mpOrientationValueSet.disposeAndClear();
- svx::sidebar::PopupControl::dispose();
+ m_pPortrait.disposeAndClear();
+ m_pLandscape.disposeAndClear();
+
+ mpPageItem.reset();
+ mpPageLRMarginItem.reset();
+ mpPageULMarginItem.reset();
+ mpPageSizeItem.reset();
+
+ SfxPopupWindow::dispose();
+}
+
+void PageOrientationControl::ExecuteMarginLRChange(
+ const long nPageLeftMargin,
+ const long nPageRightMargin )
+{
+ mpPageLRMarginItem->SetLeft( nPageLeftMargin );
+ mpPageLRMarginItem->SetRight( nPageRightMargin );
+ SfxViewShell::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_LRSPACE,
+ SfxCallMode::RECORD, { mpPageLRMarginItem.get() });
+}
+
+void PageOrientationControl::ExecuteMarginULChange(
+ const long nPageTopMargin,
+ const long nPageBottomMargin )
+{
+ mpPageULMarginItem->SetUpper( nPageTopMargin );
+ mpPageULMarginItem->SetLower( nPageBottomMargin );
+ SfxViewShell::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_ULSPACE,
+ SfxCallMode::RECORD, { mpPageULMarginItem.get() });
}
-IMPL_LINK_TYPED(PageOrientationControl, ImplOrientationHdl, ValueSet*, pControl, void)
+void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape )
{
- mpOrientationValueSet->SetNoSelection();
- if ( pControl == mpOrientationValueSet )
+ css::uno::Reference< css::document::XUndoManager > mxUndoManager(
+ getUndoManager( SfxViewFrame::Current()->GetFrame().GetFrameInterface() ) );
+
+ if ( mxUndoManager.is() )
+ mxUndoManager->enterUndoContext( "" );
+
+ const SfxPoolItem* pItem;
+ SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE, pItem);
+ SvxSizeItem* pSizeItem = static_cast<SvxSizeItem*>(pItem->Clone());
+ if ( pSizeItem )
+ mpPageSizeItem.reset( pSizeItem );
+
+ SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE, pItem);
+ SvxLongLRSpaceItem* pLRItem = static_cast<SvxLongLRSpaceItem*>(pItem->Clone());
+ if ( pLRItem )
+ mpPageLRMarginItem.reset( pLRItem );
+
+ SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_ULSPACE, pItem);
+ SvxLongULSpaceItem* pULItem = static_cast<SvxLongULSpaceItem*>(pItem->Clone());
+ if ( pULItem )
+ mpPageULMarginItem.reset( pULItem );
+
+ {
+ // set new page orientation
+ mpPageItem->SetLandscape( bLandscape );
+
+ // swap the width and height of the page size
+ const long nRotatedWidth = mpPageSizeItem->GetSize().Height();
+ const long nRotatedHeight = mpPageSizeItem->GetSize().Width();
+ mpPageSizeItem->SetSize(Size(nRotatedWidth, nRotatedHeight));
+
+ // apply changed attributes
+ if (SfxViewShell::Current())
+ {
+ SfxViewShell::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE,
+ SfxCallMode::RECORD, { mpPageSizeItem.get(), mpPageItem.get() });
+ }
+ }
+
+ // check, if margin values still fit to the changed page size.
+ // if not, adjust margin values
{
- const sal_uInt32 iPos = mpOrientationValueSet->GetSelectItemId();
- const bool bChanged = ( ( iPos == 1 ) && mbLandscape ) ||
- ( ( iPos == 2 ) && !mbLandscape );
- if ( bChanged )
+ const long nML = mpPageLRMarginItem->GetLeft();
+ const long nMR = mpPageLRMarginItem->GetRight();
+ const long nTmpPW = nML + nMR + MINBODY;
+
+ const long nPW = mpPageSizeItem->GetSize().Width();
+
+ if ( nTmpPW > nPW )
+ {
+ if ( nML <= nMR )
+ {
+ ExecuteMarginLRChange( mpPageLRMarginItem->GetLeft(), nMR - (nTmpPW - nPW ) );
+ }
+ else
+ {
+ ExecuteMarginLRChange( nML - (nTmpPW - nPW ), mpPageLRMarginItem->GetRight() );
+ }
+ }
+
+ const long nMT = mpPageULMarginItem->GetUpper();
+ const long nMB = mpPageULMarginItem->GetLower();
+ const long nTmpPH = nMT + nMB + MINBODY;
+
+ const long nPH = mpPageSizeItem->GetSize().Height();
+
+ if ( nTmpPH > nPH )
{
- mbLandscape = !mbLandscape;
- mrPagePropPanel.ExecuteOrientationChange( mbLandscape );
+ if ( nMT <= nMB )
+ {
+ ExecuteMarginULChange( mpPageULMarginItem->GetUpper(), nMB - ( nTmpPH - nPH ) );
+ }
+ else
+ {
+ ExecuteMarginULChange( nMT - ( nTmpPH - nPH ), mpPageULMarginItem->GetLower() );
+ }
}
}
- mrPagePropPanel.ClosePageOrientationPopup();
+ if ( mxUndoManager.is() )
+ mxUndoManager->leaveUndoContext();
+}
+
+IMPL_LINK_TYPED(PageOrientationControl, ImplOrientationHdl, Button*, pControl, void)
+{
+ if ( pControl == m_pPortrait.get() )
+ ExecuteOrientationChange( false );
+ else
+ ExecuteOrientationChange( true );
+
+ EndPopupMode();
}
} } // end of namespace sw::sidebar
diff --git a/sw/source/uibase/sidebar/PageOrientationControl.hxx b/sw/source/uibase/sidebar/PageOrientationControl.hxx
index 7d44d7b58bcd..53b72706022c 100644
--- a/sw/source/uibase/sidebar/PageOrientationControl.hxx
+++ b/sw/source/uibase/sidebar/PageOrientationControl.hxx
@@ -19,37 +19,40 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEORIENTATIONCONTROL_HXX
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEORIENTATIONCONTROL_HXX
-#include <svx/sidebar/PopupControl.hxx>
-
-namespace svx { namespace sidebar {
- class ValueSetWithTextControl;
-} }
-class ValueSet;
+#include <svx/tbxctl.hxx>
+#include <svx/pageitem.hxx>
+#include <svx/rulritem.hxx>
+#include <editeng/sizeitem.hxx>
+#include <com/sun/star/document/XUndoManager.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+class Button;
namespace sw { namespace sidebar {
class PagePropertyPanel;
-class PageOrientationControl
- : public svx::sidebar::PopupControl
+class PageOrientationControl : public SfxPopupWindow
{
public:
- PageOrientationControl(
- vcl::Window* pParent,
- PagePropertyPanel& rPanel,
- const bool bLandscape );
+ PageOrientationControl(sal_uInt16 nId);
virtual ~PageOrientationControl();
virtual void dispose() override;
private:
- VclPtr< svx::sidebar::ValueSetWithTextControl> mpOrientationValueSet;
+ VclPtr<PushButton> m_pPortrait;
+ VclPtr<PushButton> m_pLandscape;
- bool mbLandscape;
+ std::unique_ptr<SvxPageItem> mpPageItem;
+ std::unique_ptr<SvxSizeItem> mpPageSizeItem;
+ std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
+ std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
- PagePropertyPanel& mrPagePropPanel;
+ void ExecuteMarginULChange(const long nPageTopMargin, const long nPageBottomMargin);
+ void ExecuteMarginLRChange(const long nPageLeftMargin, const long nPageRightMargin);
+ void ExecuteOrientationChange(const bool bLandscape);
- DECL_LINK_TYPED(ImplOrientationHdl, ValueSet*, void);
+ DECL_LINK_TYPED(ImplOrientationHdl, Button*, void);
};
} } // end of namespace sw::sidebar
diff --git a/sw/source/uibase/sidebar/PageOrientationPopup.cxx b/sw/source/uibase/sidebar/PageOrientationPopup.cxx
new file mode 100644
index 000000000000..b11a19115cac
--- /dev/null
+++ b/sw/source/uibase/sidebar/PageOrientationPopup.cxx
@@ -0,0 +1,46 @@
+/* -*- 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 <PageOrientationPopup.hxx>
+#include "PageOrientationControl.hxx"
+#include <svx/pageitem.hxx>
+#include <vcl/toolbox.hxx>
+
+SFX_IMPL_TOOLBOX_CONTROL(PageOrientationPopup, SvxPageItem);
+
+PageOrientationPopup::PageOrientationPopup(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
+ : SfxToolBoxControl(nSlotId, nId, rTbx)
+{
+ rTbx.SetItemBits(nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits(nId));
+}
+
+PageOrientationPopup::~PageOrientationPopup()
+{
+}
+
+VclPtr<SfxPopupWindow> PageOrientationPopup::CreatePopupWindow()
+{
+ VclPtr<sw::sidebar::PageOrientationControl> pControl = VclPtr<sw::sidebar::PageOrientationControl>::Create(GetSlotId());
+ pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
+ SetPopupWindow(pControl);
+
+ return pControl;
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
index f4a594dc4422..fa6d711e59d7 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
@@ -27,7 +27,6 @@
#include "PropertyPanel.hrc"
#include <svx/sidebar/PopupContainer.hxx>
-#include "PageOrientationControl.hxx"
#include "PageMarginControl.hxx"
#include "PageSizeControl.hxx"
#include "PageColumnControl.hxx"
@@ -52,7 +51,6 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
-const char UNO_ORIENTATION[] = ".uno:Orientation";
const char UNO_MARGIN[] = ".uno:Margin";
const char UNO_SIZE[] = ".uno:Size";
const char UNO_COLUMN[] = ".uno:Column";
@@ -108,8 +106,6 @@ PagePropertyPanel::PagePropertyPanel(
// image resources
, maImgSize (nullptr)
, maImgSize_L (nullptr)
- , mImgPortrait (SW_RES(IMG_PAGE_PORTRAIT))
- , mImgLandscape (SW_RES(IMG_PAGE_LANDSCAPE))
, mImgNarrow (SW_RES(IMG_PAGE_NARROW))
, mImgNormal (SW_RES(IMG_PAGE_NORMAL))
, mImgWide (SW_RES(IMG_PAGE_WIDE))
@@ -168,9 +164,6 @@ PagePropertyPanel::PagePropertyPanel(
, m_aSwPageColControl(SID_ATTR_PAGE_COLUMN, *pBindings, *this)
, m_aSwPagePgMetricControl(SID_ATTR_METRIC, *pBindings, *this)
- , maOrientationPopup( this,
- [this] (svx::sidebar::PopupContainer *parent) { return this->CreatePageOrientationControl(parent); },
- OUString("Page orientation") )
, maMarginPopup( this,
[this] (svx::sidebar::PopupContainer *parent) { return this->CreatePageMarginControl(parent); },
OUString("Page margins") )
@@ -186,7 +179,6 @@ PagePropertyPanel::PagePropertyPanel(
, mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify( false )
{
// visible controls
- get(mpToolBoxOrientation, "selectorientation");
get(mpToolBoxMargin, "selectmargin");
get(mpToolBoxSize, "selectsize");
get(mpToolBoxColumn, "selectcolumn");
@@ -212,7 +204,6 @@ void PagePropertyPanel::dispose()
mpPageULMarginItem.reset();
mpPageSizeItem.reset();
- mpToolBoxOrientation.clear();
mpToolBoxMargin.clear();
mpToolBoxSize.clear();
mpToolBoxColumn.clear();
@@ -227,24 +218,15 @@ void PagePropertyPanel::dispose()
maColumnPopup.dispose();
maSizePopup.dispose();
maMarginPopup.dispose();
- maOrientationPopup.dispose();
PanelLayout::dispose();
}
void PagePropertyPanel::Initialize()
{
- // popup for page orientation
- const sal_uInt16 nIdOrientation = mpToolBoxOrientation->GetItemId(UNO_ORIENTATION);
- Link<ToolBox *, void> aLink = LINK( this, PagePropertyPanel, ClickOrientationHdl );
- mpToolBoxOrientation->SetDropdownClickHdl( aLink );
- mpToolBoxOrientation->SetSelectHdl( aLink );
- mpToolBoxOrientation->SetItemImage( nIdOrientation, mImgPortrait);
- mpToolBoxOrientation->SetItemBits( nIdOrientation, mpToolBoxOrientation->GetItemBits( nIdOrientation ) | ToolBoxItemBits::DROPDOWNONLY );
-
// popup for page margins
const sal_uInt16 nIdMargin = mpToolBoxMargin->GetItemId(UNO_MARGIN);
- aLink = LINK( this, PagePropertyPanel, ClickMarginHdl );
+ Link<ToolBox *, void> aLink = LINK( this, PagePropertyPanel, ClickMarginHdl );
mpToolBoxMargin->SetDropdownClickHdl( aLink );
mpToolBoxMargin->SetSelectHdl( aLink );
mpToolBoxMargin->SetItemImage(nIdMargin, mImgNormal);
@@ -294,82 +276,6 @@ void PagePropertyPanel::Initialize()
mpBindings->Update( SID_ATTR_PAGE_SIZE );
}
-VclPtr< svx::sidebar::PopupControl> PagePropertyPanel::CreatePageOrientationControl( svx::sidebar::PopupContainer* pParent )
-{
- return VclPtr<PageOrientationControl>::Create( pParent, *this , mpPageItem->IsLandscape() );
-}
-
-IMPL_LINK_TYPED( PagePropertyPanel, ClickOrientationHdl, ToolBox*, pToolBox, void )
-{
- maOrientationPopup.Show( *pToolBox );
-}
-
-void PagePropertyPanel::ExecuteOrientationChange( const bool bLandscape )
-{
- StartUndo();
-
- {
- // set new page orientation
- mpPageItem->SetLandscape( bLandscape );
-
- // swap the width and height of the page size
- const long nRotatedWidth = mpPageSizeItem->GetSize().Height();
- const long nRotatedHeight = mpPageSizeItem->GetSize().Width();
- mpPageSizeItem->SetSize(Size(nRotatedWidth, nRotatedHeight));
-
- // apply changed attributes
- GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE,
- SfxCallMode::RECORD, { mpPageSizeItem.get(), mpPageItem.get() });
- }
-
- // check, if margin values still fit to the changed page size.
- // if not, adjust margin values
- {
- const long nML = mpPageLRMarginItem->GetLeft();
- const long nMR = mpPageLRMarginItem->GetRight();
- const long nTmpPW = nML + nMR + MINBODY;
-
- const long nPW = mpPageSizeItem->GetSize().Width();
-
- if ( nTmpPW > nPW )
- {
- if ( nML <= nMR )
- {
- ExecuteMarginLRChange( mpPageLRMarginItem->GetLeft(), nMR - (nTmpPW - nPW ) );
- }
- else
- {
- ExecuteMarginLRChange( nML - (nTmpPW - nPW ), mpPageLRMarginItem->GetRight() );
- }
- }
-
- const long nMT = mpPageULMarginItem->GetUpper();
- const long nMB = mpPageULMarginItem->GetLower();
- const long nTmpPH = nMT + nMB + MINBODY;
-
- const long nPH = mpPageSizeItem->GetSize().Height();
-
- if ( nTmpPH > nPH )
- {
- if ( nMT <= nMB )
- {
- ExecuteMarginULChange( mpPageULMarginItem->GetUpper(), nMB - ( nTmpPH - nPH ) );
- }
- else
- {
- ExecuteMarginULChange( nMT - ( nTmpPH - nPH ), mpPageULMarginItem->GetLower() );
- }
- }
- }
-
- EndUndo();
-}
-
-void PagePropertyPanel::ClosePageOrientationPopup()
-{
- maOrientationPopup.Hide();
-}
-
VclPtr< svx::sidebar::PopupControl> PagePropertyPanel::CreatePageMarginControl( svx::sidebar::PopupContainer* pParent )
{
return VclPtr<PageMarginControl>::Create(
@@ -524,26 +430,6 @@ void PagePropertyPanel::NotifyItemUpdate(
}
break;
- case SID_ATTR_PAGE:
- if ( eState >= SfxItemState::DEFAULT &&
- pState && dynamic_cast< const SvxPageItem *>( pState ) != nullptr )
- {
- const sal_uInt16 nIdOrientation = mpToolBoxOrientation->GetItemId(UNO_ORIENTATION);
- mpPageItem.reset( static_cast<SvxPageItem*>(pState->Clone()) );
- if ( mpPageItem->IsLandscape() )
- {
- mpToolBoxOrientation->SetItemImage(nIdOrientation, mImgLandscape);
- }
- else
- {
- mpToolBoxOrientation->SetItemImage(nIdOrientation, mImgPortrait);
- }
- ChangeMarginImage();
- ChangeSizeImage();
- ChangeColumnImage( mpPageColumnTypeItem->GetValue() );
- }
- break;
-
case SID_ATTR_PAGE_SIZE:
if ( mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify )
{
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hrc b/sw/source/uibase/sidebar/PagePropertyPanel.hrc
index fe850caa259f..01d4df9ce654 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.hrc
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.hrc
@@ -21,8 +21,6 @@
#include "PropertyPanel.hrc"
// global definitions
-#define IMG_PAGE_PORTRAIT (RC_SIDEBAR_BEGIN + 0)
-#define IMG_PAGE_LANDSCAPE (RC_SIDEBAR_BEGIN + 1)
#define IMG_PAGE_NARROW (RC_SIDEBAR_BEGIN + 2)
#define IMG_PAGE_NORMAL (RC_SIDEBAR_BEGIN + 3)
#define IMG_PAGE_WIDE (RC_SIDEBAR_BEGIN + 4)
@@ -65,10 +63,6 @@
#define IMG_PAGE_COLUMN_NONE_L (RC_SIDEBAR_BEGIN + 41)
// local
-#define IMG_PORTRAIT 10
-#define IMG_LANDSCAPE 11
-#define STR_PORTRAIT 12
-#define STR_LANDSCAPE 13
#define MF_SWLEFT_MARGIN 18
#define MF_SWRIGHT_MARGIN 19
@@ -79,7 +73,6 @@
#define FT_CUSTOM 25
#define FLD_WIDTH_HEIGHT 26
-#define VS_ORIENTATION 29
#define IMG_NARROW 32
#define IMG_NORMAL 33
#define IMG_WIDE 34
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hxx b/sw/source/uibase/sidebar/PagePropertyPanel.hxx
index 22452c8f3586..4c71d44c4fa7 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.hxx
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.hxx
@@ -71,10 +71,6 @@ namespace sw { namespace sidebar {
return mpBindings;
}
- VclPtr< svx::sidebar::PopupControl> CreatePageOrientationControl( svx::sidebar::PopupContainer* pParent );
- void ExecuteOrientationChange( const bool bLandscape );
- void ClosePageOrientationPopup();
-
VclPtr< svx::sidebar::PopupControl> CreatePageMarginControl( svx::sidebar::PopupContainer* pParent );
void ExecuteMarginLRChange(
const long nPageLeftMargin,
@@ -107,15 +103,12 @@ namespace sw { namespace sidebar {
SfxBindings* mpBindings;
// toolboxes - on click open corresponding popup
- VclPtr<ToolBox> mpToolBoxOrientation;
VclPtr<ToolBox> mpToolBoxMargin;
VclPtr<ToolBox> mpToolBoxSize;
VclPtr<ToolBox> mpToolBoxColumn;
Image* maImgSize;
Image* maImgSize_L;
- Image mImgPortrait;
- Image mImgLandscape;
Image mImgNarrow;
Image mImgNormal;
Image mImgWide;
@@ -189,7 +182,6 @@ namespace sw { namespace sidebar {
::sfx2::sidebar::ControllerItem m_aSwPagePgMetricControl;
// popups
- svx::sidebar::Popup maOrientationPopup;
svx::sidebar::Popup maMarginPopup;
svx::sidebar::Popup maSizePopup;
svx::sidebar::Popup maColumnPopup;
@@ -199,7 +191,6 @@ namespace sw { namespace sidebar {
bool mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify;
// handler for popup toolboxes to show the popups
- DECL_LINK_TYPED(ClickOrientationHdl, ToolBox*, void);
DECL_LINK_TYPED(ClickMarginHdl, ToolBox*, void);
DECL_LINK_TYPED(ClickSizeHdl, ToolBox*, void);
DECL_LINK_TYPED(ClickColumnHdl, ToolBox*, void);
diff --git a/sw/source/uibase/sidebar/PropertyPanel.hrc b/sw/source/uibase/sidebar/PropertyPanel.hrc
index ef8c5b091c94..7b36710f75a6 100644
--- a/sw/source/uibase/sidebar/PropertyPanel.hrc
+++ b/sw/source/uibase/sidebar/PropertyPanel.hrc
@@ -22,7 +22,6 @@
#include "rcid.hrc"
#define RID_POPUP_SWPAGE_MARGIN (RC_PROPERTYPANEL_BEGIN + 3)
-#define RID_POPUP_SWPAGE_ORIENTATION (RC_PROPERTYPANEL_BEGIN + 4)
#define RID_POPUP_SWPAGE_COLUMN (RC_PROPERTYPANEL_BEGIN + 5)
#define RID_POPUP_SWPAGE_SIZE (RC_PROPERTYPANEL_BEGIN + 6)
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 31d6b03a2522..b14e3f2de30a 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -147,6 +147,7 @@ void SwView::GetState(SfxItemSet &rSet)
case SID_PRINTDOCDIRECT:
GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
break;
+ case SID_ATTR_PAGE_ORIENTATION:
case SID_ATTR_PAGE:
case SID_ATTR_PAGE_SIZE:
case SID_ATTR_PAGE_PAPERBIN:
diff --git a/sw/uiconfig/swriter/ui/notebookbar.ui b/sw/uiconfig/swriter/ui/notebookbar.ui
index 9b911d4d5cfd..c92ee282f6cd 100644
--- a/sw/uiconfig/swriter/ui/notebookbar.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar.ui
@@ -2651,6 +2651,80 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
+ <object class="sfxlo-DropdownBox" id="ParaSpacingSection">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="ulspacing">
+ <property name="width_request">210</property>
+ <property name="height_request">72</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text" translatable="yes">Indent</property>
+ <child>
+ <object class="GtkToolButton" id="ULSpacing">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="is_important">True</property>
+ <property name="action_name">.uno:ULSpacing</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>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="lrspacing">
+ <property name="width_request">200</property>
+ <property name="height_request">72</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_text" translatable="yes">Indent</property>
+ <child>
+ <object class="GtkToolButton" id="LeftRightParaMargin">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="is_important">True</property>
+ <property name="action_name">.uno:LeftRightParaMargin</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>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <style>
+ <class name="priority-3"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<object class="sfxlo-DropdownBox" id="box15">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -2727,6 +2801,33 @@
</packing>
</child>
<child>
+ <object class="sfxlo-BigToolBox" id="orientationbox">
+ <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="Orientation">
+ <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:Orientation</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>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkSeparator" id="separator21">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -2735,7 +2836,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -2752,81 +2853,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <object class="sfxlo-DropdownBox" id="ParaSpacingSection">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="sfxlo-NotebookbarToolBox" id="ulspacing">
- <property name="width_request">210</property>
- <property name="height_request">72</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_text" translatable="yes">Indent</property>
- <child>
- <object class="GtkToolButton" id="ULSpacing">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="is_important">True</property>
- <property name="action_name">.uno:ULSpacing</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>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="sfxlo-NotebookbarToolBox" id="lrspacing">
- <property name="width_request">200</property>
- <property name="height_request">72</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_text" translatable="yes">Indent</property>
- <child>
- <object class="GtkToolButton" id="LeftRightParaMargin">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="is_important">True</property>
- <property name="action_name">.uno:LeftRightParaMargin</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>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <style>
- <class name="priority-3"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
diff --git a/sw/uiconfig/swriter/ui/pageorientationcontrol.ui b/sw/uiconfig/swriter/ui/pageorientationcontrol.ui
new file mode 100644
index 000000000000..d03aee7d0068
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/pageorientationcontrol.ui
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.10"/>
+ <object class="GtkImage" id="image_landscape">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">sw/res/sidebar/pageproppanel/Landscapecopy_24x24.png</property>
+ </object>
+ <object class="GtkImage" id="image_portrait">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">cmd/lc_orientation.png</property>
+ </object>
+ <object class="GtkWindow" id="PageOrientationControl">
+ <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="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="portrait">
+ <property name="label" translatable="yes">Portrait</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">image_portrait</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="landscape">
+ <property name="label" translatable="yes">Landscape</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Single</property>
+ <property name="image">image_landscape</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="always_show_image">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/sw/uiconfig/swriter/ui/sidebarpage.ui b/sw/uiconfig/swriter/ui/sidebarpage.ui
index 9c530999c472..a9f889309ef2 100644
--- a/sw/uiconfig/swriter/ui/sidebarpage.ui
+++ b/sw/uiconfig/swriter/ui/sidebarpage.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkGrid" id="PagePropertyPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -16,7 +17,7 @@
<property name="column_spacing">6</property>
<property name="column_homogeneous">True</property>
<child>
- <object class="GtkToolbar" id="selectorientation">
+ <object class="sfxlo-SidebarToolBox" id="selectorientation">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
@@ -27,9 +28,7 @@
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Orientation</property>
- <property name="use_action_appearance">False</property>
<property name="action_name">.uno:Orientation</property>
- <property name="label" translatable="no">toolbutton1</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -41,8 +40,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -57,9 +54,8 @@
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Size</property>
- <property name="use_action_appearance">False</property>
<property name="action_name">.uno:Size</property>
- <property name="label" translatable="no">toolbutton3</property>
+ <property name="label">toolbutton3</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -71,8 +67,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -88,9 +82,8 @@
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Columns</property>
- <property name="use_action_appearance">False</property>
<property name="action_name">.uno:Column</property>
- <property name="label" translatable="no">toolbutton4</property>
+ <property name="label">toolbutton4</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -102,8 +95,6 @@
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -118,9 +109,8 @@
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Margin</property>
- <property name="use_action_appearance">False</property>
<property name="action_name">.uno:Margin</property>
- <property name="label" translatable="no">toolbutton2</property>
+ <property name="label">toolbutton2</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -132,16 +122,12 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>