diff --git a/src/preferences/filetypes/DropTargetListView.cpp b/src/preferences/filetypes/DropTargetListView.cpp index 2ad0a5c081..f869e29ec1 100644 --- a/src/preferences/filetypes/DropTargetListView.cpp +++ b/src/preferences/filetypes/DropTargetListView.cpp @@ -28,8 +28,21 @@ DropTargetListView::Draw(BRect updateRect) if (fDropTarget) { // mark this view as a drop target rgb_color color = HighColor(); - SetHighColor(ui_color(B_KEYBOARD_NAVIGATION_COLOR)); - StrokeRect(Bounds()); + + SetHighColor(0, 0, 0); + SetPenSize(2); + BRect rect = Bounds(); +// TODO: this is an incompatibility between R5 and Haiku and should be fixed! +#ifdef HAIKU_TARGET_PLATFORM_HAIKU + rect.left++; + rect.top++; +#else + rect.right--; + rect.bottom--; +#endif + StrokeRect(rect); + + SetPenSize(1); SetHighColor(color); } } @@ -62,5 +75,20 @@ DropTargetListView::AcceptsDrag(const BMessage* /*message*/) void DropTargetListView::_InvalidateFrame() { - Invalidate(); + // only update the parts affected by the change to reduce flickering + BRect rect = Bounds(); + rect.right = rect.left + 1; + Invalidate(rect); + + rect = Bounds(); + rect.left = rect.right - 1; + Invalidate(rect); + + rect = Bounds(); + rect.bottom = rect.top + 1; + Invalidate(rect); + + rect = Bounds(); + rect.top = rect.bottom - 1; + Invalidate(rect); } diff --git a/src/preferences/filetypes/IconView.cpp b/src/preferences/filetypes/IconView.cpp index ed01d1953a..e0e4aa24ed 100644 --- a/src/preferences/filetypes/IconView.cpp +++ b/src/preferences/filetypes/IconView.cpp @@ -529,11 +529,19 @@ IconView::_AcceptsDrag(const BMessage* message) type_code type; int32 count; - if (message->GetInfo("refs", &type, &count) == B_OK && count == 1 && type == B_REF_TYPE + if (message->GetInfo("refs", &type, &count) == B_OK && count == 1 && type == B_REF_TYPE) { + // if we're bound to an entry, check that no one drops this to us + entry_ref ref; + if (fHasRef && message->FindRef("refs", &ref) == B_OK && fRef == ref) + return false; + + return true; + } + + if (message->GetInfo("icon/large", &type) == B_OK && type == B_MESSAGE_TYPE #ifdef HAIKU_TARGET_PLATFORM_HAIKU || message->GetInfo("icon", &type) == B_OK && type == B_VECTOR_ICON_TYPE #endif - || message->GetInfo("icon/large", &type) == B_OK && type == B_MESSAGE_TYPE || message->GetInfo("icon/mini", &type) == B_OK && type == B_MESSAGE_TYPE) return true; @@ -564,11 +572,27 @@ IconView::Draw(BRect updateRect) StrokeRect(Bounds()); } - if (IsFocus() || fDropTarget) { - // mark this view as a drop target + if (IsFocus()) { + // mark this view as a having focus SetHighColor(ui_color(B_KEYBOARD_NAVIGATION_COLOR)); StrokeRect(_BitmapRect()); } + if (fDropTarget) { + // mark this view as a drop target + SetHighColor(0, 0, 0); + SetPenSize(2); + BRect rect = _BitmapRect(); +// TODO: this is an incompatibility between R5 and Haiku and should be fixed! +#ifdef HAIKU_TARGET_PLATFORM_HAIKU + rect.left++; + rect.top++; +#else + rect.right--; + rect.bottom--; +#endif + StrokeRect(rect); + SetPenSize(1); + } }