include/vcl/weld.hxx | 6 +++++- vcl/unx/gtk3/gtk3gtkinst.cxx | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-)
New commits: commit 1138c3d51a2e5caea7832597c00c62918299a3d7 Author: Caolán McNamara <[email protected]> AuthorDate: Wed Aug 12 15:59:40 2020 +0100 Commit: Adolfo Jayme Barrientos <[email protected]> CommitDate: Thu Aug 13 01:26:17 2020 +0200 tdf#135640 ensure parent rows are expanded on scolling to make a row visible Change-Id: I37e55ed8d0d3d5916950228ba78982b90356fbc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100516 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index cae26c1ffccf..33138aae57c2 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -935,7 +935,9 @@ public: virtual void swap(int pos1, int pos2) = 0; virtual std::vector<int> get_selected_rows() const = 0; virtual void set_font_color(int pos, const Color& rColor) = 0; - virtual void scroll_to_row(int pos) = 0; + // scroll to make 'row' visible, this will also expand all parent rows of 'row' as necessary to + // make 'row' visible + virtual void scroll_to_row(int row) = 0; virtual bool is_selected(int pos) const = 0; virtual int get_cursor_index() const = 0; virtual void set_cursor(int pos) = 0; @@ -1031,6 +1033,8 @@ public: const css::uno::Reference<css::graphic::XGraphic>& rImage, int col = -1) = 0; virtual void set_font_color(const TreeIter& rIter, const Color& rColor) = 0; + // scroll to make rIter visible, this will also expand all parent rows of rIter as necessary to + // make rIter visible virtual void scroll_to_row(const TreeIter& rIter) = 0; virtual bool is_selected(const TreeIter& rIter) const = 0; diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index c399eaf1a356..5ac1ec88fc10 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -10196,6 +10196,7 @@ public: assert(gtk_tree_view_get_model(m_pTreeView) && "don't select when frozen, select after thaw. Note selection doesn't survive a freeze"); disable_notify_events(); GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1); + gtk_tree_view_expand_to_path(m_pTreeView, path); gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0); gtk_tree_path_free(path); enable_notify_events(); @@ -10865,6 +10866,7 @@ public: const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter); GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore); GtkTreePath* path = gtk_tree_model_get_path(pModel, const_cast<GtkTreeIter*>(&rGtkIter.iter)); + gtk_tree_view_expand_to_path(m_pTreeView, path); gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0); gtk_tree_path_free(path); enable_notify_events(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
