ColorListView: Handle color dropped on unselected

Remove shared message handling from ColorListView,
you are expected to implement this yourself and these
message constants were not actually being used by
the message target.

Do color drop handling in Appearance and Terminal.
Handle all color drops in WasDropped().

Allow current selection to remain, only update color.
TODO Changing selection on external drops should be
fixed in BListView. Work-around in BColorListView.

Fixes #19562

Change-Id: Ic99bbb1288fd736778eac831d38e453122815abc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9296
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
John Scipione
2025-06-30 14:56:42 +00:00
parent 0d91cd6464
commit 15c87be3ea
7 changed files with 79 additions and 146 deletions
+2 -8
View File
@@ -18,19 +18,13 @@ namespace BPrivate {
class BColorListView : public BListView {
public:
enum {
B_MESSAGE_SET_CURRENT_COLOR = 'sccl',
B_MESSAGE_SET_COLOR = 'sclr'
};
BColorListView(const char* name,
list_view_type type = B_SINGLE_SELECTION_LIST,
uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
virtual ~BColorListView();
virtual bool InitiateDrag(BPoint where, int32 index,
bool wasSelected);
virtual void MessageReceived(BMessage* message);
virtual bool InitiateDrag(BPoint where, int32 index, bool wasSelected);
virtual void MouseUp(BPoint where);
};