summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-05 21:01:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-19 14:05:41 +0100
commit5e0c3fd7a42f93489a3d59a83bad2a72de1af63c (patch)
treef0f6fa97722200d82d3d04c5da5fd0ec594e272c /chart2
parent6fe56989cfe0c4aa58cd8532db9cfdb5116f2a73 (diff)
weld TreeView
a) use GtkTreeStores for GtkTreeViews b) ironically can't store GtkTreeStore contents in .ui apparently c) set show_expanders for all non-trees and unconverted cases d) on-demand subtrees Change-Id: I3c1036a222daba2c129b1a22ffeb3fe35005ae31 Reviewed-on: https://gerrit.libreoffice.org/63558 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/inc/chart.hrc25
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.cxx4
-rw-r--r--chart2/uiconfig/ui/tp_ChartType.ui18
3 files changed, 31 insertions, 16 deletions
diff --git a/chart2/inc/chart.hrc b/chart2/inc/chart.hrc
new file mode 100644
index 000000000000..8a1195635930
--- /dev/null
+++ b/chart2/inc/chart.hrc
@@ -0,0 +1,25 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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_CHART_INC_CHART_HRC
+#define INCLUDED_CHART_INC_CHART_HRC
+
+#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+
+const char* CHART_TYPE[] =
+{
+ NC_("tp_ChartType|liststore1", "Bar"),
+ NC_("tp_ChartType|liststore1", "Cylinder"),
+ NC_("tp_ChartType|liststore1", "Cone"),
+ NC_("tp_ChartType|liststore1", "Pyramid")
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx
index 132422b5d17f..d067ae711978 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.cxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx
@@ -19,6 +19,8 @@
#include "res_BarGeometry.hxx"
#include <vcl/builder.hxx>
+#include <ResId.hxx>
+#include <chart.hrc>
namespace chart
{
@@ -27,6 +29,8 @@ BarGeometryResources::BarGeometryResources(weld::Builder* pBuilder)
: m_xFT_Geometry(pBuilder->weld_label("shapeft"))
, m_xLB_Geometry(pBuilder->weld_tree_view("shape"))
{
+ for (size_t i = 0; i < SAL_N_ELEMENTS(CHART_TYPE); ++i)
+ m_xLB_Geometry->append_text(SchResId(CHART_TYPE[i]));
m_xLB_Geometry->set_size_request(-1, m_xLB_Geometry->get_height_rows(4));
}
diff --git a/chart2/uiconfig/ui/tp_ChartType.ui b/chart2/uiconfig/ui/tp_ChartType.ui
index 987a7097d9e7..9e00c321d4ff 100644
--- a/chart2/uiconfig/ui/tp_ChartType.ui
+++ b/chart2/uiconfig/ui/tp_ChartType.ui
@@ -9,29 +9,15 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="liststore1">
+ <object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
- <data>
- <row>
- <col id="0" translatable="yes" context="tp_ChartType|liststore1">Bar</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="tp_ChartType|liststore1">Cylinder</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="tp_ChartType|liststore1">Cone</col>
- </row>
- <row>
- <col id="0" translatable="yes" context="tp_ChartType|liststore1">Pyramid</col>
- </row>
- </data>
</object>
- <object class="GtkListStore" id="liststore2">
+ <object class="GtkTreeStore" id="liststore2">
<columns>
<!-- column-name text -->
<column type="gchararray"/>