summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-10 16:18:15 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-11 20:55:37 +0900
commit85e56cd2b2fcbb5f74f01c20ed089acf7710489c (patch)
tree07f67c57dfb74c54b1f2de6e11a0b131dcafdfd1 /include
parent237169136883a5b312fadcec4c73aa183076828c (diff)
tdf#82009 TreeList move painting of drag target into Paint func.
When we drag a entry in TreeListBox, we execute a PaintDDCursor which paints a "cursor" of a possible drag target (for example to show where the entry will be moved to if we want to change the order). The problem with this fuction is that it paints a line directlly at that location, and that it uses invert raster operation to draw a line. So to hide the line it just needs to draw again. On MacOS this invertion causes a problem and draws the whole area black, which is the cause of this bug. So instead of inverting the drawing of the drag target cursor has now been moved into the main Paint method, where it redraws the whole entry, and if present, also the drag target cursor. This means that all we need to do is Invalidate the entry, which then just gets redrawn in a normal Paint pass. One exception is still MacOS, which doesn't invalidate the entry, but redraws the entry directly. DnD is MacOS is a bit different as it is not async (if I understand correctly) so the invalidate has no effect. Reviewed-on: https://gerrit.libreoffice.org/70521 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 14abbc6e86ba234996dfed477a54030adeac2a52) Change-Id: I8542f47940a3b90114ea4bbbac57fd303ca3434b
Diffstat (limited to 'include')
-rw-r--r--include/svtools/viewdataentry.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/svtools/viewdataentry.hxx b/include/svtools/viewdataentry.hxx
index 1a61b3f6c13a..91c51d39dc9a 100644
--- a/include/svtools/viewdataentry.hxx
+++ b/include/svtools/viewdataentry.hxx
@@ -51,6 +51,8 @@ class SVT_DLLPUBLIC SvViewDataEntry
bool mbExpanded:1;
bool mbFocused:1;
bool mbSelectable:1;
+ bool mbDragTarget:1;
+
tools::Rectangle maPaintRectangle;
public:
@@ -63,11 +65,16 @@ public:
bool IsExpanded() const { return mbExpanded;}
bool HasFocus() const { return mbFocused;}
bool IsSelectable() const { return mbSelectable;}
+ bool IsDragTarget() const { return mbDragTarget;}
void SetFocus( bool bFocus );
void SetSelected( bool bSelected );
void SetHighlighted( bool bHighlighted );
void SetExpanded( bool bExpanded );
void SetSelectable( bool bSelectable );
+ void SetDragTarget( bool bDragTarget )
+ {
+ mbDragTarget = bDragTarget;
+ }
void Init(size_t nSize);