[Libreoffice-commits] core.git: 2 commits - extras/source include/svx solenv/bin solenv/sanitizers svx/source svx/uiconfig
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Dec 20 08:55:24 UTC 2019
extras/source/glade/libreoffice-catalog.xml.in | 4
include/svx/spacinglistbox.hxx | 11 -
solenv/bin/native-code.py | 1
solenv/sanitizers/ui/svx.suppr | 8
svx/source/dialog/spacinglistbox.cxx | 135 +++----------
svx/source/sidebar/shadow/ShadowPropertyPanel.cxx | 217 ++++++++++------------
svx/source/sidebar/shadow/ShadowPropertyPanel.hxx | 42 ++--
svx/uiconfig/ui/sidebarshadow.ui | 47 +++-
8 files changed, 193 insertions(+), 272 deletions(-)
New commits:
commit 07754d010257b36a6f695879f10a839ccf166058
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 19 15:48:02 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Dec 20 09:54:14 2019 +0100
weld ShadowPropertyPanel
Change-Id: I5ffd5881955726823b0e4c6f347e9a1e1767b640
Reviewed-on: https://gerrit.libreoffice.org/85535
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/solenv/sanitizers/ui/svx.suppr b/solenv/sanitizers/ui/svx.suppr
index 5b323a5f23e8..8aee20b117aa 100644
--- a/solenv/sanitizers/ui/svx.suppr
+++ b/solenv/sanitizers/ui/svx.suppr
@@ -64,15 +64,9 @@ svx/uiconfig/ui/sidebararea.ui://GtkLabel[@id='filllabel'] orphan-label
svx/uiconfig/ui/sidebararea.ui://svxlo-SvxFillAttrBox[@id='fillattr'] missing-label-for
svx/uiconfig/ui/sidebararea.ui://svxlo-SvxFillTypeBox[@id='fillstyle'] missing-label-for
svx/uiconfig/ui/sidebararea.ui://GtkLabel[@id='transparencylabel'] orphan-label
-svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='angle'] orphan-label
-svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='distance'] orphan-label
-svx/uiconfig/ui/sidebarshadow.ui://VclComboBoxNumeric[@id='LB_ANGLE:0degrees'] no-labelled-by
-svx/uiconfig/ui/sidebarshadow.ui://VclComboBoxNumeric[@id='LB_DISTANCE:0pt'] no-labelled-by
svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='transparency_label'] orphan-label
-svx/uiconfig/ui/sidebarshadow.ui://GtkSpinButton[@id='FIELD_TRANSPARENCY:0%'] no-labelled-by
+svx/uiconfig/ui/sidebarshadow.ui://GtkSpinButton[@id='FIELD_TRANSPARENCY'] no-labelled-by
svx/uiconfig/ui/sidebarshadow.ui://GtkScale[@id='transparency_slider'] no-labelled-by
-svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='color'] orphan-label
-svx/uiconfig/ui/sidebarshadow.ui://svxcorelo-SvxColorListBox[@id='LB_SHADOW_COLOR'] no-labelled-by
svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setbrightness:%'] missing-label-for
svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setbrightness:%'] labelled-by-and-mnemonic
svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setcontrast:%'] missing-label-for
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
index 8c93ee2708d0..b641101a6f79 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
@@ -34,42 +34,13 @@
using namespace css;
using namespace css::uno;
-namespace {
-
-sal_uInt32 ParseText(OUString const & sTmp)
-{
- if (sTmp.isEmpty())
- return 0;
- sal_Unicode nChar = sTmp[0];
- if( nChar == '-' )
- {
- if (sTmp.getLength() < 2)
- return 0;
- nChar = sTmp[1];
- }
-
- if( (nChar < '0') || (nChar > '9') )
- return 0;
-
- const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
-
- rtl_math_ConversionStatus eStatus;
- double fTmp = rLocaleWrapper.stringToDouble( sTmp, false, &eStatus, nullptr);
- if (eStatus != rtl_math_ConversionStatus_Ok)
- return 0;
-
- return fTmp;
-}
-
-}
-
namespace svx { namespace sidebar {
ShadowPropertyPanel::ShadowPropertyPanel(
vcl::Window* pParent,
const uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
-: PanelLayout(pParent, "ShadowPropertyPanel", "svx/ui/sidebarshadow.ui", rxFrame),
+: PanelLayout(pParent, "ShadowPropertyPanel", "svx/ui/sidebarshadow.ui", rxFrame, true),
maShadowController(SID_ATTR_FILL_SHADOW, *pBindings, *this),
maShadowTransController(SID_ATTR_SHADOW_TRANSPARENCE, *pBindings, *this),
maShadowColorController(SID_ATTR_SHADOW_COLOR, *pBindings, *this),
@@ -78,19 +49,18 @@ ShadowPropertyPanel::ShadowPropertyPanel(
mpBindings(pBindings),
nX(0),
nY(0),
- nXY(0)
+ nXY(0),
+ mxShowShadow(m_xBuilder->weld_check_button("SHOW_SHADOW")),
+ mxShadowDistance(m_xBuilder->weld_metric_spin_button("LB_DISTANCE", FieldUnit::POINT)),
+ mxLBShadowColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_SHADOW_COLOR"), GetFrameWeld())),
+ mxShadowAngle(m_xBuilder->weld_combo_box("LB_ANGLE")),
+ mxFTAngle(m_xBuilder->weld_label("angle")),
+ mxFTDistance(m_xBuilder->weld_label("distance")),
+ mxFTTransparency(m_xBuilder->weld_label("transparency_label")),
+ mxFTColor(m_xBuilder->weld_label("color")),
+ mxShadowTransSlider(m_xBuilder->weld_scale("transparency_slider")),
+ mxShadowTransMetric(m_xBuilder->weld_metric_spin_button("FIELD_TRANSPARENCY", FieldUnit::PERCENT))
{
- get(mpShowShadow,"SHOW_SHADOW");
- get(mpFTAngle,"angle");
- get(mpShadowAngle,"LB_ANGLE");
- get(mpFTDistance,"distance");
- get(mpShadowDistance,"LB_DISTANCE");
- get(mpFTTransparency,"transparency_label");
- get(mpShadowTransSlider,"transparency_slider");
- get(mpShadowTransMetric,"FIELD_TRANSPARENCY");
- get(mpFTColor,"color");
- get(mpLBShadowColor,"LB_SHADOW_COLOR");
-
Initialize();
}
@@ -101,16 +71,16 @@ ShadowPropertyPanel::~ShadowPropertyPanel()
void ShadowPropertyPanel::dispose()
{
- mpShowShadow.clear();
- mpFTAngle.clear();
- mpShadowAngle.clear();
- mpFTDistance.clear();
- mpShadowDistance.clear();
- mpFTTransparency.clear();
- mpShadowTransSlider.clear();
- mpShadowTransMetric.clear();
- mpFTColor.clear();
- mpLBShadowColor.clear();
+ mxShowShadow.reset();
+ mxFTAngle.reset();
+ mxShadowAngle.reset();
+ mxFTDistance.reset();
+ mxShadowDistance.reset();
+ mxFTTransparency.reset();
+ mxShadowTransSlider.reset();
+ mxShadowTransMetric.reset();
+ mxFTColor.reset();
+ mxLBShadowColor.reset();
maShadowController.dispose();
maShadowTransController.dispose();
@@ -122,23 +92,20 @@ void ShadowPropertyPanel::dispose()
void ShadowPropertyPanel::Initialize()
{
- mpShowShadow->SetState( TRISTATE_FALSE );
- mpShowShadow->SetClickHdl( LINK(this, ShadowPropertyPanel, ClickShadowHdl ) );
- mpShadowTransMetric->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransMetricHdl) );
- mpLBShadowColor->SetSelectHdl( LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl ) );
- mpShadowAngle->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
- mpShadowDistance->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
- mpShadowTransSlider->SetRange(Range(0,100));
- mpShadowTransSlider->SetUpdateMode(true);
- mpShadowTransSlider->SetSlideHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransSliderHdl) );
- for(sal_uInt16 i = 0; i <= 20 ; i++)
- mpShadowDistance->InsertValue(i*2,FieldUnit::POINT);
+ mxShowShadow->set_state( TRISTATE_FALSE );
+ mxShowShadow->connect_toggled( LINK(this, ShadowPropertyPanel, ClickShadowHdl ) );
+ mxShadowTransMetric->connect_value_changed( LINK(this, ShadowPropertyPanel, ModifyShadowTransMetricHdl) );
+ mxLBShadowColor->SetSelectHdl( LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl ) );
+ mxShadowAngle->connect_changed( LINK(this, ShadowPropertyPanel, ModifyShadowAngleHdl) );
+ mxShadowDistance->connect_value_changed( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
+ mxShadowTransSlider->set_range(0, 100);
+ mxShadowTransSlider->connect_value_changed( LINK(this, ShadowPropertyPanel, ModifyShadowTransSliderHdl) );
InsertAngleValues();
}
-IMPL_LINK_NOARG(ShadowPropertyPanel, ClickShadowHdl, Button*, void)
+IMPL_LINK_NOARG(ShadowPropertyPanel, ClickShadowHdl, weld::ToggleButton&, void)
{
- if( mpShowShadow->GetState() == TRISTATE_FALSE )
+ if( mxShowShadow->get_state() == TRISTATE_FALSE )
{
SdrOnOffItem aItem(makeSdrShadowItem(false));
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_FILL_SHADOW,
@@ -152,36 +119,46 @@ IMPL_LINK_NOARG(ShadowPropertyPanel, ClickShadowHdl, Button*, void)
}
}
-IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowColorHdl, SvxColorListBox&, void)
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowColorHdl, ColorListBox&, void)
{
- XColorItem aItem(makeSdrShadowColorItem(mpLBShadowColor->GetSelectEntryColor()));
+ XColorItem aItem(makeSdrShadowColorItem(mxLBShadowColor->GetSelectEntryColor()));
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_SHADOW_COLOR,
SfxCallMode::RECORD, { &aItem });
}
-IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransMetricHdl, Edit&, void)
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransMetricHdl, weld::MetricSpinButton&, void)
{
- sal_uInt16 nVal = mpShadowTransMetric->GetValue();
+ sal_uInt16 nVal = mxShadowTransMetric->get_value(FieldUnit::PERCENT);
SetTransparencyValue(nVal);
SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) );
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_SHADOW_TRANSPARENCE,
SfxCallMode::RECORD, { &aItem });
}
-IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransSliderHdl, Slider*, void)
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransSliderHdl, weld::Scale&, void)
{
- sal_uInt16 nVal = mpShadowTransSlider->GetThumbPos();
+ sal_uInt16 nVal = mxShadowTransSlider->get_value();
SetTransparencyValue(nVal);
SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) );
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_SHADOW_TRANSPARENCE,
SfxCallMode::RECORD, { &aItem });
}
-IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowDistanceHdl, Edit&, void)
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowAngleHdl, weld::ComboBox&, void)
+{
+ ModifyShadowDistance();
+}
+
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowDistanceHdl, weld::MetricSpinButton&, void)
+{
+ ModifyShadowDistance();
+}
+
+void ShadowPropertyPanel::ModifyShadowDistance()
{
- OUString sAngle = mpShadowAngle->GetText();
- nXY = mpShadowDistance->GetValue(FieldUnit::MM_100TH);
- switch(ParseText(sAngle))
+ auto nAngle = mxShadowAngle->get_active_id().toInt32();
+ nXY = mxShadowDistance->get_value(FieldUnit::MM_100TH);
+ switch (nAngle)
{
case 0: nX = nXY; nY = 0; break;
case 45: nX = nXY; nY = -nXY; break;
@@ -202,48 +179,48 @@ IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowDistanceHdl, Edit&, void)
void ShadowPropertyPanel::UpdateControls()
{
- if(mpShowShadow->GetState() == TRISTATE_FALSE)
+ if (mxShowShadow->get_state() == TRISTATE_FALSE)
{
- mpShadowDistance->Disable();
- mpLBShadowColor->Disable();
- mpShadowAngle->Disable();
- mpFTAngle->Disable();
- mpFTDistance->Disable();
- mpFTTransparency->Disable();
- mpFTColor->Disable();
- mpShadowTransSlider->Disable();
- mpShadowTransMetric->Disable();
+ mxShadowDistance->set_sensitive(false);
+ mxLBShadowColor->set_sensitive(false);
+ mxShadowAngle->set_sensitive(false);
+ mxFTAngle->set_sensitive(false);
+ mxFTDistance->set_sensitive(false);
+ mxFTTransparency->set_sensitive(false);
+ mxFTColor->set_sensitive(false);
+ mxShadowTransSlider->set_sensitive(false);
+ mxShadowTransMetric->set_sensitive(false);
return;
}
else
{
- mpShadowDistance->Enable();
- mpLBShadowColor->Enable();
- mpShadowAngle->Enable();
- mpFTAngle->Enable();
- mpFTDistance->Enable();
- mpFTTransparency->Enable();
- mpFTColor->Enable();
- mpShadowTransSlider->Enable();
- mpShadowTransMetric->Enable();
+ mxShadowDistance->set_sensitive(true);
+ mxLBShadowColor->set_sensitive(true);
+ mxShadowAngle->set_sensitive(true);
+ mxFTAngle->set_sensitive(true);
+ mxFTDistance->set_sensitive(true);
+ mxFTTransparency->set_sensitive(true);
+ mxFTColor->set_sensitive(true);
+ mxShadowTransSlider->set_sensitive(true);
+ mxShadowTransMetric->set_sensitive(true);
}
- if(nX > 0 && nY == 0) { mpShadowAngle->SelectEntryPos(0); nXY = nX; }
- else if( nX > 0 && nY < 0 ) { mpShadowAngle->SelectEntryPos(1); nXY = nX; }
- else if( nX == 0 && nY < 0 ) { mpShadowAngle->SelectEntryPos(2); nXY = -nY; }
- else if( nX < 0 && nY < 0 ) { mpShadowAngle->SelectEntryPos(3); nXY = -nY; }
- else if( nX < 0 && nY == 0 ) { mpShadowAngle->SelectEntryPos(4); nXY = -nX; }
- else if( nX < 0 && nY > 0 ) { mpShadowAngle->SelectEntryPos(5); nXY = nY; }
- else if( nX == 0 && nY > 0 ) { mpShadowAngle->SelectEntryPos(6); nXY = nY; }
- else if( nX > 0 && nY > 0 ) { mpShadowAngle->SelectEntryPos(7); nXY = nX; }
+ if(nX > 0 && nY == 0) { mxShadowAngle->set_active(0); nXY = nX; }
+ else if( nX > 0 && nY < 0 ) { mxShadowAngle->set_active(1); nXY = nX; }
+ else if( nX == 0 && nY < 0 ) { mxShadowAngle->set_active(2); nXY = -nY; }
+ else if( nX < 0 && nY < 0 ) { mxShadowAngle->set_active(3); nXY = -nY; }
+ else if( nX < 0 && nY == 0 ) { mxShadowAngle->set_active(4); nXY = -nX; }
+ else if( nX < 0 && nY > 0 ) { mxShadowAngle->set_active(5); nXY = nY; }
+ else if( nX == 0 && nY > 0 ) { mxShadowAngle->set_active(6); nXY = nY; }
+ else if( nX > 0 && nY > 0 ) { mxShadowAngle->set_active(7); nXY = nX; }
else { nXY = 0; }
- mpShadowDistance->SetValue(nXY, FieldUnit::MM_100TH);
+ mxShadowDistance->set_value(nXY, FieldUnit::MM_100TH);
}
void ShadowPropertyPanel::SetTransparencyValue(long nVal)
{
- mpShadowTransSlider->SetThumbPos(nVal);
- mpShadowTransMetric->SetValue(nVal);
+ mxShadowTransSlider->set_value(nVal);
+ mxShadowTransMetric->set_value(nVal, FieldUnit::PERCENT);
}
void ShadowPropertyPanel::DataChanged(const DataChangedEvent& /*rEvent*/)
@@ -252,14 +229,18 @@ void ShadowPropertyPanel::DataChanged(const DataChangedEvent& /*rEvent*/)
void ShadowPropertyPanel::InsertAngleValues()
{
- mpShadowAngle->InsertValue(0, FieldUnit::CUSTOM);
- mpShadowAngle->InsertValue(45, FieldUnit::CUSTOM);
- mpShadowAngle->InsertValue(90, FieldUnit::CUSTOM);
- mpShadowAngle->InsertValue(135, FieldUnit::CUSTOM);
- mpShadowAngle->InsertValue(180, FieldUnit::CUSTOM);
- mpShadowAngle->InsertValue(225,FieldUnit::CUSTOM);
- mpShadowAngle->InsertValue(270, FieldUnit::CUSTOM);
- mpShadowAngle->InsertValue(315,FieldUnit::CUSTOM);
+ OUString sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::DEGREE);
+
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetLocaleDataWrapper();
+
+ mxShadowAngle->append(OUString::number(0), rLocaleData.getNum(0, 0, true, true) + sSuffix);
+ mxShadowAngle->append(OUString::number(45), rLocaleData.getNum(45, 0, true, true) + sSuffix);
+ mxShadowAngle->append(OUString::number(90), rLocaleData.getNum(90, 0, true, true) + sSuffix);
+ mxShadowAngle->append(OUString::number(135), rLocaleData.getNum(135, 0, true, true) + sSuffix);
+ mxShadowAngle->append(OUString::number(180), rLocaleData.getNum(180, 0, true, true) + sSuffix);
+ mxShadowAngle->append(OUString::number(225), rLocaleData.getNum(225, 0, true, true) + sSuffix);
+ mxShadowAngle->append(OUString::number(270), rLocaleData.getNum(270, 0, true, true) + sSuffix);
+ mxShadowAngle->append(OUString::number(315), rLocaleData.getNum(315, 0, true, true) + sSuffix);
}
void ShadowPropertyPanel::NotifyItemUpdate(
@@ -276,13 +257,13 @@ void ShadowPropertyPanel::NotifyItemUpdate(
const SdrOnOffItem* pItem = dynamic_cast< const SdrOnOffItem* >(pState);
if(pItem)
{
- if(pItem->GetValue())
- mpShowShadow->SetState( TRISTATE_TRUE );
+ if (pItem->GetValue())
+ mxShowShadow->set_state(TRISTATE_TRUE);
else
- mpShowShadow->SetState( TRISTATE_FALSE );
+ mxShowShadow->set_state(TRISTATE_FALSE);
}
else
- mpShowShadow.reset();
+ mxShowShadow.reset();
}
}
break;
@@ -310,7 +291,7 @@ void ShadowPropertyPanel::NotifyItemUpdate(
const XColorItem* pColorItem = dynamic_cast< const XColorItem* >(pState);
if(pColorItem)
{
- mpLBShadowColor->SelectEntry(pColorItem->GetColorValue());
+ mxLBShadowColor->SelectEntry(pColorItem->GetColorValue());
}
}
}
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
index 7346b808eddf..c2bc4abcc599 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
@@ -9,21 +9,16 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
-#include <vcl/slider.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
#include <vcl/vclptr.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
-#include <vcl/ctrl.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <svl/intitem.hxx>
-#include <vcl/field.hxx>
#include <com/sun/star/ui/XUIElement.hpp>
#include <sfx2/request.hxx>
#include <svx/dlgctrl.hxx>
-class SvxColorListBox;
+class ColorListBox;
namespace svx { namespace sidebar {
@@ -58,17 +53,6 @@ public:
SfxBindings* pBindings);
private:
- VclPtr<CheckBox> mpShowShadow;
- VclPtr<MetricBox> mpShadowDistance;
- VclPtr<SvxColorListBox> mpLBShadowColor;
- VclPtr<MetricBox> mpShadowAngle;
- VclPtr<FixedText> mpFTAngle;
- VclPtr<FixedText> mpFTDistance;
- VclPtr<FixedText> mpFTTransparency;
- VclPtr<FixedText> mpFTColor;
- VclPtr<Slider> mpShadowTransSlider;
- VclPtr<MetricField> mpShadowTransMetric;
-
::sfx2::sidebar::ControllerItem maShadowController;
::sfx2::sidebar::ControllerItem maShadowTransController;
::sfx2::sidebar::ControllerItem maShadowColorController;
@@ -78,14 +62,28 @@ private:
SfxBindings* const mpBindings;
long nX,nY,nXY;
+ std::unique_ptr<weld::CheckButton> mxShowShadow;
+ std::unique_ptr<weld::MetricSpinButton> mxShadowDistance;
+ std::unique_ptr<ColorListBox> mxLBShadowColor;
+ std::unique_ptr<weld::ComboBox> mxShadowAngle;
+ std::unique_ptr<weld::Label> mxFTAngle;
+ std::unique_ptr<weld::Label> mxFTDistance;
+ std::unique_ptr<weld::Label> mxFTTransparency;
+ std::unique_ptr<weld::Label> mxFTColor;
+ std::unique_ptr<weld::Scale> mxShadowTransSlider;
+ std::unique_ptr<weld::MetricSpinButton> mxShadowTransMetric;
+
void InsertAngleValues();
void SetTransparencyValue(long);
void UpdateControls();
- DECL_LINK(ClickShadowHdl, Button*, void);
- DECL_LINK(ModifyShadowColorHdl, SvxColorListBox&, void);
- DECL_LINK(ModifyShadowTransMetricHdl, Edit&, void);
- DECL_LINK(ModifyShadowDistanceHdl, Edit&, void);
- DECL_LINK(ModifyShadowTransSliderHdl, Slider*, void);
+ void ModifyShadowDistance();
+
+ DECL_LINK(ClickShadowHdl, weld::ToggleButton&, void);
+ DECL_LINK(ModifyShadowColorHdl, ColorListBox&, void);
+ DECL_LINK(ModifyShadowTransMetricHdl, weld::MetricSpinButton&, void);
+ DECL_LINK(ModifyShadowAngleHdl, weld::ComboBox&, void);
+ DECL_LINK(ModifyShadowDistanceHdl, weld::MetricSpinButton&, void);
+ DECL_LINK(ModifyShadowTransSliderHdl, weld::Scale&, void);
};
}
}
diff --git a/svx/uiconfig/ui/sidebarshadow.ui b/svx/uiconfig/ui/sidebarshadow.ui
index c7e479298aa5..ad0d3fcd81fb 100644
--- a/svx/uiconfig/ui/sidebarshadow.ui
+++ b/svx/uiconfig/ui/sidebarshadow.ui
@@ -2,7 +2,6 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="svx">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">-180</property>
<property name="upper">360</property>
@@ -12,6 +11,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="adjustment3">
+ <property name="upper">1000</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkGrid" id="ShadowPropertyPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -41,6 +45,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="sidebarshadow|angle">Angle:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">LB_ANGLE</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -53,6 +59,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="sidebarshadow|distance">Distance:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">LB_DISTANCE</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -61,22 +69,11 @@
</packing>
</child>
<child>
- <object class="VclComboBoxNumeric" id="LB_ANGLE:0degrees">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="adjustment">adjustment1</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="VclComboBoxNumeric" id="LB_DISTANCE:0pt">
+ <object class="GtkSpinButton" id="LB_DISTANCE">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
+ <property name="adjustment">adjustment3</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -88,6 +85,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="sidebarshadow|color">Color:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">LB_SHADOW_COLOR</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -96,10 +95,16 @@
</packing>
</child>
<child>
- <object class="svxcorelo-SvxColorListBox" id="LB_SHADOW_COLOR">
+ <object class="GtkMenuButton" id="LB_SHADOW_COLOR">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="hexpand">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="label" translatable="no"></property>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -118,6 +123,16 @@
<property name="top_attach">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkComboBoxText" id="LB_ANGLE">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
<child>
<placeholder/>
</child>
@@ -139,7 +154,7 @@
<property name="can_focus">False</property>
<property name="column_spacing">6</property>
<child>
- <object class="GtkSpinButton" id="FIELD_TRANSPARENCY:0%">
+ <object class="GtkSpinButton" id="FIELD_TRANSPARENCY">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
commit 4a5fe0d1b7a1ffeb8240be94db571bcbcebdd846
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 19 15:19:49 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Dec 20 09:53:51 2019 +0100
SpacingListBox is now unused
Change-Id: I051200802c7841dc6feb9e3ab852385887c29b09
Reviewed-on: https://gerrit.libreoffice.org/85533
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index 8923acb26c81..7d013169a633 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -139,10 +139,6 @@
generic-name="Page Numbering ListBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox"/>
- <glade-widget-class title="Spacing Preset ListBox" name="svxcorelo-SpacingListBox"
- generic-name="Spacing Preset ListBox" parent="GtkComboBox"
- icon-name="widget-gtk-combobox"/>
-
<glade-widget-class title="Sidebar ToolBox" name="sfxlo-SidebarToolBox"
generic-name="Sidebar ToolBox" parent="GtkToolbar"
icon-name="widget-gtk-toolbar">
diff --git a/include/svx/spacinglistbox.hxx b/include/svx/spacinglistbox.hxx
index df8b8c043e19..d40e45b549b4 100644
--- a/include/svx/spacinglistbox.hxx
+++ b/include/svx/spacinglistbox.hxx
@@ -21,20 +21,15 @@
#define INCLUDED_SVX_SPACINGLISTBOXHELPER_HXX
#include <svx/svxdllapi.h>
-#include <vcl/lstbox.hxx>
#include <vcl/weld.hxx>
enum class SpacingType { SPACING_INCH, MARGINS_INCH, SPACING_CM, MARGINS_CM };
/// Custom Widget ListBox to hold entries for Spacing & Margin settings of Header/Footer
-class SVX_DLLPUBLIC SpacingListBox final : public ListBox
+namespace SpacingListBox
{
-public:
- SpacingListBox( vcl::Window* pParent );
- void Init(SpacingType eType);
- static void Fill(SpacingType eType, weld::ComboBox&);
- Size GetOptimalSize() const override;
-};
+ void SVX_DLLPUBLIC Fill(SpacingType eType, weld::ComboBox&);
+}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 71c27047a2d9..1058ed2ce2af 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -499,7 +499,6 @@ custom_widgets = [
'SearchResultsBox',
'SidebarDialControl',
'SidebarToolBox',
- 'SpacingListBox',
'Svx3DPreviewControl',
'SvxCharViewControl',
'SvxColorListBox',
diff --git a/svx/source/dialog/spacinglistbox.cxx b/svx/source/dialog/spacinglistbox.cxx
index ac31393b3a2f..4412e958c7ac 100644
--- a/svx/source/dialog/spacinglistbox.cxx
+++ b/svx/source/dialog/spacinglistbox.cxx
@@ -20,114 +20,57 @@
#include <svx/dialmgr.hxx>
#include <svx/spacinglistbox.hxx>
#include <unotools/localedatawrapper.hxx>
-#include <vcl/builderfactory.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/weld.hxx>
#include <spacing.hrc>
-SpacingListBox::SpacingListBox(vcl::Window* pParent)
- : ListBox( pParent, WB_BORDER | WB_DROPDOWN)
+namespace SpacingListBox
{
-}
-
-void SpacingListBox::Init(SpacingType eType)
-{
- auto nSelected = GetSelectedEntryPos();
- if (nSelected == LISTBOX_ENTRY_NOTFOUND)
- nSelected = 0;
- Clear();
-
- const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetLocaleDataWrapper();
- OUString sSuffix;
-
- const measurement* pResources;
- switch (eType)
+ void Fill(SpacingType eType, weld::ComboBox& rComboBox)
{
- case SpacingType::SPACING_INCH:
- pResources = RID_SVXSTRARY_SPACING_INCH;
- sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
- break;
- case SpacingType::MARGINS_INCH:
- pResources = RID_SVXSTRARY_MARGINS_INCH;
- sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
- break;
- case SpacingType::SPACING_CM:
- pResources = RID_SVXSTRARY_SPACING_CM;
- sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
- break;
- default:
- case SpacingType::MARGINS_CM:
- sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
- pResources = RID_SVXSTRARY_MARGINS_CM;
- break;
- }
-
- while (pResources->key)
- {
- OUString sMeasurement = rLocaleData.getNum(pResources->human, 2, true, false) + sSuffix;
- OUString aStr = SvxResId(pResources->key).replaceFirst("%1", sMeasurement);
- sal_uInt16 nData = pResources->twips;
- sal_Int32 nPos = InsertEntry( aStr );
-
- SetEntryData( nPos, reinterpret_cast<void*>(static_cast<sal_uLong>(nData)) );
- ++pResources;
- }
+ auto nSelected = rComboBox.get_active();
+ if (nSelected == -1)
+ nSelected = 0;
+ rComboBox.clear();
- SetDropDownLineCount(8);
- SelectEntryPos(nSelected);
-}
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetLocaleDataWrapper();
+ OUString sSuffix;
-void SpacingListBox::Fill(SpacingType eType, weld::ComboBox& rComboBox)
-{
- auto nSelected = rComboBox.get_active();
- if (nSelected == -1)
- nSelected = 0;
- rComboBox.clear();
+ const measurement* pResources;
+ switch (eType)
+ {
+ case SpacingType::SPACING_INCH:
+ pResources = RID_SVXSTRARY_SPACING_INCH;
+ sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
+ break;
+ case SpacingType::MARGINS_INCH:
+ pResources = RID_SVXSTRARY_MARGINS_INCH;
+ sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
+ break;
+ case SpacingType::SPACING_CM:
+ pResources = RID_SVXSTRARY_SPACING_CM;
+ sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
+ break;
+ default:
+ case SpacingType::MARGINS_CM:
+ sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
+ pResources = RID_SVXSTRARY_MARGINS_CM;
+ break;
+ }
- const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetLocaleDataWrapper();
- OUString sSuffix;
+ while (pResources->key)
+ {
+ OUString sMeasurement = rLocaleData.getNum(pResources->human, 2, true, false) + sSuffix;
+ OUString aStr = SvxResId(pResources->key).replaceFirst("%1", sMeasurement);
+ sal_uInt32 nData = pResources->twips;
+ rComboBox.append(OUString::number(nData), aStr);
+ ++pResources;
+ }
- const measurement* pResources;
- switch (eType)
- {
- case SpacingType::SPACING_INCH:
- pResources = RID_SVXSTRARY_SPACING_INCH;
- sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
- break;
- case SpacingType::MARGINS_INCH:
- pResources = RID_SVXSTRARY_MARGINS_INCH;
- sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
- break;
- case SpacingType::SPACING_CM:
- pResources = RID_SVXSTRARY_SPACING_CM;
- sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
- break;
- default:
- case SpacingType::MARGINS_CM:
- sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
- pResources = RID_SVXSTRARY_MARGINS_CM;
- break;
- }
+ rComboBox.set_active(nSelected);
- while (pResources->key)
- {
- OUString sMeasurement = rLocaleData.getNum(pResources->human, 2, true, false) + sSuffix;
- OUString aStr = SvxResId(pResources->key).replaceFirst("%1", sMeasurement);
- sal_uInt32 nData = pResources->twips;
- rComboBox.append(OUString::number(nData), aStr);
- ++pResources;
+ rComboBox.set_size_request(150, -1);
}
-
- rComboBox.set_active(nSelected);
-
- rComboBox.set_size_request(150, -1);
}
-VCL_BUILDER_FACTORY(SpacingListBox);
-
-Size SpacingListBox::GetOptimalSize() const
-{
- return Size(150, ListBox::GetOptimalSize().Height());
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list