[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - 3 commits - chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk officecfg/registry Repository.mk
Markus Mohrhard (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 14 21:25:23 UTC 2019
Repository.mk | 4
chart2/Library_chartcontroller.mk | 1
chart2/UIConfig_chart2.mk | 1
chart2/source/controller/sidebar/Chart2PanelFactory.cxx | 3
chart2/source/controller/sidebar/ChartStylesPanel.cxx | 69 ++++++
chart2/source/controller/sidebar/ChartStylesPanel.hxx | 90 ++++++++
chart2/uiconfig/ui/sidebarstyle.ui | 111 +++++++++++
officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu | 41 +++-
8 files changed, 313 insertions(+), 7 deletions(-)
New commits:
commit 8fb2808b35a60771ec72cc9ad01cfde17e2f102a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Thu Aug 15 04:12:11 2019 +0800
Commit: Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Thu Aug 15 04:12:11 2019 +0800
don't force huge control size
Change-Id: I9b42a8b16a333b0833d8444cdc70f32455859028
diff --git a/chart2/source/controller/sidebar/ChartStylesPanel.cxx b/chart2/source/controller/sidebar/ChartStylesPanel.cxx
index 13cdd32c65e7..82976b5b1e44 100644
--- a/chart2/source/controller/sidebar/ChartStylesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartStylesPanel.cxx
@@ -34,7 +34,6 @@ ChartStylesPanel::ChartStylesPanel(vcl::Window* pParent,
get(aDefaultButton, "setdefault");
get(aDeleteButton, "deletestyle");
- aStyleList->set_height_request(45 * aStyleList->GetTextHeight());
Link<ListBox&, void> aLink = LINK(this, ChartStylesPanel, SelHdl);
Link<Button*, void> aLink2 = LINK(this, ChartStylesPanel, SetSelectionClickHdl);
commit 3c1a4c172426e573a8f231c15c27ff5cc3d37302
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Thu Aug 15 04:10:47 2019 +0800
Commit: Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Thu Aug 15 04:10:47 2019 +0800
make sure the ChartStyles panel shows up in chart sidebar
Change-Id: I8c6cef96d12a97fb8246efc5186d02c5f26733eb
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index e9e206a470c7..05a7789b5db7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -292,26 +292,6 @@
</prop>
</node>
- <node oor:name="ChartStylesDeck" oor:op="replace">
- <prop oor:name="Title" oor:type="xs:string">
- <value xml:lang="en-US">Chart Styles</value>
- </prop>
- <prop oor:name="Id" oor:type="xs:string">
- <value>ChartStylesDeck</value>
- </prop>
- <prop oor:name="IconURL" oor:type="xs:string">
- <value>private:graphicrepository/sfx2/res/symphony/sidebar-style-large.png</value>
- </prop>
- <prop oor:name="ContextList">
- <value oor:separator=";">
- Chart, any, visible ;
- </value>
- </prop>
- <prop oor:name="OrderIndex" oor:type="xs:int">
- <value>10</value>
- </prop>
- </node>
-
</node>
<node oor:name="PanelList">
@@ -1431,7 +1411,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/SeriesPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>2</value>
+ <value>3</value>
</prop>
</node>
@@ -1454,7 +1434,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/TrendlinePanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>3</value>
+ <value>4</value>
</prop>
</node>
@@ -1480,7 +1460,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/ErrorBarPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>4</value>
+ <value>5</value>
</prop>
</node>
@@ -1506,7 +1486,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/AxisPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>5</value>
+ <value>6</value>
</prop>
</node>
@@ -1533,7 +1513,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/AreaPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>6</value>
+ <value>7</value>
</prop>
</node>
@@ -1564,7 +1544,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/LinePanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>7</value>
+ <value>8</value>
</prop>
</node>
@@ -1587,7 +1567,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/CharacterPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>8</value>
+ <value>9</value>
</prop>
</node>
@@ -1602,7 +1582,7 @@
<value>ChartStylesPanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
- <value>ChartStylesDeck</value>
+ <value>ChartDeck</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
@@ -1613,7 +1593,7 @@
<value>private:resource/toolpanel/ChartPanelFactory/ChartStylesPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
- <value>1</value>
+ <value>2</value>
</prop>
</node>
commit 16f447d6232d34a5c665b81ef53c15250849044a
Author: Gagandeep Singh <deepgagan231197 at gmail.com>
AuthorDate: Fri May 3 16:51:51 2019 +0530
Commit: Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Thu Aug 15 03:29:06 2019 +0800
Chart Styles : Added a list box for chart Style in sidebar
Just a GUI update for help in testing chart styles
Change-Id: If7990af383e73996e42ce756c46a8d69d3ab95f3
diff --git a/Repository.mk b/Repository.mk
index d292bd461201..0f5606f12da3 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -835,6 +835,10 @@ $(eval $(call gb_Helper_register_packages_for_install,calc,\
sc_res_xml \
))
+$(eval $(call gb_Helper_register_packages_for_install,chart2,\
+ chart2_res_xml \
+))
+
$(eval $(call gb_Helper_register_packages_for_install,libreofficekit,\
$(if $(filter LINUX %BSD SOLARIS, $(OS)),libreofficekit_selectionhandles) \
))
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 02c8bcb75774..2009595e63cb 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -193,6 +193,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/sidebar/ChartErrorBarPanel \
chart2/source/controller/sidebar/ChartLinePanel \
chart2/source/controller/sidebar/ChartSeriesPanel \
+ chart2/source/controller/sidebar/ChartStylesPanel \
chart2/source/controller/sidebar/ChartSidebarModifyListener \
chart2/source/controller/sidebar/ChartSidebarSelectionListener \
chart2/source/controller/uitest/uiobject \
diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk
index 59847fedc348..4512884b0d26 100644
--- a/chart2/UIConfig_chart2.mk
+++ b/chart2/UIConfig_chart2.mk
@@ -51,6 +51,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/sidebarelements \
chart2/uiconfig/ui/sidebarerrorbar \
chart2/uiconfig/ui/sidebarseries \
+ chart2/uiconfig/ui/sidebarstyle \
chart2/uiconfig/ui/smoothlinesdlg \
chart2/uiconfig/ui/steppedlinesdlg \
chart2/uiconfig/ui/titlerotationtabpage \
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 005aff6ebd5c..a9dec86803fc 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -34,6 +34,7 @@
#include "ChartErrorBarPanel.hxx"
#include "ChartAreaPanel.hxx"
#include "ChartLinePanel.hxx"
+#include "ChartStylesPanel.hxx"
using namespace css::uno;
@@ -94,6 +95,8 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
pPanel = ChartAreaPanel::Create(pParentWindow, xFrame, pController);
else if (rsResourceURL.endsWith("/LinePanel"))
pPanel = ChartLinePanel::Create(pParentWindow, xFrame, pController);
+ else if (rsResourceURL.endsWith("/ChartStylesPanel"))
+ pPanel = ChartStylesPanel::Create(pParentWindow, xFrame);
if (pPanel)
xElement = sfx2::sidebar::SidebarPanelBase::Create(
diff --git a/chart2/source/controller/sidebar/ChartStylesPanel.cxx b/chart2/source/controller/sidebar/ChartStylesPanel.cxx
new file mode 100644
index 000000000000..13cdd32c65e7
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartStylesPanel.cxx
@@ -0,0 +1,70 @@
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <vcl/lstbox.hxx>
+#include <vcl/button.hxx>
+
+#include "ChartStylesPanel.hxx"
+
+using namespace css;
+using namespace css::uno;
+
+namespace chart
+{
+namespace sidebar
+{
+VclPtr<vcl::Window> ChartStylesPanel::Create(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
+{
+ if (pParent == nullptr)
+ throw lang::IllegalArgumentException("no parent Window given to ChartStylesPanel::Create",
+ nullptr, 0);
+ if (!rxFrame.is())
+ throw lang::IllegalArgumentException("no XFrame given to ChartStylesPanel::Create", nullptr,
+ 1);
+
+ return VclPtr<ChartStylesPanel>::Create(pParent, rxFrame);
+}
+
+ChartStylesPanel::ChartStylesPanel(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
+ : PanelLayout(pParent, "ChartStylesPanel", "modules/schart/ui/sidebarstyle.ui", rxFrame)
+{
+ get(aStyleList, "stylelist");
+ get(aApplyButton, "setstyle");
+ get(aNewButton, "createstyle");
+ get(aDefaultButton, "setdefault");
+ get(aDeleteButton, "deletestyle");
+
+ aStyleList->set_height_request(45 * aStyleList->GetTextHeight());
+ Link<ListBox&, void> aLink = LINK(this, ChartStylesPanel, SelHdl);
+ Link<Button*, void> aLink2 = LINK(this, ChartStylesPanel, SetSelectionClickHdl);
+
+ aStyleList->SetSelectHdl(aLink);
+ aStyleList->SetDoubleClickHdl(LINK(this, ChartStylesPanel, SetSelectionHdl));
+ aApplyButton->SetClickHdl(aLink2);
+ aNewButton->SetClickHdl(aLink2);
+ aDefaultButton->SetClickHdl(aLink2);
+ aDeleteButton->SetClickHdl(aLink2);
+}
+
+ChartStylesPanel::~ChartStylesPanel() { disposeOnce(); }
+
+void ChartStylesPanel::dispose()
+{
+ aStyleList.clear();
+ aDefaultButton.clear();
+ aApplyButton.clear();
+ aNewButton.clear();
+ aDeleteButton.clear();
+ PanelLayout::dispose();
+}
+
+void ChartStylesPanel::UpdateList() {}
+
+IMPL_LINK_NOARG(ChartStylesPanel, SelHdl, ListBox&, void) {}
+
+IMPL_LINK_NOARG(ChartStylesPanel, SetSelectionClickHdl, Button*, void) {}
+
+IMPL_LINK_NOARG(ChartStylesPanel, SetSelectionHdl, ListBox&, void) {}
+
+} // namespace sidebar
+} // namespace chart
diff --git a/chart2/source/controller/sidebar/ChartStylesPanel.hxx b/chart2/source/controller/sidebar/ChartStylesPanel.hxx
new file mode 100644
index 000000000000..610d6ce58bec
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartStylesPanel.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTSTYLESPANEL_HXX
+#define INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTSTYLESPANEL_HXX
+
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <vcl/EnumContext.hxx>
+#include <svtools/ctrlbox.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <com/sun/star/ui/XUIElement.hpp>
+#include <com/sun/star/ui/XSidebar.hpp>
+
+#include <vcl/lstbox.hxx>
+#include <vcl/button.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
+
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace util
+{
+class XModifyListener;
+}
+} // namespace star
+} // namespace sun
+} // namespace com
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace view
+{
+class XSelectionChangeListener;
+}
+} // namespace star
+} // namespace sun
+} // namespace com
+
+namespace chart
+{
+class ChartController;
+
+namespace sidebar
+{
+class ChartStylesPanel : public PanelLayout
+{
+private:
+ VclPtr<ListBox> aStyleList;
+ VclPtr<PushButton> aApplyButton;
+ VclPtr<PushButton> aNewButton;
+ VclPtr<PushButton> aDefaultButton;
+ VclPtr<PushButton> aDeleteButton;
+
+ DECL_LINK(SetSelectionHdl, ListBox&, void);
+ DECL_LINK(SetSelectionClickHdl, Button*, void);
+ DECL_LINK(SelHdl, ListBox&, void);
+
+ void UpdateList();
+
+public:
+ static VclPtr<vcl::Window> Create(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ // constructor/destructor
+ ChartStylesPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ virtual ~ChartStylesPanel() override;
+ virtual void dispose() override;
+};
+
+} // namespace sidebar
+} // namespace chart
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/uiconfig/ui/sidebarstyle.ui b/chart2/uiconfig/ui/sidebarstyle.ui
new file mode 100644
index 000000000000..36eceae2c805
--- /dev/null
+++ b/chart2/uiconfig/ui/sidebarstyle.ui
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface domain="chart2">
+ <requires lib="gtk+" version="3.18"/>
+ <object class="GtkGrid" id="FunctionPanel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkPaned" id="splitter">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="wide_handle">True</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkButton" id="setdefault">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes" context="stylepanel|setdefault|tooltip_text">Set the Selected Style for all Charts</property>
+ <property name="label">Default</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="setstyle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes" context="stylepanel|setstyle|tooltip_text">Set the Selected Style for Selected Chart</property>
+ <property name="label">Set</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="createstyle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes" context="stylepanel|createstyle|tooltip_text">Create a New style from the Selected Chart</property>
+ <property name="label">New</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="deletestyle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes" context="stylepanel|deletestyle|tooltip_text">Delete the style Selected in List</property>
+ <property name="label">Delete</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</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="GtkTreeView" id="stylelist:border">
+ <property name="name">styles</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="expand">True</property>
+ <property name="show_expanders">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 5d3c698d975c..e9e206a470c7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -292,6 +292,26 @@
</prop>
</node>
+ <node oor:name="ChartStylesDeck" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Chart Styles</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartStylesDeck</value>
+ </prop>
+ <prop oor:name="IconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-style-large.png</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>10</value>
+ </prop>
+ </node>
+
</node>
<node oor:name="PanelList">
@@ -1570,6 +1590,33 @@
<value>8</value>
</prop>
</node>
+
+ <node oor:name="ChartStylesPanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Chart Styles</value>
+ </prop>
+ <prop oor:name="TitleBarIsOptional" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartStylesPanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>ChartStylesDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/ChartPanelFactory/ChartStylesPanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+
</node>
</node>
</oor:component-data>
More information about the Libreoffice-commits
mailing list