[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Nov 4 15:45:18 UTC 2019
vcl/unx/gtk3/gtk3gtkinst.cxx | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit f7f47654787c8fd1764a8d827bb6a84b17fe3882
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Nov 4 11:36:09 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Nov 4 16:44:13 2019 +0100
improve pivot table dnd highlighting
unhighlight row when widget is unhighlighted and only
highlight a row if the widget is highlighted
Change-Id: I415207b4b263c5125f52abd57efe3543e2411b36
Reviewed-on: https://gerrit.libreoffice.org/81999
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 54cd3bee15c3..584ffe3266c0 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7838,6 +7838,7 @@ private:
std::vector<int> m_aViewColToModelCol;
std::vector<int> m_aModelColToViewCol;
bool m_bWorkAroundBadDragRegion;
+ bool m_bInDrag;
gint m_nTextCol;
gint m_nImageCol;
gint m_nExpanderImageCol;
@@ -8294,6 +8295,7 @@ public:
, m_pTreeView(pTreeView)
, m_pTreeStore(GTK_TREE_STORE(gtk_tree_view_get_model(m_pTreeView)))
, m_bWorkAroundBadDragRegion(false)
+ , m_bInDrag(false)
, m_nTextCol(-1)
, m_nImageCol(-1)
, m_nExpanderImageCol(-1)
@@ -9605,8 +9607,11 @@ public:
gtk_tree_model_get_iter(pModel, &rGtkIter.iter, path);
}
- // highlight the row
- gtk_tree_view_set_drag_dest_row(m_pTreeView, path, pos);
+ if (m_bInDrag)
+ {
+ // highlight the row
+ gtk_tree_view_set_drag_dest_row(m_pTreeView, path, pos);
+ }
assert(path);
gtk_tree_path_free(path);
@@ -9695,6 +9700,7 @@ public:
// of the treeview's highlight effort
virtual void drag_started() override
{
+ m_bInDrag = true;
GtkWidget* pWidget = GTK_WIDGET(m_pTreeView);
GtkWidget* pParent = gtk_widget_get_parent(pWidget);
if (GTK_IS_SCROLLED_WINDOW(pParent))
@@ -9707,6 +9713,7 @@ public:
virtual void drag_ended() override
{
+ m_bInDrag = false;
if (m_bWorkAroundBadDragRegion)
{
GtkWidget* pWidget = GTK_WIDGET(m_pTreeView);
@@ -9714,6 +9721,8 @@ public:
gtk_drag_unhighlight(pParent);
m_bWorkAroundBadDragRegion = false;
}
+ // unhighlight the row
+ gtk_tree_view_set_drag_dest_row(m_pTreeView, nullptr, GTK_TREE_VIEW_DROP_BEFORE);
}
virtual ~GtkInstanceTreeView() override
More information about the Libreoffice-commits
mailing list