summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-10 14:52:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-10 21:54:21 +0100
commitdfcd3433dcadd724f950c5f79476f33fbaed50e2 (patch)
treed0913d15b35f3df99f52ba2ddf3b5d788d9e3b65 /sc
parente2737ee24afac3254d7cb533b5c7d42d136bf7b4 (diff)
weld CellAppearancePropertyPanel
Change-Id: I38aa9296cfca97f5208fca84c88a0966ed7ca13b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86562 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx176
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx48
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.cxx81
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.hxx26
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.cxx239
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.hxx26
-rw-r--r--sc/source/ui/sidebar/CellLineStyleValueSet.cxx26
-rw-r--r--sc/source/ui/sidebar/CellLineStyleValueSet.hxx6
-rw-r--r--sc/uiconfig/scalc/ui/floatingborderstyle.ui458
-rw-r--r--sc/uiconfig/scalc/ui/floatinglinestyle.ui82
-rw-r--r--sc/uiconfig/scalc/ui/sidebarcellappearance.ui33
11 files changed, 624 insertions, 577 deletions
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index d46275768db6..4f7868c112ec 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -21,6 +21,8 @@
#include <sc.hrc>
#include <bitmaps.hlst>
#include <sfx2/bindings.hxx>
+#include <sfx2/weldutils.hxx>
+#include <svtools/toolbarmenu.hxx>
#include <editeng/borderline.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/lineitem.hxx>
@@ -34,8 +36,8 @@
using namespace css;
using namespace css::uno;
-const char UNO_SETBORDERSTYLE[] = ".uno:SetBorderStyle";
-const char UNO_LINESTYLE[] = ".uno:LineStyle";
+const char SETBORDERSTYLE[] = "SetBorderStyle";
+const char LINESTYLE[] = "LineStyle";
// namespace open
@@ -45,7 +47,17 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
-: PanelLayout(pParent, "CellAppearancePropertyPanel", "modules/scalc/ui/sidebarcellappearance.ui", rxFrame),
+: PanelLayout(pParent, "CellAppearancePropertyPanel", "modules/scalc/ui/sidebarcellappearance.ui", rxFrame, true),
+
+ mxTBCellBorder(m_xBuilder->weld_toolbar("cellbordertype")),
+ mxTBCellBackground(m_xBuilder->weld_toolbar("cellbackgroundcolor")),
+ mxBackColorDispatch(new ToolbarUnoDispatcher(*mxTBCellBackground, rxFrame)),
+ mxTBLineStyle(m_xBuilder->weld_toolbar("borderlinestyle")),
+ mxTBLineColor(m_xBuilder->weld_toolbar("borderlinecolor")),
+ mxLineColorDispatch(new ToolbarUnoDispatcher(*mxTBLineColor, rxFrame)),
+
+ mbCellBorderPopoverCreated(false),
+ mbLinePopoverCreated(false),
maLineStyleControl(SID_FRAME_LINESTYLE, *pBindings, *this),
maBorderOuterControl(SID_ATTR_BORDER_OUTER, *pBindings, *this),
@@ -55,15 +67,16 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
maBorderBLTRControl(SID_ATTR_BORDER_DIAG_BLTR, *pBindings, *this),
maIMGCellBorder(StockImage::Yes, RID_BMP_CELL_BORDER),
- maIMGLineStyle1(StockImage::Yes, RID_BMP_LINE_STYLE1),
- maIMGLineStyle2(StockImage::Yes, RID_BMP_LINE_STYLE2),
- maIMGLineStyle3(StockImage::Yes, RID_BMP_LINE_STYLE3),
- maIMGLineStyle4(StockImage::Yes, RID_BMP_LINE_STYLE4),
- maIMGLineStyle5(StockImage::Yes, RID_BMP_LINE_STYLE5),
- maIMGLineStyle6(StockImage::Yes, RID_BMP_LINE_STYLE6),
- maIMGLineStyle7(StockImage::Yes, RID_BMP_LINE_STYLE7),
- maIMGLineStyle8(StockImage::Yes, RID_BMP_LINE_STYLE8),
- maIMGLineStyle9(StockImage::Yes, RID_BMP_LINE_STYLE9),
+ msIMGCellBorder(RID_BMP_CELL_BORDER),
+ msIMGLineStyle1(RID_BMP_LINE_STYLE1),
+ msIMGLineStyle2(RID_BMP_LINE_STYLE2),
+ msIMGLineStyle3(RID_BMP_LINE_STYLE3),
+ msIMGLineStyle4(RID_BMP_LINE_STYLE4),
+ msIMGLineStyle5(RID_BMP_LINE_STYLE5),
+ msIMGLineStyle6(RID_BMP_LINE_STYLE6),
+ msIMGLineStyle7(RID_BMP_LINE_STYLE7),
+ msIMGLineStyle8(RID_BMP_LINE_STYLE8),
+ msIMGLineStyle9(RID_BMP_LINE_STYLE9),
mnInWidth(0),
mnOutWidth(0),
@@ -85,15 +98,9 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
mbInnerBorder(false),
mbDiagTLBR(false),
mbDiagBLTR(false),
- mxCellLineStylePopup(),
- mxCellBorderStylePopup(),
maContext(),
mpBindings(pBindings)
{
- get(mpTBCellBorder, "cellbordertype");
- get(mpTBLineStyle, "borderlinestyle");
- get(mpTBLineColor, "borderlinecolor");
-
Initialize();
}
@@ -104,12 +111,15 @@ CellAppearancePropertyPanel::~CellAppearancePropertyPanel()
void CellAppearancePropertyPanel::dispose()
{
- mpTBCellBorder.clear();
- mpTBLineStyle.clear();
- mpTBLineColor.clear();
+ mxCellBorderPopoverContainer.reset();
+ mxTBCellBorder.reset();
+ mxBackColorDispatch.reset();
+ mxTBCellBackground.reset();
+ mxLinePopoverContainer.reset();
+ mxTBLineStyle.reset();
+ mxLineColorDispatch.reset();
+ mxTBLineColor.reset();
- mxCellBorderStylePopup.disposeAndClear();
- mxCellLineStylePopup.disposeAndClear();
maLineStyleControl.dispose();
maBorderOuterControl.dispose();
maBorderInnerControl.dispose();
@@ -122,47 +132,56 @@ void CellAppearancePropertyPanel::dispose()
void CellAppearancePropertyPanel::Initialize()
{
- const sal_uInt16 nIdBorderType = mpTBCellBorder->GetItemId( UNO_SETBORDERSTYLE );
- mpTBCellBorder->SetItemImage( nIdBorderType, maIMGCellBorder );
- mpTBCellBorder->SetItemBits( nIdBorderType, mpTBCellBorder->GetItemBits( nIdBorderType ) | ToolBoxItemBits::DROPDOWNONLY );
- Link<ToolBox *, void> aLink = LINK(this, CellAppearancePropertyPanel, TbxCellBorderSelectHdl);
- mpTBCellBorder->SetDropdownClickHdl ( aLink );
- mpTBCellBorder->SetSelectHdl ( aLink );
-
- const sal_uInt16 nIdBorderLineStyle = mpTBLineStyle->GetItemId( UNO_LINESTYLE );
- mpTBLineStyle->SetItemImage( nIdBorderLineStyle, maIMGLineStyle1 );
- mpTBLineStyle->SetItemBits( nIdBorderLineStyle, mpTBLineStyle->GetItemBits( nIdBorderLineStyle ) | ToolBoxItemBits::DROPDOWNONLY );
- aLink = LINK(this, CellAppearancePropertyPanel, TbxLineStyleSelectHdl);
- mpTBLineStyle->SetDropdownClickHdl ( aLink );
- mpTBLineStyle->SetSelectHdl ( aLink );
- mpTBLineStyle->Disable();
-
- mpTBLineColor->Disable();
+ mxTBCellBorder->set_item_icon_name(SETBORDERSTYLE, msIMGCellBorder);
+ mxCellBorderPopoverContainer.reset(new ToolbarPopupContainer(mxTBCellBorder.get()));
+ mxTBCellBorder->set_item_popover(SETBORDERSTYLE, mxCellBorderPopoverContainer->getTopLevel());
+ mxTBCellBorder->connect_clicked(LINK(this, CellAppearancePropertyPanel, TbxCellBorderSelectHdl));
+ mxTBCellBorder->connect_menu_toggled(LINK(this, CellAppearancePropertyPanel, TbxCellBorderMenuHdl));
+
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle1);
+ mxLinePopoverContainer.reset(new ToolbarPopupContainer(mxTBLineStyle.get()));
+ mxTBLineStyle->set_item_popover(LINESTYLE, mxLinePopoverContainer->getTopLevel());
+ mxTBLineStyle->connect_clicked(LINK(this, CellAppearancePropertyPanel, TbxLineStyleSelectHdl));
+ mxTBLineStyle->connect_menu_toggled(LINK(this, CellAppearancePropertyPanel, TbxLineStyleMenuHdl));
+ mxTBLineStyle->set_sensitive(false);
+
+ mxTBLineColor->set_sensitive(false);
}
-IMPL_LINK(CellAppearancePropertyPanel, TbxCellBorderSelectHdl, ToolBox*, pToolBox, void)
+IMPL_LINK_NOARG(CellAppearancePropertyPanel, TbxCellBorderSelectHdl, const OString&, void)
{
- const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
+ mxTBCellBorder->set_menu_item_active(SETBORDERSTYLE, !mxTBCellBorder->get_menu_item_active(SETBORDERSTYLE));
+}
- if (aCommand == UNO_SETBORDERSTYLE)
+IMPL_LINK_NOARG(CellAppearancePropertyPanel, TbxCellBorderMenuHdl, const OString&, void)
+{
+ if (!mxTBCellBorder->get_menu_item_active(SETBORDERSTYLE))
+ return;
+ if (!mbCellBorderPopoverCreated)
{
- if (!mxCellBorderStylePopup)
- mxCellBorderStylePopup = VclPtr<CellBorderStylePopup>::Create(GetBindings()->GetDispatcher());
- mxCellBorderStylePopup->StartPopupMode(pToolBox, FloatWinPopupFlags::GrabFocus);
+ mxCellBorderPopoverContainer->setPopover(std::make_unique<CellBorderStylePopup>(mxTBCellBorder.get(), SETBORDERSTYLE, GetBindings()->GetDispatcher()));
+ mbCellBorderPopoverCreated = true;
}
+ mxCellBorderPopoverContainer->getPopover()->GrabFocus();
}
-IMPL_LINK(CellAppearancePropertyPanel, TbxLineStyleSelectHdl, ToolBox*, pToolBox, void)
+IMPL_LINK_NOARG(CellAppearancePropertyPanel, TbxLineStyleSelectHdl, const OString&, void)
{
- const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId()));
+ mxTBLineStyle->set_menu_item_active(LINESTYLE, !mxTBLineStyle->get_menu_item_active(LINESTYLE));
+}
- if (aCommand == UNO_LINESTYLE)
+IMPL_LINK_NOARG(CellAppearancePropertyPanel, TbxLineStyleMenuHdl, const OString&, void)
+{
+ if (!mxTBLineStyle->get_menu_item_active(LINESTYLE))
+ return;
+ if (!mbLinePopoverCreated)
{
- if (!mxCellLineStylePopup)
- mxCellLineStylePopup = VclPtr<CellLineStylePopup>::Create(GetBindings()->GetDispatcher());
- mxCellLineStylePopup->SetLineStyleSelect(mnOutWidth, mnInWidth, mnDistance);
- mxCellLineStylePopup->StartPopupMode(pToolBox, FloatWinPopupFlags::GrabFocus);
+ mxLinePopoverContainer->setPopover(std::make_unique<CellLineStylePopup>(mxTBLineStyle.get(), LINESTYLE, GetBindings()->GetDispatcher()));
+ mbLinePopoverCreated = true;
}
+ auto pPopup = static_cast<CellLineStylePopup*>(mxLinePopoverContainer->getPopover());
+ pPopup->SetLineStyleSelect(mnOutWidth, mnInWidth, mnDistance);
+ pPopup->GrabFocus();
}
VclPtr<vcl::Window> CellAppearancePropertyPanel::Create (
@@ -363,37 +382,35 @@ void CellAppearancePropertyPanel::NotifyItemUpdate(
void CellAppearancePropertyPanel::SetStyleIcon()
{
- const sal_uInt16 nIdBorderLineStyle = mpTBLineStyle->GetItemId( UNO_LINESTYLE );
-
//FIXME: update for new line border possibilities
if(mnOutWidth == DEF_LINE_WIDTH_0 && mnInWidth == 0 && mnDistance == 0) //1
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle1);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle1);
else if(mnOutWidth == DEF_LINE_WIDTH_2 && mnInWidth == 0 && mnDistance == 0) //2
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle2);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle2);
else if(mnOutWidth == DEF_LINE_WIDTH_3 && mnInWidth == 0 && mnDistance == 0) //3
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle3);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle3);
else if(mnOutWidth == DEF_LINE_WIDTH_4 && mnInWidth == 0 && mnDistance == 0) //4
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle4);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle4);
else if(mnOutWidth == DEF_LINE_WIDTH_0 && mnInWidth == DEF_LINE_WIDTH_0 && mnDistance == DEF_LINE_WIDTH_1) //5
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle5);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle5);
else if(mnOutWidth == DEF_LINE_WIDTH_0 && mnInWidth == DEF_LINE_WIDTH_0 && mnDistance == DEF_LINE_WIDTH_2) //6
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle6);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle6);
else if(mnOutWidth == DEF_LINE_WIDTH_1 && mnInWidth == DEF_LINE_WIDTH_2 && mnDistance == DEF_LINE_WIDTH_1) //7
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle7);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle7);
else if(mnOutWidth == DEF_LINE_WIDTH_2 && mnInWidth == DEF_LINE_WIDTH_0 && mnDistance == DEF_LINE_WIDTH_2) //8
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle8);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle8);
else if(mnOutWidth == DEF_LINE_WIDTH_2 && mnInWidth == DEF_LINE_WIDTH_2 && mnDistance == DEF_LINE_WIDTH_2) //9
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle9);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle9);
else
- mpTBLineStyle->SetItemImage(nIdBorderLineStyle, maIMGLineStyle1);
+ mxTBLineStyle->set_item_icon_name(LINESTYLE, msIMGLineStyle1);
}
void CellAppearancePropertyPanel::UpdateControlState()
{
if(mbOuterBorder || mbInnerBorder || mbDiagTLBR || mbDiagBLTR)
{
- mpTBLineColor->Enable();
- mpTBLineStyle->Enable();
+ mxTBLineColor->set_sensitive(true);
+ mxTBLineStyle->set_sensitive(true);
//set line style state
if( mbBorderStyleAvailable && !mbDiagTLBR && !mbDiagBLTR )
@@ -454,8 +471,8 @@ void CellAppearancePropertyPanel::UpdateControlState()
}
else
{
- mpTBLineColor->Disable();
- mpTBLineStyle->Disable();
+ mxTBLineColor->set_sensitive(false);
+ mxTBLineStyle->set_sensitive(false);
}
}
@@ -463,18 +480,13 @@ void CellAppearancePropertyPanel::UpdateCellBorder(bool bTop, bool bBot, bool bL
{
const Size aBmpSize = maIMGCellBorder.GetBitmapEx().GetSizePixel();
- ScopedVclPtr<VirtualDevice> pVirDev(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(),
- DeviceFormat::DEFAULT, DeviceFormat::DEFAULT));
- pVirDev->SetOutputSizePixel(aBmpSize);
- pVirDev->SetBackground(COL_TRANSPARENT);
- pVirDev->Erase();
- pVirDev->SetLineColor( ::Application::GetSettings().GetStyleSettings().GetFieldTextColor() ) ;
- pVirDev->SetFillColor(COL_BLACK);
-
- const int btnId = mpTBCellBorder->GetItemId( UNO_SETBORDERSTYLE );
-
- if(aBmpSize.Width() == 43 && aBmpSize.Height() == 43)
+ if (aBmpSize.Width() == 43 && aBmpSize.Height() == 43)
{
+ ScopedVclPtr<VirtualDevice> pVirDev(mxTBCellBorder->create_virtual_device());
+ pVirDev->SetOutputSizePixel(aBmpSize);
+ pVirDev->SetLineColor( ::Application::GetSettings().GetStyleSettings().GetFieldTextColor() ) ;
+ pVirDev->SetFillColor(COL_BLACK);
+ pVirDev->DrawImage(Point(0, 0), maIMGCellBorder);
Point aTL(2, 1), aTR(42,1), aBL(2, 41), aBR(42, 41), aHL(2,21), aHR(42, 21), aVT(22,1), aVB(22, 41);
if(bLeft)
pVirDev->DrawLine( aTL,aBL );
@@ -488,10 +500,10 @@ void CellAppearancePropertyPanel::UpdateCellBorder(bool bTop, bool bBot, bool bL
pVirDev->DrawLine( aVT,aVB );
if(bHor)
pVirDev->DrawLine( aHL,aHR );
- mpTBCellBorder->SetItemOverlayImage( btnId, Image( pVirDev->GetBitmapEx(Point(0,0), aBmpSize) ) );
+ mxTBCellBorder->set_item_image(SETBORDERSTYLE, pVirDev);
}
-
- mpTBCellBorder->SetItemImage( btnId, maIMGCellBorder );
+ else
+ mxTBCellBorder->set_item_icon_name(SETBORDERSTYLE, msIMGCellBorder);
}
// namespace close
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index 006e0b03700c..f23565ac6d07 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -27,6 +27,9 @@
#include "CellBorderStyleControl.hxx"
#include "CellLineStyleControl.hxx"
+class ToolbarUnoDispatcher;
+class ToolbarPopupContainer;
+
namespace sc { namespace sidebar {
class CellAppearancePropertyPanel
@@ -68,9 +71,17 @@ public:
private:
//ui controls
- VclPtr<ToolBox> mpTBCellBorder;
- VclPtr<ToolBox> mpTBLineStyle;
- VclPtr<ToolBox> mpTBLineColor;
+ std::unique_ptr<ToolbarPopupContainer> mxCellBorderPopoverContainer;
+ std::unique_ptr<weld::Toolbar> mxTBCellBorder;
+ std::unique_ptr<weld::Toolbar> mxTBCellBackground;
+ std::unique_ptr<ToolbarUnoDispatcher> mxBackColorDispatch;
+ std::unique_ptr<ToolbarPopupContainer> mxLinePopoverContainer;
+ std::unique_ptr<weld::Toolbar> mxTBLineStyle;
+ std::unique_ptr<weld::Toolbar> mxTBLineColor;
+ std::unique_ptr<ToolbarUnoDispatcher> mxLineColorDispatch;
+
+ bool mbCellBorderPopoverCreated;
+ bool mbLinePopoverCreated;
::sfx2::sidebar::ControllerItem maLineStyleControl;
::sfx2::sidebar::ControllerItem maBorderOuterControl;
@@ -80,16 +91,17 @@ private:
::sfx2::sidebar::ControllerItem maBorderBLTRControl;
// images
- Image const maIMGCellBorder;
- Image const maIMGLineStyle1;
- Image const maIMGLineStyle2;
- Image const maIMGLineStyle3;
- Image const maIMGLineStyle4;
- Image const maIMGLineStyle5;
- Image const maIMGLineStyle6;
- Image const maIMGLineStyle7;
- Image const maIMGLineStyle8;
- Image const maIMGLineStyle9;
+ Image maIMGCellBorder;
+ OUString msIMGCellBorder;
+ OUString msIMGLineStyle1;
+ OUString msIMGLineStyle2;
+ OUString msIMGLineStyle3;
+ OUString msIMGLineStyle4;
+ OUString msIMGLineStyle5;
+ OUString msIMGLineStyle6;
+ OUString msIMGLineStyle7;
+ OUString msIMGLineStyle8;
+ OUString msIMGLineStyle9;
// BorderStyle defines
sal_uInt16 mnInWidth;
@@ -118,15 +130,13 @@ private:
bool mbDiagTLBR : 1;
bool mbDiagBLTR : 1;
- // popups
- VclPtr<CellLineStylePopup> mxCellLineStylePopup;
- VclPtr<CellBorderStylePopup> mxCellBorderStylePopup;
-
vcl::EnumContext maContext;
SfxBindings* const mpBindings;
- DECL_LINK(TbxCellBorderSelectHdl, ToolBox*, void);
- DECL_LINK(TbxLineStyleSelectHdl, ToolBox*, void);
+ DECL_LINK(TbxCellBorderSelectHdl, const OString&, void);
+ DECL_LINK(TbxCellBorderMenuHdl, const OString&, void);
+ DECL_LINK(TbxLineStyleSelectHdl, const OString&, void);
+ DECL_LINK(TbxLineStyleMenuHdl, const OString&, void);
void Initialize();
void SetStyleIcon();
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index 48bc135173a0..e563073d7f72 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -39,50 +39,46 @@ namespace sc { namespace sidebar {
#define FRM_VALID_OUTER 0x0f
#define FRM_VALID_ALL 0xff
-CellBorderStylePopup::CellBorderStylePopup(SfxDispatcher* pDispatcher)
- : FloatingWindow(SfxGetpApp()->GetTopWindow(), "FloatingBorderStyle", "modules/scalc/ui/floatingborderstyle.ui")
+CellBorderStylePopup::CellBorderStylePopup(weld::Toolbar* pParent, const OString& rId, SfxDispatcher* pDispatcher)
+ : WeldToolbarPopup(nullptr, pParent, "modules/scalc/ui/floatingborderstyle.ui", "FloatingBorderStyle")
+ , maToolButton(pParent, rId)
, mpDispatcher(pDispatcher)
+ , mxTBBorder1(m_xBuilder->weld_toolbar("border1"))
+ , mxTBBorder2(m_xBuilder->weld_toolbar("border2"))
+ , mxTBBorder3(m_xBuilder->weld_toolbar("border3"))
+ , mxTBBorder4(m_xBuilder->weld_toolbar("border4"))
{
- get(maTBBorder1, "border1");
- get(maTBBorder2, "border2");
- get(maTBBorder3, "border3");
Initialize();
}
-CellBorderStylePopup::~CellBorderStylePopup()
+void CellBorderStylePopup::GrabFocus()
{
- disposeOnce();
+ mxTBBorder1->grab_focus();
}
-void CellBorderStylePopup::dispose()
+CellBorderStylePopup::~CellBorderStylePopup()
{
- maTBBorder1.clear();
- maTBBorder2.clear();
- maTBBorder3.clear();
- FloatingWindow::dispose();
}
void CellBorderStylePopup::Initialize()
{
- maTBBorder1->SetSelectHdl ( LINK(this, CellBorderStylePopup, TB1SelectHdl) );
+ mxTBBorder1->connect_clicked ( LINK(this, CellBorderStylePopup, TB1SelectHdl) );
- maTBBorder2->SetLineCount(2);
- maTBBorder2->InsertBreak(4);
- maTBBorder2->SetSelectHdl ( LINK(this, CellBorderStylePopup, TB2SelectHdl) );
+ mxTBBorder2->connect_clicked ( LINK(this, CellBorderStylePopup, TB2and3SelectHdl) );
+ mxTBBorder3->connect_clicked ( LINK(this, CellBorderStylePopup, TB2and3SelectHdl) );
- maTBBorder3->SetSelectHdl ( LINK(this, CellBorderStylePopup, TB3SelectHdl) );
+ mxTBBorder4->connect_clicked ( LINK(this, CellBorderStylePopup, TB4SelectHdl) );
}
-IMPL_LINK(CellBorderStylePopup, TB1SelectHdl, ToolBox*, pToolBox, void)
+IMPL_LINK(CellBorderStylePopup, TB1SelectHdl, const OString&, rId, void)
{
- sal_uInt16 nId = pToolBox->GetCurItemId();
SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER );
editeng::SvxBorderLine theDefLine(nullptr, 1);
editeng::SvxBorderLine *pLeft = nullptr, *pRight = nullptr, *pTop = nullptr, *pBottom = nullptr;
sal_uInt8 nValidFlags = 0;
- if (nId == maTBBorder1->GetItemId("none"))
+ if (rId == "none")
{
nValidFlags |= FRM_VALID_ALL;
SvxLineItem aLineItem1( SID_ATTR_BORDER_DIAG_BLTR );
@@ -94,19 +90,19 @@ IMPL_LINK(CellBorderStylePopup, TB1SelectHdl, ToolBox*, pToolBox, void)
mpDispatcher->ExecuteList(
SID_ATTR_BORDER_DIAG_TLBR, SfxCallMode::RECORD, { &aLineItem2 });
}
- else if (nId == maTBBorder1->GetItemId("all"))
+ else if (rId == "all")
{
pLeft = pRight = pTop = pBottom = &theDefLine;
aBorderInner.SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
aBorderInner.SetLine( &theDefLine, SvxBoxInfoItemLine::VERT );
nValidFlags |= FRM_VALID_ALL;
}
- else if (nId == maTBBorder1->GetItemId("outside"))
+ else if (rId == "outside")
{
pLeft = pRight = pTop = pBottom = &theDefLine;
nValidFlags |= FRM_VALID_OUTER;
}
- else if (nId == maTBBorder1->GetItemId("thickbox"))
+ else if (rId == "thickbox")
{
theDefLine.SetWidth(DEF_LINE_WIDTH_2);
pLeft = pRight = pTop = pBottom = &theDefLine;
@@ -129,14 +125,13 @@ IMPL_LINK(CellBorderStylePopup, TB1SelectHdl, ToolBox*, pToolBox, void)
mpDispatcher->ExecuteList(
SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner });
- EndPopupMode();
+
+ maToolButton.set_inactive();
}
-IMPL_LINK(CellBorderStylePopup, TB2SelectHdl, ToolBox *, pToolBox, void)
+IMPL_LINK(CellBorderStylePopup, TB2and3SelectHdl, const OString&, rId, void)
{
- sal_uInt16 nId = pToolBox->GetCurItemId();
-
- if (nId == pToolBox->GetItemId("diagup"))
+ if (rId == "diagup")
{
editeng::SvxBorderLine aTmp( nullptr, 1 );
SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_BLTR );
@@ -144,7 +139,7 @@ IMPL_LINK(CellBorderStylePopup, TB2SelectHdl, ToolBox *, pToolBox, void)
mpDispatcher->ExecuteList(
SID_ATTR_BORDER_DIAG_BLTR, SfxCallMode::RECORD, { &aLineItem });
}
- else if (nId == pToolBox->GetItemId("diagdown"))
+ else if (rId == "diagdown")
{
editeng::SvxBorderLine aTmp( nullptr, 1 );
SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_TLBR );
@@ -162,12 +157,12 @@ IMPL_LINK(CellBorderStylePopup, TB2SelectHdl, ToolBox *, pToolBox, void)
*pTop = nullptr,
*pBottom = nullptr;
sal_uInt8 nValidFlags = 0;
- if (nId == pToolBox->GetItemId("left"))
+ if (rId == "left")
{
pLeft = &theDefLine;
nValidFlags |= FRM_VALID_LEFT;
}
- else if (nId == pToolBox->GetItemId("right"))
+ else if (rId == "right")
{
if(!AllSettings::GetLayoutRTL())
{
@@ -180,22 +175,22 @@ IMPL_LINK(CellBorderStylePopup, TB2SelectHdl, ToolBox *, pToolBox, void)
nValidFlags |= FRM_VALID_LEFT;
}
}
- else if (nId == pToolBox->GetItemId("top"))
+ else if (rId == "top")
{
pTop = &theDefLine;
nValidFlags |= FRM_VALID_TOP;
}
- else if (nId == pToolBox->GetItemId("bottom"))
+ else if (rId == "bottom")
{
pBottom = &theDefLine;
nValidFlags |= FRM_VALID_BOTTOM;
}
- else if (nId == pToolBox->GetItemId("topbottom"))
+ else if (rId == "topbottom")
{
pTop = pBottom = &theDefLine;
nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP;
}
- else if (nId == pToolBox->GetItemId("leftright"))
+ else if (rId == "leftright")
{
pLeft = pRight = &theDefLine;
nValidFlags |= FRM_VALID_RIGHT|FRM_VALID_LEFT;
@@ -218,13 +213,11 @@ IMPL_LINK(CellBorderStylePopup, TB2SelectHdl, ToolBox *, pToolBox, void)
SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner});
}
- EndPopupMode();
+ maToolButton.set_inactive();
}
-IMPL_LINK(CellBorderStylePopup, TB3SelectHdl, ToolBox *, pToolBox, void)
+IMPL_LINK(CellBorderStylePopup, TB4SelectHdl, const OString&, rId, void)
{
- sal_uInt16 nId = pToolBox->GetCurItemId();
-
SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER );
std::unique_ptr<editeng::SvxBorderLine> pTop;
@@ -234,24 +227,24 @@ IMPL_LINK(CellBorderStylePopup, TB3SelectHdl, ToolBox *, pToolBox, void)
//FIXME: properly adapt to new line border model
- if (nId == maTBBorder3->GetItemId("thickbottom"))
+ if (rId == "thickbottom")
{
pBottom.reset(new editeng::SvxBorderLine(nullptr, DEF_LINE_WIDTH_2 ));
nValidFlags |= FRM_VALID_BOTTOM;
}
- else if (nId == maTBBorder3->GetItemId("doublebottom"))
+ else if (rId == "doublebottom")
{
pBottom.reset(new editeng::SvxBorderLine(nullptr));
pBottom->GuessLinesWidths(SvxBorderLineStyle::DOUBLE, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_1);
nValidFlags |= FRM_VALID_BOTTOM;
}
- else if (nId == maTBBorder3->GetItemId("topthickbottom"))
+ else if (rId == "topthickbottom")
{
pBottom.reset(new editeng::SvxBorderLine(nullptr, DEF_LINE_WIDTH_2 ));
pTop.reset(new editeng::SvxBorderLine(nullptr, 1));
nValidFlags |= FRM_VALID_BOTTOM|FRM_VALID_TOP;
}
- else if (nId == maTBBorder3->GetItemId("topdoublebottom"))
+ else if (rId == "topdoublebottom")
{
pBottom.reset(new editeng::SvxBorderLine(nullptr));
pBottom->GuessLinesWidths(SvxBorderLineStyle::DOUBLE, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_1);
@@ -279,7 +272,7 @@ IMPL_LINK(CellBorderStylePopup, TB3SelectHdl, ToolBox *, pToolBox, void)
pTop.reset();
pBottom.reset();
- EndPopupMode();
+ maToolButton.set_inactive();
}
} } // end of namespace svx::sidebar
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.hxx b/sc/source/ui/sidebar/CellBorderStyleControl.hxx
index 3e413265bc1b..7602f52b6fb5 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.hxx
@@ -19,31 +19,33 @@
#ifndef INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLBORDERSTYLECONTROL_HXX
#define INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLBORDERSTYLECONTROL_HXX
-#include <vcl/floatwin.hxx>
-#include <vcl/toolbox.hxx>
+#include <svtools/toolbarmenu.hxx>
+#include <svx/colorwindow.hxx>
class SfxDispatcher;
namespace sc { namespace sidebar {
-class CellBorderStylePopup : public FloatingWindow
+class CellBorderStylePopup : public WeldToolbarPopup
{
private:
- SfxDispatcher* mpDispatcher;
- VclPtr<ToolBox> maTBBorder1;
- VclPtr<ToolBox> maTBBorder2;
- VclPtr<ToolBox> maTBBorder3;
+ MenuOrToolMenuButton maToolButton;
+ SfxDispatcher* mpDispatcher;
+ std::unique_ptr<weld::Toolbar> mxTBBorder1;
+ std::unique_ptr<weld::Toolbar> mxTBBorder2;
+ std::unique_ptr<weld::Toolbar> mxTBBorder3;
+ std::unique_ptr<weld::Toolbar> mxTBBorder4;
void Initialize();
- DECL_LINK(TB1SelectHdl, ToolBox *, void);
- DECL_LINK(TB2SelectHdl, ToolBox *, void);
- DECL_LINK(TB3SelectHdl, ToolBox *, void);
+ DECL_LINK(TB1SelectHdl, const OString&, void);
+ DECL_LINK(TB2and3SelectHdl, const OString&, void);
+ DECL_LINK(TB4SelectHdl, const OString&, void);
public:
- explicit CellBorderStylePopup(SfxDispatcher* pDispatcher);
+ CellBorderStylePopup(weld::Toolbar* pParent, const OString& rId, SfxDispatcher* pDispatcher);
+ virtual void GrabFocus() override;
virtual ~CellBorderStylePopup() override;
- virtual void dispose() override;
};
} } // end of namespace svx::sidebar
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index 8c9092f33fb4..7139ca23dde4 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -21,6 +21,7 @@
#include "CellLineStyleValueSet.hxx"
#include <vcl/i18nhelp.hxx>
#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
#include <editeng/borderline.hxx>
#include <editeng/lineitem.hxx>
#include <sfx2/app.hxx>
@@ -30,204 +31,192 @@
namespace sc { namespace sidebar {
-CellLineStylePopup::CellLineStylePopup(SfxDispatcher* pDispatcher)
- : FloatingWindow(SfxGetpApp()->GetTopWindow(), "FloatingLineStyle", "modules/scalc/ui/floatinglinestyle.ui")
+CellLineStylePopup::CellLineStylePopup(weld::Toolbar* pParent, const OString& rId, SfxDispatcher* pDispatcher)
+ : WeldToolbarPopup(nullptr, pParent, "modules/scalc/ui/floatinglinestyle.ui", "FloatingLineStyle")
+ , maToolButton(pParent, rId)
, mpDispatcher(pDispatcher)
- , maCellLineStyleValueSet(VclPtr<sc::sidebar::CellLineStyleValueSet>::Create(get<vcl::Window>("box")))
+ , mxCellLineStyleValueSet(new sc::sidebar::CellLineStyleValueSet)
+ , mxCellLineStyleValueSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxCellLineStyleValueSet))
+ , mxPushButtonMoreOptions(m_xBuilder->weld_button("more"))
{
- get(maPushButtonMoreOptions, "more");
Initialize();
}
CellLineStylePopup::~CellLineStylePopup()
{
- disposeOnce();
-}
-
-void CellLineStylePopup::dispose()
-{
- maPushButtonMoreOptions.clear();
- maCellLineStyleValueSet.disposeAndClear();
- FloatingWindow::dispose();
}
void CellLineStylePopup::Initialize()
{
- Link<Button*,void> aLink = LINK(this, CellLineStylePopup, PBClickHdl);
- maPushButtonMoreOptions->SetClickHdl(aLink);
+ mxPushButtonMoreOptions->connect_clicked(LINK(this, CellLineStylePopup, PBClickHdl));
- maCellLineStyleValueSet->SetStyle(maCellLineStyleValueSet->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT);
- maCellLineStyleValueSet->SetControlBackground(GetSettings().GetStyleSettings().GetMenuColor());
- maCellLineStyleValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+ mxCellLineStyleValueSet->SetStyle(mxCellLineStyleValueSet->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT);
for(sal_uInt16 i = 1 ; i <= 9 ; i++)
{
- maCellLineStyleValueSet->InsertItem(i);
+ mxCellLineStyleValueSet->InsertItem(i);
}
- maStr[0] = GetSettings().GetLocaleI18nHelper().GetNum( 5, 2 ) + "pt";
- maStr[1] = GetSettings().GetLocaleI18nHelper().GetNum( 250, 2 ) + "pt";
- maStr[2] = GetSettings().GetLocaleI18nHelper().GetNum( 400, 2 ) + "pt";
- maStr[3] = GetSettings().GetLocaleI18nHelper().GetNum( 500, 2 ) + "pt";
- maStr[4] = GetSettings().GetLocaleI18nHelper().GetNum( 110, 2 ) + "pt";
- maStr[5] = GetSettings().GetLocaleI18nHelper().GetNum( 260, 2 ) + "pt";
- maStr[6] = GetSettings().GetLocaleI18nHelper().GetNum( 450, 2 ) + "pt";
- maStr[7] = GetSettings().GetLocaleI18nHelper().GetNum( 505, 2 ) + "pt";
- maStr[8] = GetSettings().GetLocaleI18nHelper().GetNum( 750, 2 ) + "pt";
- maCellLineStyleValueSet->SetUnit(&maStr[0]);
+
+ const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper();
+ maStr[0] = rI18nHelper.GetNum( 5, 2 ) + "pt";
+ maStr[1] = rI18nHelper.GetNum( 250, 2 ) + "pt";
+ maStr[2] = rI18nHelper.GetNum( 400, 2 ) + "pt";
+ maStr[3] = rI18nHelper.GetNum( 500, 2 ) + "pt";
+ maStr[4] = rI18nHelper.GetNum( 110, 2 ) + "pt";
+ maStr[5] = rI18nHelper.GetNum( 260, 2 ) + "pt";
+ maStr[6] = rI18nHelper.GetNum( 450, 2 ) + "pt";
+ maStr[7] = rI18nHelper.GetNum( 505, 2 ) + "pt";
+ maStr[8] = rI18nHelper.GetNum( 750, 2 ) + "pt";
+ mxCellLineStyleValueSet->SetUnit(&maStr[0]);
for (sal_uInt16 i = 1; i <= CELL_LINE_STYLE_ENTRIES; ++i)
{
- maCellLineStyleValueSet->SetItemText(i, maStr[i-1]);
+ mxCellLineStyleValueSet->SetItemText(i, maStr[i-1]);
}
SetAllNoSel();
- maCellLineStyleValueSet->SetSelectHdl(LINK(this, CellLineStylePopup, VSSelectHdl));
- maCellLineStyleValueSet->StartSelection();
- maCellLineStyleValueSet->Show();
+ mxCellLineStyleValueSet->SetSelectHdl(LINK(this, CellLineStylePopup, VSSelectHdl));
+}
+
+void CellLineStylePopup::GrabFocus()
+{
+ mxCellLineStyleValueSet->GrabFocus();
}
void CellLineStylePopup::SetAllNoSel()
{
- maCellLineStyleValueSet->SelectItem(0);
- maCellLineStyleValueSet->SetNoSelection();
- maCellLineStyleValueSet->SetFormat();
- maCellLineStyleValueSet->Invalidate();
- Invalidate();
- maCellLineStyleValueSet->StartSelection();
+ mxCellLineStyleValueSet->SelectItem(0);
+ mxCellLineStyleValueSet->SetNoSelection();
+ mxCellLineStyleValueSet->SetFormat();
+ mxCellLineStyleValueSet->Invalidate();
}
-IMPL_LINK(CellLineStylePopup, VSSelectHdl, ValueSet*, pControl, void)
+IMPL_LINK_NOARG(CellLineStylePopup, VSSelectHdl, SvtValueSet*, void)
{
- if(pControl == maCellLineStyleValueSet.get())
+ const sal_uInt16 iPos(mxCellLineStyleValueSet->GetSelectedItemId());
+ SvxLineItem aLineItem(SID_FRAME_LINESTYLE);
+ SvxBorderLineStyle nStyle = SvxBorderLineStyle::SOLID;
+ sal_uInt16 n1 = 0;
+ sal_uInt16 n2 = 0;
+ sal_uInt16 n3 = 0;
+
+ //FIXME: fully for new border line possibilities
+
+ switch(iPos)
{
- const sal_uInt16 iPos(maCellLineStyleValueSet->GetSelectedItemId());
- SvxLineItem aLineItem(SID_FRAME_LINESTYLE);
- SvxBorderLineStyle nStyle = SvxBorderLineStyle::SOLID;
- sal_uInt16 n1 = 0;
- sal_uInt16 n2 = 0;
- sal_uInt16 n3 = 0;
-
- //FIXME: fully for new border line possibilities
-
- switch(iPos)
- {
- case 1:
- n1 = DEF_LINE_WIDTH_0;
- break;
- case 2:
- n1 = DEF_LINE_WIDTH_2;
- break;
- case 3:
- n1 = DEF_LINE_WIDTH_3;
- break;
- case 4:
- n1 = DEF_LINE_WIDTH_4;
- break;
- case 5:
- n1 = DEF_LINE_WIDTH_0;
- n2 = DEF_LINE_WIDTH_0;
- n3 = DEF_LINE_WIDTH_1;
- nStyle = SvxBorderLineStyle::DOUBLE;
- break;
- case 6:
- n1 = DEF_LINE_WIDTH_0;
- n2 = DEF_LINE_WIDTH_0;
- n3 = DEF_LINE_WIDTH_2;
- nStyle = SvxBorderLineStyle::DOUBLE;
- break;
- case 7:
- n1 = DEF_LINE_WIDTH_1;
- n2 = DEF_LINE_WIDTH_2;
- n3 = DEF_LINE_WIDTH_1;
- nStyle = SvxBorderLineStyle::DOUBLE;
- break;
- case 8:
- n1 = DEF_LINE_WIDTH_2;
- n2 = DEF_LINE_WIDTH_0;
- n3 = DEF_LINE_WIDTH_2;
- nStyle = SvxBorderLineStyle::DOUBLE;
- break;
- case 9:
- n1 = DEF_LINE_WIDTH_2;
- n2 = DEF_LINE_WIDTH_2;
- n3 = DEF_LINE_WIDTH_2;
- nStyle = SvxBorderLineStyle::DOUBLE;
- break;
- default:
- break;
- }
-
- editeng::SvxBorderLine aTmp;
- aTmp.GuessLinesWidths(nStyle, n1, n2, n3);
- aLineItem.SetLine( &aTmp );
- mpDispatcher->ExecuteList(
- SID_FRAME_LINESTYLE, SfxCallMode::RECORD, { &aLineItem });
- SetAllNoSel();
- EndPopupMode();
+ case 1:
+ n1 = DEF_LINE_WIDTH_0;
+ break;
+ case 2:
+ n1 = DEF_LINE_WIDTH_2;
+ break;
+ case 3:
+ n1 = DEF_LINE_WIDTH_3;
+ break;
+ case 4:
+ n1 = DEF_LINE_WIDTH_4;
+ break;
+ case 5:
+ n1 = DEF_LINE_WIDTH_0;
+ n2 = DEF_LINE_WIDTH_0;
+ n3 = DEF_LINE_WIDTH_1;
+ nStyle = SvxBorderLineStyle::DOUBLE;
+ break;
+ case 6:
+ n1 = DEF_LINE_WIDTH_0;
+ n2 = DEF_LINE_WIDTH_0;
+ n3 = DEF_LINE_WIDTH_2;
+ nStyle = SvxBorderLineStyle::DOUBLE;
+ break;
+ case 7:
+ n1 = DEF_LINE_WIDTH_1;
+ n2 = DEF_LINE_WIDTH_2;
+ n3 = DEF_LINE_WIDTH_1;
+ nStyle = SvxBorderLineStyle::DOUBLE;
+ break;
+ case 8:
+ n1 = DEF_LINE_WIDTH_2;
+ n2 = DEF_LINE_WIDTH_0;
+ n3 = DEF_LINE_WIDTH_2;
+ nStyle = SvxBorderLineStyle::DOUBLE;
+ break;
+ case 9:
+ n1 = DEF_LINE_WIDTH_2;
+ n2 = DEF_LINE_WIDTH_2;
+ n3 = DEF_LINE_WIDTH_2;
+ nStyle = SvxBorderLineStyle::DOUBLE;
+ break;
+ default:
+ break;
}
+
+ editeng::SvxBorderLine aTmp;
+ aTmp.GuessLinesWidths(nStyle, n1, n2, n3);
+ aLineItem.SetLine( &aTmp );
+ mpDispatcher->ExecuteList(
+ SID_FRAME_LINESTYLE, SfxCallMode::RECORD, { &aLineItem });
+ SetAllNoSel();
+
+ maToolButton.set_inactive();
}
-IMPL_LINK(CellLineStylePopup, PBClickHdl, Button *, pPBtn, void)
+IMPL_LINK_NOARG(CellLineStylePopup, PBClickHdl, weld::Button&, void)
{
- if (pPBtn == maPushButtonMoreOptions.get())
- {
- mpDispatcher->Execute(SID_CELL_FORMAT_BORDER, SfxCallMode::ASYNCHRON);
- EndPopupMode();
- }
+ mpDispatcher->Execute(SID_CELL_FORMAT_BORDER, SfxCallMode::ASYNCHRON);
+ maToolButton.set_inactive();
}
void CellLineStylePopup::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis)
{
- maCellLineStyleValueSet->GrabFocus();
+ mxCellLineStyleValueSet->GrabFocus();
SetAllNoSel();
//FIXME: fully for new border line possibilities
if(out == DEF_LINE_WIDTH_0 && in == 0 && dis == 0) //1
{
- maCellLineStyleValueSet->SetSelItem(1);
+ mxCellLineStyleValueSet->SetSelItem(1);
}
else if(out == DEF_LINE_WIDTH_2 && in == 0 && dis == 0) //2
{
- maCellLineStyleValueSet->SetSelItem(2);
+ mxCellLineStyleValueSet->SetSelItem(2);
}
else if(out == DEF_LINE_WIDTH_3 && in == 0 && dis == 0) //3
{
- maCellLineStyleValueSet->SetSelItem(3);
+ mxCellLineStyleValueSet->SetSelItem(3);
}
else if(out == DEF_LINE_WIDTH_4 && in == 0 && dis == 0) //4
{
- maCellLineStyleValueSet->SetSelItem(4);
+ mxCellLineStyleValueSet->SetSelItem(4);
}
else if(out == DEF_LINE_WIDTH_0 && in == DEF_LINE_WIDTH_0 && dis == DEF_LINE_WIDTH_1) //5
{
- maCellLineStyleValueSet->SetSelItem(5);
+ mxCellLineStyleValueSet->SetSelItem(5);
}
else if(out == DEF_LINE_WIDTH_0 && in == DEF_LINE_WIDTH_0 && dis == DEF_LINE_WIDTH_2) //6
{
- maCellLineStyleValueSet->SetSelItem(6);
+ mxCellLineStyleValueSet->SetSelItem(6);
}
else if(out == DEF_LINE_WIDTH_1 && in == DEF_LINE_WIDTH_2 && dis == DEF_LINE_WIDTH_1) //7
{
- maCellLineStyleValueSet->SetSelItem(7);
+ mxCellLineStyleValueSet->SetSelItem(7);
}
else if(out == DEF_LINE_WIDTH_2 && in == DEF_LINE_WIDTH_0 && dis == DEF_LINE_WIDTH_2) //8
{
- maCellLineStyleValueSet->SetSelItem(8);
+ mxCellLineStyleValueSet->SetSelItem(8);
}
else if(out == DEF_LINE_WIDTH_2 && in == DEF_LINE_WIDTH_2 && dis == DEF_LINE_WIDTH_2) //9
{
- maCellLineStyleValueSet->SetSelItem(9);
+ mxCellLineStyleValueSet->SetSelItem(9);
}
else
{
- maCellLineStyleValueSet->SetSelItem(0);
- maPushButtonMoreOptions->GrabFocus();
+ mxCellLineStyleValueSet->SetSelItem(0);
+ mxPushButtonMoreOptions->grab_focus();
}
- maCellLineStyleValueSet->SetFormat();
- maCellLineStyleValueSet->Invalidate();
- maCellLineStyleValueSet->StartSelection();
+ mxCellLineStyleValueSet->SetFormat();
+ mxCellLineStyleValueSet->Invalidate();
}
} } // end of namespace svx::sidebar
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.hxx b/sc/source/ui/sidebar/CellLineStyleControl.hxx
index 26217fe3ee82..e620751a96a5 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.hxx
@@ -19,33 +19,35 @@
#ifndef INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLLINESTYLECONTROL_HXX
#define INCLUDED_SC_SOURCE_UI_SIDEBAR_CELLLINESTYLECONTROL_HXX
-#include <vcl/button.hxx>
-#include <vcl/floatwin.hxx>
+#include <svtools/toolbarmenu.hxx>
+#include <svx/colorwindow.hxx>
#include "CellLineStyleValueSet.hxx"
class SfxDispatcher;
namespace sc { namespace sidebar {
-class CellLineStylePopup : public FloatingWindow
+class CellLineStylePopup : public WeldToolbarPopup
{
- SfxDispatcher* mpDispatcher;
- VclPtr<PushButton> maPushButtonMoreOptions;
- VclPtr<CellLineStyleValueSet> maCellLineStyleValueSet;
- OUString maStr[CELL_LINE_STYLE_ENTRIES];
+private:
+ MenuOrToolMenuButton maToolButton;
+ SfxDispatcher* mpDispatcher;
+ std::unique_ptr<CellLineStyleValueSet> mxCellLineStyleValueSet;
+ std::unique_ptr<weld::CustomWeld> mxCellLineStyleValueSetWin;
+ std::unique_ptr<weld::Button> mxPushButtonMoreOptions;
+ OUString maStr[CELL_LINE_STYLE_ENTRIES];
void Initialize();
void SetAllNoSel();
- DECL_LINK(VSSelectHdl, ValueSet*, void);
- DECL_LINK(PBClickHdl, Button*, void);
-
+ DECL_LINK(VSSelectHdl, SvtValueSet*, void);
+ DECL_LINK(PBClickHdl, weld::Button&, void);
public:
- explicit CellLineStylePopup(SfxDispatcher* pDispatcher);
+ CellLineStylePopup(weld::Toolbar* pParent, const OString& rId, SfxDispatcher* pDispatcher);
void SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis);
+ virtual void GrabFocus() override;
virtual ~CellLineStylePopup() override;
- virtual void dispose() override;
};
} } // end of namespace svx::sidebar
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
index 5bd9e11c5fae..a8df9a3363a7 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
@@ -21,25 +21,29 @@
#include <i18nlangtag/mslangid.hxx>
#include <vcl/event.hxx>
#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
namespace sc { namespace sidebar {
-CellLineStyleValueSet::CellLineStyleValueSet(vcl::Window* pParent)
- : ValueSet(pParent, WB_TABSTOP)
+CellLineStyleValueSet::CellLineStyleValueSet()
+ : SvtValueSet(nullptr)
, nSelItem(0)
{
- SetColCount();
- SetLineCount( 9);
}
CellLineStyleValueSet::~CellLineStyleValueSet()
{
- disposeOnce();
}
-Size CellLineStyleValueSet::GetOptimalSize() const
+void CellLineStyleValueSet::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
- return LogicToPixel(Size(80, 12 * 9), MapMode(MapUnit::MapAppFont));
+ SvtValueSet::SetDrawingArea(pDrawingArea);
+ Size aSize = pDrawingArea->get_ref_device().LogicToPixel(Size(80, 12 * 9), MapMode(MapUnit::MapAppFont));
+ pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
+ SetOutputSizePixel(aSize);
+
+ SetColCount();
+ SetLineCount( 9);
}
void CellLineStyleValueSet::SetUnit(const OUString* str)
@@ -98,11 +102,13 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
pDev->DrawRect(aRect);
}
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
//draw text
if (nSelItem == nItemId )
aFont.SetColor(COL_WHITE);
else
- aFont.SetColor(GetSettings().GetStyleSettings().GetFieldTextColor()); //high contrast
+ aFont.SetColor(rStyleSettings.GetFieldTextColor()); //high contrast
pDev->SetFont(aFont);
long nTextWidth = pDev->GetTextWidth(maStrUnit[nItemId - 1]);
@@ -119,8 +125,8 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
}
else
{
- pDev->SetFillColor(GetSettings().GetStyleSettings().GetFieldTextColor()); //high contrast
- pDev->SetLineColor(GetSettings().GetStyleSettings().GetFieldTextColor()); //high contrast
+ pDev->SetFillColor(rStyleSettings.GetFieldTextColor()); //high contrast
+ pDev->SetLineColor(rStyleSettings.GetFieldTextColor()); //high contrast
}
switch( nItemId )
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
index 2e45622d8812..7dd340bfeb06 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
@@ -25,18 +25,18 @@
namespace sc { namespace sidebar {
-class CellLineStyleValueSet : public ValueSet
+class CellLineStyleValueSet : public SvtValueSet
{
private:
sal_uInt16 nSelItem;
OUString maStrUnit[CELL_LINE_STYLE_ENTRIES];
public:
- explicit CellLineStyleValueSet(vcl::Window* pParent);
+ CellLineStyleValueSet();
virtual ~CellLineStyleValueSet() override;
void SetUnit(const OUString* str);
void SetSelItem(sal_uInt16 nSel);
- virtual Size GetOptimalSize() const override;
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) override;
};
diff --git a/sc/uiconfig/scalc/ui/floatingborderstyle.ui b/sc/uiconfig/scalc/ui/floatingborderstyle.ui
index 05668ad30577..7105c7099857 100644
--- a/sc/uiconfig/scalc/ui/floatingborderstyle.ui
+++ b/sc/uiconfig/scalc/ui/floatingborderstyle.ui
@@ -1,268 +1,274 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkWindow" id="FloatingBorderStyle">
+ <object class="GtkPopover" id="FloatingBorderStyle">
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
+ <property name="no_show_all">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">
+ <object class="GtkBox" id="container">
<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">6</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkToolbar" id="border1">
+ <object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="toolbar_style">icons</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="row_spacing">6</property>
<child>
- <object class="GtkToolButton" id="none">
+ <object class="GtkToolbar" id="border1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|none|tooltip_text">No Border</property>
- <property name="action_name">none</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_Empty_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="all">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|all|tooltip_text">All Borders</property>
- <property name="action_name">all</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_All_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="outside">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|outside|tooltip_text">Outside Borders</property>
- <property name="action_name">outside</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_FourBorders_18x18.png</property>
+ <property name="can_focus">True</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <child>
+ <object class="GtkToolButton" id="none">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|none|tooltip_text">No Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_Empty_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="all">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|all|tooltip_text">All Borders</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_All_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="outside">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|outside|tooltip_text">Outside Borders</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_FourBorders_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="thickbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|thickbox|tooltip_text">Thick Box Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_FourBorders_Thick_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkToolButton" id="thickbox">
+ <object class="GtkToolbar" id="border4">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|thickbox|tooltip_text">Thick Box Border</property>
- <property name="action_name">thickbox</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_FourBorders_Thick_18x18.png</property>
+ <property name="can_focus">True</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <child>
+ <object class="GtkToolButton" id="thickbottom">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|thickbottom|tooltip_text">Thick Bottom Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_Bottom_Thick_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="doublebottom">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|doublebottom|tooltip_text">Double Bottom Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_Bottom_Double_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="topthickbottom">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|topthickbottom|tooltip_text">Top and Thick Bottom Borders</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_TopThin_BottomThick_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="topdoublebottom">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|topdoublebottom|tooltip_text">Top and Double Bottom Borders</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_TopSingle_BottomDouble_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
</packing>
</child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolbar" id="border3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="toolbar_style">icons</property>
<child>
- <object class="GtkToolButton" id="thickbottom">
+ <object class="GtkToolbar" id="border2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|thickbottom|tooltip_text">Thick Bottom Border</property>
- <property name="action_name">thickbottom</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_Bottom_Thick_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="doublebottom">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|doublebottom|tooltip_text">Double Bottom Border</property>
- <property name="action_name">doublebottom</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_Bottom_Double_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="topthickbottom">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|topthickbottom|tooltip_text">Top and Thick Bottom Borders</property>
- <property name="action_name">topthickbottom</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_TopThin_BottomThick_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="topdoublebottom">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|topdoublebottom|tooltip_text">Top and Double Bottom Borders</property>
- <property name="action_name">topdoublebottom</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_TopSingle_BottomDouble_18x18.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">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolbar" id="border2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="toolbar_style">icons</property>
- <child>
- <object class="GtkToolButton" id="left">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|left|tooltip_text">Left Border</property>
- <property name="action_name">left</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_Left_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="right">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|right|tooltip_text">Right Border</property>
- <property name="action_name">right</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_Right_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="top">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|top|tooltip_text">Top Border</property>
- <property name="action_name">top</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_Top_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="bottom">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|bottom|tooltip_text">Bottom Border</property>
- <property name="action_name">bottom</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_Bottom_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="diagup">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|diagup|tooltip_text">Diagonal Up Border</property>
- <property name="action_name">diagup</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_RightDiagonal_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="diagdown">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|diagdown|tooltip_text">Diagonal Down Border</property>
- <property name="action_name">diagdown</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_LeftDiagonal_18x18.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="topbottom">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|topbottom|tooltip_text">Top and Bottom Borders</property>
- <property name="action_name">topbottom</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_TopAndBottom_18x18.png</property>
+ <property name="can_focus">True</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">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" context="floatingborderstyle|left|tooltip_text">Left Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_Left_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="right">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|right|tooltip_text">Right Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_Right_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="top">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|top|tooltip_text">Top Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_Top_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="bottom">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|bottom|tooltip_text">Bottom Border</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_Bottom_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkToolButton" id="leftright">
+ <object class="GtkToolbar" id="border3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes" context="floatingborderstyle|leftright|tooltip_text">Left and Right Borders</property>
- <property name="action_name">leftright</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sc/res/sidebar/CellBorder_LeftAndRight_18x18.png</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <child>
+ <object class="GtkToolButton" id="diagup">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|diagup|tooltip_text">Diagonal Up Border</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_RightDiagonal_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="diagdown">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|diagdown|tooltip_text">Diagonal Down Border</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_LeftDiagonal_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="topbottom">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|topbottom|tooltip_text">Top and Bottom Borders</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_TopAndBottom_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="leftright">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes" context="floatingborderstyle|leftright|tooltip_text">Left and Right Borders</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sc/res/sidebar/CellBorder_LeftAndRight_18x18.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
diff --git a/sc/uiconfig/scalc/ui/floatinglinestyle.ui b/sc/uiconfig/scalc/ui/floatinglinestyle.ui
index 6b37438da63e..adfca80693f8 100644
--- a/sc/uiconfig/scalc/ui/floatinglinestyle.ui
+++ b/sc/uiconfig/scalc/ui/floatinglinestyle.ui
@@ -1,52 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkWindow" id="FloatingLineStyle">
+ <object class="GtkPopover" id="FloatingLineStyle">
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
+ <property name="no_show_all">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">
+ <object class="GtkBox" id="container">
<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">6</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox" id="box">
+ <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">6</property>
<child>
- <placeholder/>
+ <object class="GtkButton" id="more">
+ <property name="label" translatable="yes" context="floatinglinestyle|more">_More Options...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="valuesetwin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="valueset">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_focus">True</property>
+ <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="more">
- <property name="label" translatable="yes" context="floatinglinestyle|more">_More Options...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
diff --git a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
index ee6e347ab97e..ddf3c1bca80c 100644
--- a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
+++ b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
<object class="GtkGrid" id="CellAppearancePropertyPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -35,18 +34,20 @@
</packing>
</child>
<child>
- <object class="sfxlo-SidebarToolBox" id="cellbackgroundcolor">
+ <object class="GtkToolbar" id="cellbackgroundcolor">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes" context="sidebarcellappearance|cellbackgroundcolor|tooltip_text">Select the background color of the selected cells.</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <property name="icon_size">2</property>
<child>
- <object class="GtkMenuToolButton" id="cellbackground">
+ <object class="GtkMenuToolButton" id=".uno:BackgroundColor">
<property name="width_request">105</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="sidebarcellappearance|cellbackground|tooltip_text">Select the background color of the selected cells.</property>
<property name="halign">start</property>
- <property name="action_name">.uno:BackgroundColor</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -79,14 +80,15 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <property name="icon_size">2</property>
<child>
- <object class="GtkMenuToolButton" id="bordertype">
+ <object class="GtkMenuToolButton" id="SetBorderStyle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="sidebarcellappearance|bordertype|tooltip_text">Specify the borders of the selected cells.</property>
<property name="halign">start</property>
- <property name="action_name">.uno:SetBorderStyle</property>
- <property name="label" translatable="no">toolbutton1</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -111,15 +113,16 @@
<object class="GtkToolbar" id="borderlinestyle">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <property name="icon_size">2</property>
<child>
- <object class="GtkMenuToolButton" id="linestyle">
+ <object class="GtkMenuToolButton" id="LineStyle">
<property name="width_request">105</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="sidebarcellappearance|linestyle|tooltip_text">Select the line style of the borders.</property>
<property name="halign">end</property>
- <property name="action_name">.uno:LineStyle</property>
- <property name="label" translatable="no">toolbutton2</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -140,19 +143,21 @@
</packing>
</child>
<child>
- <object class="sfxlo-SidebarToolBox" id="borderlinecolor">
+ <object class="GtkToolbar" id="borderlinecolor">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes" context="sidebarcellappearance|borderlinecolor|tooltip_text">Select the line color of the borders.</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <property name="icon_size">2</property>
<child>
- <object class="GtkMenuToolButton" id="linecolor">
+ <object class="GtkMenuToolButton" id=".uno:FrameLineColor">
<property name="width_request">105</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="sidebarcellappearance|linecolor|tooltip_text">Select the line color of the borders.</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
- <property name="action_name">.uno:FrameLineColor</property>
<property name="use_underline">True</property>
</object>
<packing>