Tracker: BPoseView replace BView with _inherited and style fixes.

Change-Id: Ic24f4ee3831a94a659cc584e5b4393f08695061d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9889
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
John Scipione
2025-11-30 19:05:25 +00:00
parent 0e2e36f650
commit 1584b1ecab
+11 -14
View File
@@ -997,14 +997,12 @@ BPoseView::AttachedToWindow()
{ {
AdoptSystemColors(); AdoptSystemColors();
AddFilter(new ShortcutFilter(B_RETURN, B_OPTION_KEY, kOpenSelection, AddFilter(new ShortcutFilter(B_RETURN, B_OPTION_KEY, kOpenSelection, this));
this));
// add Option-Return as a shortcut filter because AddShortcut // add Option-Return as a shortcut filter because AddShortcut
// doesn't allow us to have shortcuts without Command yet // doesn't allow us to have shortcuts without Command yet
AddFilter(new ShortcutFilter(B_ESCAPE, 0, B_CANCEL, this)); AddFilter(new ShortcutFilter(B_ESCAPE, 0, B_CANCEL, this));
// Escape key, used to abort an on-going clipboard cut or filtering // Escape key, used to abort an on-going clipboard cut or filtering
AddFilter(new ShortcutFilter(B_ESCAPE, B_SHIFT_KEY, AddFilter(new ShortcutFilter(B_ESCAPE, B_SHIFT_KEY, kCancelSelectionToClipboard, this));
kCancelSelectionToClipboard, this));
// Escape + SHIFT will remove current selection from clipboard, // Escape + SHIFT will remove current selection from clipboard,
// or all poses from current folder if 0 selected // or all poses from current folder if 0 selected
@@ -1024,7 +1022,7 @@ BPoseView::AttachedToWindow()
FSClipboardStartWatch(this); FSClipboardStartWatch(this);
BView::AttachedToWindow(); _inherited::AttachedToWindow();
} }
@@ -1717,7 +1715,7 @@ BPoseView::AddPosesCompleted()
BRect bounds(Bounds()); BRect bounds(Bounds());
float lastItemTop = (CurrentPoseList()->CountItems() - 1) * fListElemHeight; float lastItemTop = (CurrentPoseList()->CountItems() - 1) * fListElemHeight;
if (bounds.top > lastItemTop) if (bounds.top > lastItemTop)
BView::ScrollTo(bounds.left, std::max(lastItemTop, 0.0f)); _inherited::ScrollTo(bounds.left, std::max(lastItemTop, 0.0f));
} }
} }
@@ -2722,8 +2720,7 @@ BPoseView::MessageReceived(BMessage* message)
bool sortFolderNamesFirst; bool sortFolderNamesFirst;
if (message->FindBool("SortFolderNamesFirst", if (message->FindBool("SortFolderNamesFirst",
&sortFolderNamesFirst) == B_OK) { &sortFolderNamesFirst) == B_OK) {
settings.SetSortFolderNamesFirst( settings.SetSortFolderNamesFirst(sortFolderNamesFirst);
sortFolderNamesFirst);
} }
NameAttributeText::SetSortFolderNamesFirst( NameAttributeText::SetSortFolderNamesFirst(
settings.SortFolderNamesFirst()); settings.SortFolderNamesFirst());
@@ -7622,9 +7619,9 @@ BPoseView::DragSelectedPoses(const BPose* pose, BPoint where, uint32 buttons)
BPoint offset; BPoint offset;
dragBitmap = MakeDragBitmap(dragRect, where, index, offset); dragBitmap = MakeDragBitmap(dragRect, where, index, offset);
if (dragBitmap != NULL) if (dragBitmap != NULL)
BView::DragMessage(&message, dragBitmap, B_OP_ALPHA, offset); _inherited::DragMessage(&message, dragBitmap, B_OP_ALPHA, offset);
else else
BView::DragMessage(&message, dragRect); _inherited::DragMessage(&message, dragRect);
// turn on auto scrolling // turn on auto scrolling
fAutoScrollState = kWaitForTransition; fAutoScrollState = kWaitForTransition;
@@ -8111,7 +8108,7 @@ BPoseView::DeletePose(const node_ref* itemNode, BPose* pose, int32 index)
if (pose == NULL && bounds.top > 0) { if (pose == NULL && bounds.top > 0) {
// scroll up a little // scroll up a little
BView::ScrollTo(bounds.left, std::max(bounds.top - fListElemHeight, 0.0f)); _inherited::ScrollTo(bounds.left, std::max(bounds.top - fListElemHeight, 0.0f));
} }
} }
} }
@@ -9167,7 +9164,7 @@ BPoseView::Draw(BRect updateRect)
if ((Flags() & B_DRAW_ON_CHILDREN) == 0) if ((Flags() & B_DRAW_ON_CHILDREN) == 0)
DrawAfterChildren(updateRect); DrawAfterChildren(updateRect);
BView::Draw(updateRect); _inherited::Draw(updateRect);
} }
@@ -10440,12 +10437,12 @@ BPoseView::UpdateAfterFilterChange()
BPose* pose = fFilteredPoseList->LastItem(); BPose* pose = fFilteredPoseList->LastItem();
if (pose == NULL) if (pose == NULL)
BView::ScrollTo(0, 0); _inherited::ScrollTo(0, 0);
else { else {
BRect bounds = Bounds(); BRect bounds = Bounds();
float height = fFilteredPoseList->CountItems() * fListElemHeight; float height = fFilteredPoseList->CountItems() * fListElemHeight;
if (bounds.top > 0 && bounds.bottom > height) if (bounds.top > 0 && bounds.bottom > height)
BView::ScrollTo(0, std::max(height - bounds.Height(), 0.0f)); _inherited::ScrollTo(0, std::max(height - bounds.Height(), 0.0f));
} }
UpdateScrollRange(); UpdateScrollRange();