BView: Add a B_SCROLL_VIEW_AWARE flag.
* This indicates the view will manage whatever scrollbars are targeted to it. * Use _B_RESERVED7_ for this. It's been RESERVED since BeOS R5 (I guess it was probably something on some older BeOS version?) and we don't really care about BeOS R4 ABI compatibility, so that should be fine. * Update BScrollView to not touch BScrollBar range/proportion when the target view has this set. * Update BListView to set this flag, always. Fixes #14871. Change-Id: I17027f3b63ef28da1e735c5393593496c415dce3 Reviewed-on: https://review.haiku-os.org/c/998 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
b073a8c83f
commit
e5d0c9094d
@ -308,13 +308,17 @@
|
||||
\var B_SUBPIXEL_PRECISE
|
||||
\brief The view draws with sub-pixel precision.
|
||||
|
||||
\since Haiku R1
|
||||
If this flag is not specified, drawing coordinates will be rounded
|
||||
to the nearest integer.
|
||||
|
||||
\since BeOS R5
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\var B_DRAW_ON_CHILDREN
|
||||
\brief Indicates that the view responds to the DrawAfterChildren() hook method.
|
||||
\brief Indicates that the view responds to the DrawAfterChildren() hook
|
||||
method.
|
||||
|
||||
\since BeOS R5
|
||||
*/
|
||||
@ -322,16 +326,17 @@
|
||||
|
||||
/*!
|
||||
\var B_INPUT_METHOD_AWARE
|
||||
\brief Allows the view to use input method add-ons to gain access to the
|
||||
input methods needed for Japanese and other languages.
|
||||
\brief Indicates the view understands input method add-ons, as used
|
||||
for complex text input in CJK and other languages.
|
||||
|
||||
\since Haiku R1
|
||||
\since BeOS R5
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\var _B_RESERVED7_
|
||||
\brief Reserved for future use.
|
||||
\var B_SCROLL_VIEW_AWARE
|
||||
\brief Indicates the view will properly manage scrollbars that
|
||||
have been targeted to it, i.e. update their ranges and proportions.
|
||||
|
||||
\since Haiku R1
|
||||
*/
|
||||
|
@ -77,7 +77,7 @@ const uint32 B_NAVIGABLE = 0x02000000UL; /* 25 */
|
||||
const uint32 B_SUBPIXEL_PRECISE = 0x01000000UL; /* 24 */
|
||||
const uint32 B_DRAW_ON_CHILDREN = 0x00800000UL; /* 23 */
|
||||
const uint32 B_INPUT_METHOD_AWARE = 0x00400000UL; /* 23 */
|
||||
const uint32 _B_RESERVED7_ = 0x00200000UL; /* 22 */
|
||||
const uint32 B_SCROLL_VIEW_AWARE = 0x00200000UL; /* 22 */
|
||||
const uint32 B_SUPPORTS_LAYOUT = 0x00100000UL; /* 21 */
|
||||
const uint32 B_INVALIDATE_AFTER_LAYOUT = 0x00080000UL; /* 20 */
|
||||
|
||||
|
@ -86,7 +86,7 @@ static property_info sProperties[] = {
|
||||
BListView::BListView(BRect frame, const char* name, list_view_type type,
|
||||
uint32 resizingMode, uint32 flags)
|
||||
:
|
||||
BView(frame, name, resizingMode, flags)
|
||||
BView(frame, name, resizingMode, flags | B_SCROLL_VIEW_AWARE)
|
||||
{
|
||||
_InitObject(type);
|
||||
}
|
||||
@ -94,7 +94,7 @@ BListView::BListView(BRect frame, const char* name, list_view_type type,
|
||||
|
||||
BListView::BListView(const char* name, list_view_type type, uint32 flags)
|
||||
:
|
||||
BView(name, flags)
|
||||
BView(name, flags | B_SCROLL_VIEW_AWARE)
|
||||
{
|
||||
_InitObject(type);
|
||||
}
|
||||
@ -102,7 +102,8 @@ BListView::BListView(const char* name, list_view_type type, uint32 flags)
|
||||
|
||||
BListView::BListView(list_view_type type)
|
||||
:
|
||||
BView(NULL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE)
|
||||
BView(NULL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE
|
||||
| B_SCROLL_VIEW_AWARE)
|
||||
{
|
||||
_InitObject(type);
|
||||
}
|
||||
|
@ -273,7 +273,8 @@ BScrollView::FrameResized(float newWidth, float newHeight)
|
||||
|
||||
const BRect bounds = Bounds();
|
||||
|
||||
if (fTarget != NULL && (fTarget->Flags() & B_SUPPORTS_LAYOUT) != 0) {
|
||||
if (fTarget != NULL && (fTarget->Flags() & B_SUPPORTS_LAYOUT) != 0
|
||||
&& (fTarget->Flags() & B_SCROLL_VIEW_AWARE) == 0) {
|
||||
BSize size = fTarget->PreferredSize();
|
||||
if (fHorizontalScrollBar != NULL) {
|
||||
float delta = size.Width() - bounds.Width(),
|
||||
@ -957,7 +958,8 @@ BScrollView::_BorderSize(border_style border)
|
||||
/*static*/ uint32
|
||||
BScrollView::_ModifyFlags(uint32 flags, BView* target, border_style border)
|
||||
{
|
||||
if (target != NULL && (target->Flags() & B_SUPPORTS_LAYOUT) != 0)
|
||||
if (target != NULL && (target->Flags() & B_SUPPORTS_LAYOUT) != 0
|
||||
&& (target->Flags() & B_SCROLL_VIEW_AWARE) == 0)
|
||||
flags |= B_FRAME_EVENTS;
|
||||
|
||||
// We either need B_FULL_UPDATE_ON_RESIZE or B_FRAME_EVENTS if we have
|
||||
|
Loading…
Reference in New Issue
Block a user