chart2/source/controller/sidebar/ChartElementsPanel.cxx | 44 +++++++++++++- chart2/source/controller/sidebar/ChartElementsPanel.hxx | 3 + chart2/uiconfig/ui/sidebarelements.ui | 47 +++++++++++++--- vcl/source/control/ivctrl.cxx | 1 4 files changed, 86 insertions(+), 9 deletions(-)
New commits: commit ca35aea6ed6481c4b090eff2258412684b3e7099 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Wed Oct 14 16:18:17 2020 +0200 Commit: Jan Holesovsky <ke...@collabora.com> CommitDate: Fri Nov 13 14:33:45 2020 +0100 chart2: Add the possibility to edit title & subtitle from the sidebar. Change-Id: I4be15acbc2127ebb6eca8864a0209ba57b488100 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104313 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105736 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <ke...@collabora.com> diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx index 1c7e60157aef..4158924fbfb0 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx @@ -302,7 +302,9 @@ ChartElementsPanel::ChartElementsPanel( ChartController* pController) : PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame) , mxCBTitle(m_xBuilder->weld_check_button("checkbutton_title")) + , mxEditTitle(m_xBuilder->weld_entry("edit_title")) , mxCBSubtitle(m_xBuilder->weld_check_button("checkbutton_subtitle")) + , mxEditSubtitle(m_xBuilder->weld_entry("edit_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")) @@ -346,7 +348,9 @@ void ChartElementsPanel::dispose() css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW); xBroadcaster->removeModifyListener(mxListener); mxCBTitle.reset(); + mxEditTitle.reset(); mxCBSubtitle.reset(); + mxEditSubtitle.reset(); mxCBXAxis.reset(); mxCBXAxisTitle.reset(); mxCBYAxis.reset(); @@ -403,6 +407,10 @@ void ChartElementsPanel::Initialize() mxCBGridHorizontalMinor->connect_toggled(aLink); mxLBLegendPosition->connect_changed(LINK(this, ChartElementsPanel, LegendPosHdl)); + + Link<weld::Entry&, void> aEditLink = LINK(this, ChartElementsPanel, EditHdl); + mxEditTitle->connect_changed(aEditLink); + mxEditSubtitle->connect_changed(aEditLink); } namespace { @@ -447,8 +455,27 @@ void ChartElementsPanel::updateData() mxCBLegendNoOverlay->set_sensitive(isLegendVisible(mxModel)); mxCBLegendNoOverlay->set_active(!isLegendOverlay(mxModel)); mxBoxLegend->set_sensitive(isLegendVisible(mxModel)); - mxCBTitle->set_active(isTitleVisible(mxModel, TitleHelper::MAIN_TITLE)); - mxCBSubtitle->set_active(isTitleVisible(mxModel, TitleHelper::SUB_TITLE)); + + bool hasTitle = isTitleVisible(mxModel, TitleHelper::MAIN_TITLE); + mxCBTitle->set_active(hasTitle); + + OUString title = mxEditTitle->get_text(); + OUString newTitle = TitleHelper::getCompleteString(TitleHelper::getTitle(TitleHelper::MAIN_TITLE, mxModel)); + if (title != newTitle) + mxEditTitle->set_text(newTitle); + if (mxEditTitle->get_sensitive() != hasTitle) + mxEditTitle->set_sensitive(hasTitle); + + bool hasSubtitle = isTitleVisible(mxModel, TitleHelper::SUB_TITLE); + mxCBSubtitle->set_active(hasSubtitle); + + OUString subtitle = mxEditSubtitle->get_text(); + OUString newSubtitle = TitleHelper::getCompleteString(TitleHelper::getTitle(TitleHelper::SUB_TITLE, mxModel)); + if (subtitle != newSubtitle) + mxEditSubtitle->set_text(newSubtitle); + if (mxEditSubtitle->get_sensitive() != hasSubtitle) + mxEditSubtitle->set_sensitive(hasSubtitle); + mxCBXAxisTitle->set_active(isTitleVisible(mxModel, TitleHelper::X_AXIS_TITLE)); mxCBYAxisTitle->set_active(isTitleVisible(mxModel, TitleHelper::Y_AXIS_TITLE)); mxCBZAxisTitle->set_active(isTitleVisible(mxModel, TitleHelper::Z_AXIS_TITLE)); @@ -464,7 +491,6 @@ void ChartElementsPanel::updateData() 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) @@ -610,6 +636,18 @@ IMPL_LINK(ChartElementsPanel, CheckBoxHdl, weld::ToggleButton&, rCheckBox, void) setGridVisible(mxModel, GridType::HOR_MINOR, bChecked); } +IMPL_LINK(ChartElementsPanel, EditHdl, weld::Entry&, rEdit, void) +{ + // title or subtitle? + TitleHelper::eTitleType aTitleType = TitleHelper::MAIN_TITLE; + if (&rEdit == mxEditSubtitle.get()) + aTitleType = TitleHelper::SUB_TITLE; + + // set it + OUString aText(rEdit.get_text()); + TitleHelper::setCompleteString(aText, TitleHelper::getTitle(aTitleType, mxModel), comphelper::getProcessComponentContext()); +} + IMPL_LINK_NOARG(ChartElementsPanel, LegendPosHdl, weld::ComboBox&, void) { sal_Int32 nPos = mxLBLegendPosition->get_active(); diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx index 688e23d72bf9..059e7c4fe122 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx @@ -68,7 +68,9 @@ public: private: //ui controls std::unique_ptr<weld::CheckButton> mxCBTitle; + std::unique_ptr<weld::Entry> mxEditTitle; std::unique_ptr<weld::CheckButton> mxCBSubtitle; + std::unique_ptr<weld::Entry> mxEditSubtitle; std::unique_ptr<weld::CheckButton> mxCBXAxis; std::unique_ptr<weld::CheckButton> mxCBXAxisTitle; std::unique_ptr<weld::CheckButton> mxCBYAxis; @@ -108,6 +110,7 @@ private: void setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible); DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void); + DECL_LINK(EditHdl, weld::Entry&, void); DECL_LINK(LegendPosHdl, weld::ComboBox&, void); }; diff --git a/chart2/uiconfig/ui/sidebarelements.ui b/chart2/uiconfig/ui/sidebarelements.ui index e1f1b51966a1..bcbcb5106c0a 100644 --- a/chart2/uiconfig/ui/sidebarelements.ui +++ b/chart2/uiconfig/ui/sidebarelements.ui @@ -16,6 +16,7 @@ <object class="GtkFrame" id="frame1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="label_xalign">0</property> <property name="shadow_type">none</property> <child> @@ -31,33 +32,67 @@ <property name="row_spacing">6</property> <property name="column_spacing">6</property> <child> - <object class="GtkCheckButton" id="checkbutton_subtitle"> - <property name="label" translatable="yes" context="sidebarelements|checkbutton_subtitle">Subtitle</property> + <object class="GtkCheckButton" id="checkbutton_title"> + <property name="label" translatable="yes" context="sidebarelements|checkbutton_title">Title</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> + <accessibility> + <relation type="label-for" target="edit_title"/> + </accessibility> </object> <packing> - <property name="left_attach">1</property> + <property name="left_attach">0</property> <property name="top_attach">0</property> </packing> </child> <child> - <object class="GtkCheckButton" id="checkbutton_title"> - <property name="label" translatable="yes" context="sidebarelements|checkbutton_title">Title</property> + <object class="GtkCheckButton" id="checkbutton_subtitle"> + <property name="label" translatable="yes" context="sidebarelements|checkbutton_subtitle">Subtitle</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> + <accessibility> + <relation type="label-for" target="edit_subtitle"/> + </accessibility> </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="edit_title"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <accessibility> + <relation type="labelled-by" target="checkbutton_title"/> + </accessibility> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="edit_subtitle"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <accessibility> + <relation type="labelled-by" target="checkbutton_subtitle"/> + </accessibility> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> </packing> </child> </object> commit de34c45a8ac1f7f1264d8ef649e7b7ee5ab1d2ec Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Nov 12 14:46:03 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Nov 13 14:33:30 2020 +0100 tdf#131970 enable tab-cycling between VerticalTabControl members Change-Id: I7d009c2345cc7b3a3c692bb8734d9939ce465db2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105761 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 5ce9b84e1f85..dc304e511937 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -438,6 +438,7 @@ VerticalTabControl::VerticalTabControl(vcl::Window* pParent) WB_ALIGN_LEFT | WB_NOHSCROLL)) , m_xBox(VclPtr<VclVBox>::Create(this)) { + SetStyle(GetStyle() | WB_DIALOGCONTROL); SetType(WindowType::VERTICALTABCONTROL); m_xChooser->SetClickHdl(LINK(this, VerticalTabControl, ChosePageHdl_Impl)); m_xChooser->set_width_request(110); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits