diff --git a/docs/user/interface/View.dox b/docs/user/interface/View.dox index dd0f32c0dd..1193260b2f 100644 --- a/docs/user/interface/View.dox +++ b/docs/user/interface/View.dox @@ -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 */ diff --git a/headers/os/interface/View.h b/headers/os/interface/View.h index ddec3dfba8..4ca2becbfb 100644 --- a/headers/os/interface/View.h +++ b/headers/os/interface/View.h @@ -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 */ diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index fdcc86ebb1..ef537142c7 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -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); } diff --git a/src/kits/interface/ScrollView.cpp b/src/kits/interface/ScrollView.cpp index c4bf4ea916..ec923040c7 100644 --- a/src/kits/interface/ScrollView.cpp +++ b/src/kits/interface/ScrollView.cpp @@ -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