diff options
author | Shivam Kumar Singh <shivamhere247@gmail.com> | 2020-06-26 17:03:52 +0530 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-03 09:43:26 +0200 |
commit | 4b8abb3db70ab5af3a9e92a327b46bbf38a481b3 (patch) | |
tree | 1a73938edba316828c9180b2a751114d7c194040 /svx | |
parent | 006572e4d808e95a6624d0c5f37be8b8d14449ce (diff) |
Added tree view for Inspector and support for PS
-> The support for PS has been added.
-> The UI for Inspector has been updated with
expand/collapse buttons for PS and CS.
-> Any property is listed only once at the Inspector
either at PS or at CS
-> Hide any property having default value
(only modified properties are of interest)
-> Hide Asian and Complex Properties
Change-Id: I3b519eef7a5699339608fdb8c29d6f04498f4346
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97263
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/inspector/InspectorTextPanel.cxx | 30 | ||||
-rw-r--r-- | svx/uiconfig/ui/inspectortextpanel.ui | 1 |
2 files changed, 26 insertions, 5 deletions
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index 07ab0ab38ca4..906ca736a91a 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -44,14 +44,36 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame) , mxListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts")) { - mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(10)); + mxListBoxStyles->set_size_request(-1, mxListBoxStyles->get_height_rows(27)); } -void InspectorTextPanel::updateEntries(std::vector<OUString> store) +static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& current, + weld::TreeIter* pParent) { + std::unique_ptr<weld::TreeIter> pResult = rListBoxStyles.make_iterator(); + const OUString& rName = current.sNodeName; + rListBoxStyles.insert(pParent, -1, &rName, nullptr, nullptr, nullptr, false, pResult.get()); + + for (const TreeNode& ChildNode : current.children) + FillBox_Impl(rListBoxStyles, ChildNode, pResult.get()); +} + +void InspectorTextPanel::updateEntries(const std::vector<TreeNode>& rStore) +{ + mxListBoxStyles->freeze(); mxListBoxStyles->clear(); - for (OUString& str : store) - mxListBoxStyles->append_text(str); + for (const TreeNode& ChildNode : rStore) + { + FillBox_Impl(*mxListBoxStyles, ChildNode, nullptr); + } + + mxListBoxStyles->thaw(); + + weld::TreeView* pTreeDiagram = mxListBoxStyles.get(); + pTreeDiagram->all_foreach([pTreeDiagram](weld::TreeIter& rEntry) { + pTreeDiagram->expand_row(rEntry); + return false; + }); } InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); } diff --git a/svx/uiconfig/ui/inspectortextpanel.ui b/svx/uiconfig/ui/inspectortextpanel.ui index 726a3d840dc6..af7c5cbe2ed5 100644 --- a/svx/uiconfig/ui/inspectortextpanel.ui +++ b/svx/uiconfig/ui/inspectortextpanel.ui @@ -46,7 +46,6 @@ <property name="headers_visible">False</property> <property name="headers_clickable">False</property> <property name="search_column">0</property> - <property name="show_expanders">False</property> <child internal-child="selection"> <object class="GtkTreeSelection"/> </child> |