chart2/inc/pch/precompiled_chartcontroller.hxx | 3 chart2/inc/pch/precompiled_chartcore.hxx | 4 chart2/source/controller/sidebar/ChartElementsPanel.cxx | 300 +++++++--------- chart2/source/controller/sidebar/ChartElementsPanel.hxx | 55 +- chart2/uiconfig/ui/sidebarelements.ui | 15 5 files changed, 182 insertions(+), 195 deletions(-)
New commits: commit 2dfc1dce87a0509e76d3d5875e03e3fae5d677d7 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Dec 20 15:52:45 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Dec 21 11:28:10 2019 +0100 update chart pch Change-Id: I413ef289e33c66ad15755807fcb7b0467da66a3a Reviewed-on: https://gerrit.libreoffice.org/85618 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index 4185805a0fba..5a7d9b2dbe0f 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2019-12-03 09:18:41 using: + Generated on 2019-12-20 15:44:10 using: ./bin/update_pch chart2 chartcontroller --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -103,7 +103,6 @@ #include <vcl/dllapi.h> #include <vcl/dndhelp.hxx> #include <vcl/dockwin.hxx> -#include <vcl/edit.hxx> #include <vcl/errcode.hxx> #include <vcl/floatwin.hxx> #include <vcl/fntstyle.hxx> diff --git a/chart2/inc/pch/precompiled_chartcore.hxx b/chart2/inc/pch/precompiled_chartcore.hxx index f4d88bab9354..4af3bcb40c99 100644 --- a/chart2/inc/pch/precompiled_chartcore.hxx +++ b/chart2/inc/pch/precompiled_chartcore.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2019-10-17 15:15:04 using: + Generated on 2019-12-20 15:44:23 using: ./bin/update_pch chart2 chartcore --cutoff=3 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -33,7 +33,7 @@ #include <string_view> #include <utility> #include <vector> -#include <o3tl/optional.hxx> +#include <boost/property_tree/ptree_fwd.hpp> #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 #include <osl/diagnose.h> commit 8dd9dda69ffca6b167f690481070b8ee7bf7f8fd Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Dec 20 15:40:52 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Dec 21 11:27:48 2019 +0100 weld ChartElementsPanel Change-Id: I0563289c4a4a17e25a612b26bffb947998e87f31 Reviewed-on: https://gerrit.libreoffice.org/85617 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx index ac48b0a7e9cb..bb7835cb71bd 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx @@ -24,8 +24,6 @@ #include "ChartElementsPanel.hxx" #include <ChartController.hxx> -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> #include <comphelper/processfactory.hxx> #include <LegendHelper.hxx> @@ -267,44 +265,39 @@ void setLegendPos(const css::uno::Reference<css::frame::XModel>& xModel, sal_Int } ChartElementsPanel::ChartElementsPanel( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, + vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, ChartController* pController) - : PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame), - maContext(), - mxModel(pController->getModel()), - mxListener(new ChartSidebarModifyListener(this)), - mbModelValid(true) + : PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame, true) + , mxCBTitle(m_xBuilder->weld_check_button("checkbutton_title")) + , mxCBSubtitle(m_xBuilder->weld_check_button("checkbutton_subtitle")) + , mxCBXAxis(m_xBuilder->weld_check_button("checkbutton_x_axis")) + , mxCBXAxisTitle(m_xBuilder->weld_check_button("checkbutton_x_axis_title")) + , mxCBYAxis(m_xBuilder->weld_check_button("checkbutton_y_axis")) + , mxCBYAxisTitle(m_xBuilder->weld_check_button("checkbutton_y_axis_title")) + , mxCBZAxis(m_xBuilder->weld_check_button("checkbutton_z_axis")) + , mxCBZAxisTitle(m_xBuilder->weld_check_button("checkbutton_z_axis_title")) + , mxCB2ndXAxis(m_xBuilder->weld_check_button("checkbutton_2nd_x_axis")) + , mxCB2ndXAxisTitle(m_xBuilder->weld_check_button("checkbutton_2nd_x_axis_title")) + , mxCB2ndYAxis(m_xBuilder->weld_check_button("checkbutton_2nd_y_axis")) + , mxCB2ndYAxisTitle(m_xBuilder->weld_check_button("checkbutton_2nd_y_axis_title")) + , mxCBLegend(m_xBuilder->weld_check_button("checkbutton_legend")) + , mxCBGridVerticalMajor(m_xBuilder->weld_check_button("checkbutton_gridline_vertical_major")) + , mxCBGridHorizontalMajor(m_xBuilder->weld_check_button("checkbutton_gridline_horizontal_major")) + , mxCBGridVerticalMinor(m_xBuilder->weld_check_button("checkbutton_gridline_vertical_minor")) + , mxCBGridHorizontalMinor(m_xBuilder->weld_check_button("checkbutton_gridline_horizontal_minor")) + , mxTextTitle(m_xBuilder->weld_label("text_title")) + , mxTextSubTitle(m_xBuilder->weld_label("text_subtitle")) + , mxLBAxis(m_xBuilder->weld_label("label_axes")) + , mxLBGrid(m_xBuilder->weld_label("label_gri")) + , mxLBLegendPosition(m_xBuilder->weld_combo_box("comboboxtext_legend")) + , mxBoxLegend(m_xBuilder->weld_widget("box_legend")) + , maContext() + , mxModel(pController->getModel()) + , mxListener(new ChartSidebarModifyListener(this)) + , mbModelValid(true) { - get(mpCBTitle, "checkbutton_title"); - get(mpCBSubtitle, "checkbutton_subtitle"); - get(mpCBXAxis, "checkbutton_x_axis"); - get(mpCBXAxisTitle, "checkbutton_x_axis_title"); - get(mpCBYAxis, "checkbutton_y_axis"); - get(mpCBYAxisTitle, "checkbutton_y_axis_title"); - get(mpCBZAxis, "checkbutton_z_axis"); - get(mpCBZAxisTitle, "checkbutton_z_axis_title"); - get(mpCB2ndXAxis, "checkbutton_2nd_x_axis"); - get(mpCB2ndXAxisTitle, "checkbutton_2nd_x_axis_title"); - get(mpCB2ndYAxis, "checkbutton_2nd_y_axis"); - get(mpCB2ndYAxisTitle, "checkbutton_2nd_y_axis_title"); - get(mpCBLegend, "checkbutton_legend"); - get(mpCBGridVerticalMajor, "checkbutton_gridline_vertical_major"); - get(mpCBGridHorizontalMajor, "checkbutton_gridline_horizontal_major"); - get(mpCBGridVerticalMinor, "checkbutton_gridline_vertical_minor"); - get(mpCBGridHorizontalMinor, "checkbutton_gridline_horizontal_minor"); - - get(mpLBAxis, "label_axes"); - get(mpLBGrid, "label_gri"); - - get(mpLBLegendPosition, "comboboxtext_legend"); - get(mpBoxLegend, "box_legend"); - - get(mpTextTitle, "text_title"); - get(mpTextSubTitle, "text_subtitle"); - - maTextTitle = mpTextTitle->GetText(); - maTextSubTitle = mpTextSubTitle->GetText(); + maTextTitle = mxTextTitle->get_label(); + maTextSubTitle = mxTextSubTitle->get_label(); Initialize(); } @@ -318,32 +311,32 @@ void ChartElementsPanel::dispose() { css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW); xBroadcaster->removeModifyListener(mxListener); - mpCBTitle.clear(); - mpCBSubtitle.clear(); - mpCBXAxis.clear(); - mpCBXAxisTitle.clear(); - mpCBYAxis.clear(); - mpCBYAxisTitle.clear(); - mpCBZAxis.clear(); - mpCBZAxisTitle.clear(); - mpCB2ndXAxis.clear(); - mpCB2ndXAxisTitle.clear(); - mpCB2ndYAxis.clear(); - mpCB2ndYAxisTitle.clear(); - mpCBLegend.clear(); - mpCBGridVerticalMajor.clear(); - mpCBGridHorizontalMajor.clear(); - mpCBGridVerticalMinor.clear(); - mpCBGridHorizontalMinor.clear(); - - mpLBLegendPosition.clear(); - mpBoxLegend.clear(); - - mpLBAxis.clear(); - mpLBGrid.clear(); - - mpTextTitle.clear(); - mpTextSubTitle.clear(); + mxCBTitle.reset(); + mxCBSubtitle.reset(); + mxCBXAxis.reset(); + mxCBXAxisTitle.reset(); + mxCBYAxis.reset(); + mxCBYAxisTitle.reset(); + mxCBZAxis.reset(); + mxCBZAxisTitle.reset(); + mxCB2ndXAxis.reset(); + mxCB2ndXAxisTitle.reset(); + mxCB2ndYAxis.reset(); + mxCB2ndYAxisTitle.reset(); + mxCBLegend.reset(); + mxCBGridVerticalMajor.reset(); + mxCBGridHorizontalMajor.reset(); + mxCBGridVerticalMinor.reset(); + mxCBGridHorizontalMinor.reset(); + + mxLBLegendPosition.reset(); + mxBoxLegend.reset(); + + mxLBAxis.reset(); + mxLBGrid.reset(); + + mxTextTitle.reset(); + mxTextSubTitle.reset(); PanelLayout::dispose(); } @@ -354,26 +347,26 @@ void ChartElementsPanel::Initialize() xBroadcaster->addModifyListener(mxListener); updateData(); - Link<Button*,void> aLink = LINK(this, ChartElementsPanel, CheckBoxHdl); - mpCBTitle->SetClickHdl(aLink); - mpCBSubtitle->SetClickHdl(aLink); - mpCBXAxis->SetClickHdl(aLink); - mpCBXAxisTitle->SetClickHdl(aLink); - mpCBYAxis->SetClickHdl(aLink); - mpCBYAxisTitle->SetClickHdl(aLink); - mpCBZAxis->SetClickHdl(aLink); - mpCBZAxisTitle->SetClickHdl(aLink); - mpCB2ndXAxis->SetClickHdl(aLink); - mpCB2ndXAxisTitle->SetClickHdl(aLink); - mpCB2ndYAxis->SetClickHdl(aLink); - mpCB2ndYAxisTitle->SetClickHdl(aLink); - mpCBLegend->SetClickHdl(aLink); - mpCBGridVerticalMajor->SetClickHdl(aLink); - mpCBGridHorizontalMajor->SetClickHdl(aLink); - mpCBGridVerticalMinor->SetClickHdl(aLink); - mpCBGridHorizontalMinor->SetClickHdl(aLink); - - mpLBLegendPosition->SetSelectHdl(LINK(this, ChartElementsPanel, LegendPosHdl)); + Link<weld::ToggleButton&,void> aLink = LINK(this, ChartElementsPanel, CheckBoxHdl); + mxCBTitle->connect_toggled(aLink); + mxCBSubtitle->connect_toggled(aLink); + mxCBXAxis->connect_toggled(aLink); + mxCBXAxisTitle->connect_toggled(aLink); + mxCBYAxis->connect_toggled(aLink); + mxCBYAxisTitle->connect_toggled(aLink); + mxCBZAxis->connect_toggled(aLink); + mxCBZAxisTitle->connect_toggled(aLink); + mxCB2ndXAxis->connect_toggled(aLink); + mxCB2ndXAxisTitle->connect_toggled(aLink); + mxCB2ndYAxis->connect_toggled(aLink); + mxCB2ndYAxisTitle->connect_toggled(aLink); + mxCBLegend->connect_toggled(aLink); + mxCBGridVerticalMajor->connect_toggled(aLink); + mxCBGridHorizontalMajor->connect_toggled(aLink); + mxCBGridVerticalMinor->connect_toggled(aLink); + mxCBGridHorizontalMinor->connect_toggled(aLink); + + mxLBLegendPosition->connect_changed(LINK(this, ChartElementsPanel, LegendPosHdl)); } namespace { @@ -414,71 +407,71 @@ void ChartElementsPanel::updateData() sal_Int32 nDimension = DiagramHelper::getDimension(xDiagram); SolarMutexGuard aGuard; - mpCBLegend->Check(isLegendVisible(mxModel)); - mpBoxLegend->Enable( isLegendVisible(mxModel) ); - mpCBTitle->Check(isTitleVisisble(mxModel, TitleHelper::MAIN_TITLE)); - mpCBSubtitle->Check(isTitleVisisble(mxModel, TitleHelper::SUB_TITLE)); - mpCBXAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::X_AXIS_TITLE)); - mpCBYAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::Y_AXIS_TITLE)); - mpCBZAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::Z_AXIS_TITLE)); - mpCB2ndXAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::SECONDARY_X_AXIS_TITLE)); - mpCB2ndYAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE)); - mpCBGridVerticalMajor->Check(isGridVisible(mxModel, GridType::VERT_MAJOR)); - mpCBGridHorizontalMajor->Check(isGridVisible(mxModel, GridType::HOR_MAJOR)); - mpCBGridVerticalMinor->Check(isGridVisible(mxModel, GridType::VERT_MINOR)); - mpCBGridHorizontalMinor->Check(isGridVisible(mxModel, GridType::HOR_MINOR)); - mpCBXAxis->Check(isAxisVisible(mxModel, AxisType::X_MAIN)); - mpCBYAxis->Check(isAxisVisible(mxModel, AxisType::Y_MAIN)); - mpCBZAxis->Check(isAxisVisible(mxModel, AxisType::Z_MAIN)); - mpCB2ndXAxis->Check(isAxisVisible(mxModel, AxisType::X_SECOND)); - mpCB2ndYAxis->Check(isAxisVisible(mxModel, AxisType::Y_SECOND)); + mxCBLegend->set_active(isLegendVisible(mxModel)); + mxBoxLegend->set_sensitive( isLegendVisible(mxModel) ); + mxCBTitle->set_active(isTitleVisisble(mxModel, TitleHelper::MAIN_TITLE)); + mxCBSubtitle->set_active(isTitleVisisble(mxModel, TitleHelper::SUB_TITLE)); + mxCBXAxisTitle->set_active(isTitleVisisble(mxModel, TitleHelper::X_AXIS_TITLE)); + mxCBYAxisTitle->set_active(isTitleVisisble(mxModel, TitleHelper::Y_AXIS_TITLE)); + mxCBZAxisTitle->set_active(isTitleVisisble(mxModel, TitleHelper::Z_AXIS_TITLE)); + mxCB2ndXAxisTitle->set_active(isTitleVisisble(mxModel, TitleHelper::SECONDARY_X_AXIS_TITLE)); + mxCB2ndYAxisTitle->set_active(isTitleVisisble(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE)); + mxCBGridVerticalMajor->set_active(isGridVisible(mxModel, GridType::VERT_MAJOR)); + mxCBGridHorizontalMajor->set_active(isGridVisible(mxModel, GridType::HOR_MAJOR)); + mxCBGridVerticalMinor->set_active(isGridVisible(mxModel, GridType::VERT_MINOR)); + mxCBGridHorizontalMinor->set_active(isGridVisible(mxModel, GridType::HOR_MINOR)); + mxCBXAxis->set_active(isAxisVisible(mxModel, AxisType::X_MAIN)); + mxCBYAxis->set_active(isAxisVisible(mxModel, AxisType::Y_MAIN)); + mxCBZAxis->set_active(isAxisVisible(mxModel, AxisType::Z_MAIN)); + mxCB2ndXAxis->set_active(isAxisVisible(mxModel, AxisType::X_SECOND)); + mxCB2ndYAxis->set_active(isAxisVisible(mxModel, AxisType::Y_SECOND)); bool bSupportsMainAxis = ChartTypeHelper::isSupportingMainAxis( getChartType(mxModel), 0, 0); if (bSupportsMainAxis) { - mpCBXAxis->Show(); - mpCBYAxis->Show(); - mpCBZAxis->Show(); - mpCBXAxisTitle->Show(); - mpCBYAxisTitle->Show(); - mpCBZAxisTitle->Show(); - mpCBGridVerticalMajor->Show(); - mpCBGridVerticalMinor->Show(); - mpCBGridHorizontalMajor->Show(); - mpCBGridHorizontalMinor->Show(); - mpLBAxis->Show(); - mpLBGrid->Show(); + mxCBXAxis->show(); + mxCBYAxis->show(); + mxCBZAxis->show(); + mxCBXAxisTitle->show(); + mxCBYAxisTitle->show(); + mxCBZAxisTitle->show(); + mxCBGridVerticalMajor->show(); + mxCBGridVerticalMinor->show(); + mxCBGridHorizontalMajor->show(); + mxCBGridHorizontalMinor->show(); + mxLBAxis->show(); + mxLBGrid->show(); } else { - mpCBXAxis->Hide(); - mpCBYAxis->Hide(); - mpCBZAxis->Hide(); - mpCBXAxisTitle->Hide(); - mpCBYAxisTitle->Hide(); - mpCBZAxisTitle->Hide(); - mpCBGridVerticalMajor->Hide(); - mpCBGridVerticalMinor->Hide(); - mpCBGridHorizontalMajor->Hide(); - mpCBGridHorizontalMinor->Hide(); - mpLBAxis->Hide(); - mpLBGrid->Hide(); + mxCBXAxis->hide(); + mxCBYAxis->hide(); + mxCBZAxis->hide(); + mxCBXAxisTitle->hide(); + mxCBYAxisTitle->hide(); + mxCBZAxisTitle->hide(); + mxCBGridVerticalMajor->hide(); + mxCBGridVerticalMinor->hide(); + mxCBGridHorizontalMajor->hide(); + mxCBGridHorizontalMinor->hide(); + mxLBAxis->hide(); + mxLBGrid->hide(); } if (nDimension == 3) { - mpCBZAxis->Enable(); - mpCBZAxisTitle->Enable(); + mxCBZAxis->set_sensitive(true); + mxCBZAxisTitle->set_sensitive(true); } else { - mpCBZAxis->Disable(); - mpCBZAxisTitle->Disable(); + mxCBZAxis->set_sensitive(false); + mxCBZAxisTitle->set_sensitive(false); } - mpLBLegendPosition->SelectEntryPos(getLegendPos(mxModel)); + mxLBLegendPosition->set_active(getLegendPos(mxModel)); } VclPtr<vcl::Window> ChartElementsPanel::Create ( @@ -534,52 +527,51 @@ void ChartElementsPanel::updateModel( xBroadcasterNew->addModifyListener(mxListener); } -IMPL_LINK(ChartElementsPanel, CheckBoxHdl, Button*, pButton, void) +IMPL_LINK(ChartElementsPanel, CheckBoxHdl, weld::ToggleButton&, rCheckBox, void) { - CheckBox* pCheckBox = static_cast<CheckBox*>(pButton); - bool bChecked = pCheckBox->IsChecked(); - if (pCheckBox == mpCBTitle.get()) + bool bChecked = rCheckBox.get_active(); + if (&rCheckBox == mxCBTitle.get()) setTitleVisible(TitleHelper::MAIN_TITLE, bChecked); - else if (pCheckBox == mpCBSubtitle.get()) + else if (&rCheckBox == mxCBSubtitle.get()) setTitleVisible(TitleHelper::SUB_TITLE, bChecked); - else if (pCheckBox == mpCBXAxis.get()) + else if (&rCheckBox == mxCBXAxis.get()) setAxisVisible(mxModel, AxisType::X_MAIN, bChecked); - else if (pCheckBox == mpCBXAxisTitle.get()) + else if (&rCheckBox == mxCBXAxisTitle.get()) setTitleVisible(TitleHelper::X_AXIS_TITLE, bChecked); - else if (pCheckBox == mpCBYAxis.get()) + else if (&rCheckBox == mxCBYAxis.get()) setAxisVisible(mxModel, AxisType::Y_MAIN, bChecked); - else if (pCheckBox == mpCBYAxisTitle.get()) + else if (&rCheckBox == mxCBYAxisTitle.get()) setTitleVisible(TitleHelper::Y_AXIS_TITLE, bChecked); - else if (pCheckBox == mpCBZAxis.get()) + else if (&rCheckBox == mxCBZAxis.get()) setAxisVisible(mxModel, AxisType::Z_MAIN, bChecked); - else if (pCheckBox == mpCBZAxisTitle.get()) + else if (&rCheckBox == mxCBZAxisTitle.get()) setTitleVisible(TitleHelper::Z_AXIS_TITLE, bChecked); - else if (pCheckBox == mpCB2ndXAxis.get()) + else if (&rCheckBox == mxCB2ndXAxis.get()) setAxisVisible(mxModel, AxisType::X_SECOND, bChecked); - else if (pCheckBox == mpCB2ndXAxisTitle.get()) + else if (&rCheckBox == mxCB2ndXAxisTitle.get()) setTitleVisible(TitleHelper::SECONDARY_X_AXIS_TITLE, bChecked); - else if (pCheckBox == mpCB2ndYAxis.get()) + else if (&rCheckBox == mxCB2ndYAxis.get()) setAxisVisible(mxModel, AxisType::Y_SECOND, bChecked); - else if (pCheckBox == mpCB2ndYAxisTitle.get()) + else if (&rCheckBox == mxCB2ndYAxisTitle.get()) setTitleVisible(TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked); - else if (pCheckBox == mpCBLegend.get()) + else if (&rCheckBox == mxCBLegend.get()) { - mpBoxLegend->Enable( bChecked ); + mxBoxLegend->set_sensitive( bChecked ); setLegendVisible(mxModel, bChecked); } - else if (pCheckBox == mpCBGridVerticalMajor.get()) + else if (&rCheckBox == mxCBGridVerticalMajor.get()) setGridVisible(mxModel, GridType::VERT_MAJOR, bChecked); - else if (pCheckBox == mpCBGridHorizontalMajor.get()) + else if (&rCheckBox == mxCBGridHorizontalMajor.get()) setGridVisible(mxModel, GridType::HOR_MAJOR, bChecked); - else if (pCheckBox == mpCBGridVerticalMinor.get()) + else if (&rCheckBox == mxCBGridVerticalMinor.get()) setGridVisible(mxModel, GridType::VERT_MINOR, bChecked); - else if (pCheckBox == mpCBGridHorizontalMinor.get()) + else if (&rCheckBox == mxCBGridHorizontalMinor.get()) setGridVisible(mxModel, GridType::HOR_MINOR, bChecked); } -IMPL_LINK_NOARG(ChartElementsPanel, LegendPosHdl, ListBox&, void) +IMPL_LINK_NOARG(ChartElementsPanel, LegendPosHdl, weld::ComboBox&, void) { - sal_Int32 nPos = mpLBLegendPosition->GetSelectedEntryPos(); + sal_Int32 nPos = mxLBLegendPosition->get_active(); setLegendPos(mxModel, nPos); } diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx index eca293645cc4..9c145f5b078a 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx @@ -22,14 +22,11 @@ #include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <sfx2/sidebar/SidebarModelUpdate.hxx> #include <svx/sidebar/PanelLayout.hxx> -#include <vcl/layout.hxx> #include "ChartSidebarModifyListener.hxx" #include <TitleHelper.hxx> namespace com { namespace sun { namespace star { namespace util { class XModifyListener; } } } } -class ListBox; - namespace chart { class ChartController; @@ -70,30 +67,30 @@ public: private: //ui controls - VclPtr<CheckBox> mpCBTitle; - VclPtr<CheckBox> mpCBSubtitle; - VclPtr<CheckBox> mpCBXAxis; - VclPtr<CheckBox> mpCBXAxisTitle; - VclPtr<CheckBox> mpCBYAxis; - VclPtr<CheckBox> mpCBYAxisTitle; - VclPtr<CheckBox> mpCBZAxis; - VclPtr<CheckBox> mpCBZAxisTitle; - VclPtr<CheckBox> mpCB2ndXAxis; - VclPtr<CheckBox> mpCB2ndXAxisTitle; - VclPtr<CheckBox> mpCB2ndYAxis; - VclPtr<CheckBox> mpCB2ndYAxisTitle; - VclPtr<CheckBox> mpCBLegend; - VclPtr<CheckBox> mpCBGridVerticalMajor; - VclPtr<CheckBox> mpCBGridHorizontalMajor; - VclPtr<CheckBox> mpCBGridVerticalMinor; - VclPtr<CheckBox> mpCBGridHorizontalMinor; - VclPtr<FixedText> mpTextTitle; - VclPtr<FixedText> mpTextSubTitle; - VclPtr<FixedText> mpLBAxis; - VclPtr<FixedText> mpLBGrid; - - VclPtr<ListBox> mpLBLegendPosition; - VclPtr<VclHBox> mpBoxLegend; + std::unique_ptr<weld::CheckButton> mxCBTitle; + std::unique_ptr<weld::CheckButton> mxCBSubtitle; + std::unique_ptr<weld::CheckButton> mxCBXAxis; + std::unique_ptr<weld::CheckButton> mxCBXAxisTitle; + std::unique_ptr<weld::CheckButton> mxCBYAxis; + std::unique_ptr<weld::CheckButton> mxCBYAxisTitle; + std::unique_ptr<weld::CheckButton> mxCBZAxis; + std::unique_ptr<weld::CheckButton> mxCBZAxisTitle; + std::unique_ptr<weld::CheckButton> mxCB2ndXAxis; + std::unique_ptr<weld::CheckButton> mxCB2ndXAxisTitle; + std::unique_ptr<weld::CheckButton> mxCB2ndYAxis; + std::unique_ptr<weld::CheckButton> mxCB2ndYAxisTitle; + std::unique_ptr<weld::CheckButton> mxCBLegend; + std::unique_ptr<weld::CheckButton> mxCBGridVerticalMajor; + std::unique_ptr<weld::CheckButton> mxCBGridHorizontalMajor; + std::unique_ptr<weld::CheckButton> mxCBGridVerticalMinor; + std::unique_ptr<weld::CheckButton> mxCBGridHorizontalMinor; + std::unique_ptr<weld::Label> mxTextTitle; + std::unique_ptr<weld::Label> mxTextSubTitle; + std::unique_ptr<weld::Label> mxLBAxis; + std::unique_ptr<weld::Label> mxLBGrid; + + std::unique_ptr<weld::ComboBox> mxLBLegendPosition; + std::unique_ptr<weld::Widget> mxBoxLegend; vcl::EnumContext maContext; @@ -109,8 +106,8 @@ private: void setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible); - DECL_LINK(CheckBoxHdl, Button*, void); - DECL_LINK(LegendPosHdl, ListBox&, void); + DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void); + DECL_LINK(LegendPosHdl, weld::ComboBox&, void); }; } } // end of namespace ::chart::sidebar diff --git a/chart2/uiconfig/ui/sidebarelements.ui b/chart2/uiconfig/ui/sidebarelements.ui index c4ec4cd49e2d..75b25d41ba6d 100644 --- a/chart2/uiconfig/ui/sidebarelements.ui +++ b/chart2/uiconfig/ui/sidebarelements.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="chart"> <requires lib="gtk+" version="3.18"/> <object class="GtkGrid" id="ChartElementsPanel"> @@ -9,9 +9,9 @@ <object class="GtkBox" id="container"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="border_width">6</property> <property name="orientation">vertical</property> <property name="spacing">6</property> - <property name="border_width">6</property> <child> <object class="GtkFrame" id="frame1"> <property name="visible">True</property> @@ -99,14 +99,14 @@ <property name="can_focus">False</property> <child> <object class="GtkCheckButton" id="checkbutton_legend"> - <property name="tooltip_text" translatable="yes" context="sidebarelements|checkbutton_legend|tooltip_text">Show Legend</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="tooltip_text" translatable="yes" context="sidebarelements|checkbutton_legend|tooltip_text">Show Legend</property> + <property name="margin_right">5</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> - <property name="margin_right">5</property> </object> <packing> <property name="left_attach">0</property> @@ -469,6 +469,7 @@ <child> <object class="GtkLabel" id="text_title"> <property name="can_focus">False</property> + <property name="no_show_all">True</property> <property name="label" translatable="yes" context="sidebarelements|text_title">Title</property> </object> <packing> @@ -479,6 +480,7 @@ <child> <object class="GtkLabel" id="text_subtitle"> <property name="can_focus">False</property> + <property name="no_show_all">True</property> <property name="label" translatable="yes" context="sidebarelements|text_subtitle">Subtitle</property> </object> <packing> @@ -496,12 +498,9 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">0</property> </packing> </child> - <child> - <placeholder/> - </child> </object> <object class="GtkSizeGroup" id="sizegroup1"> <widgets> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits