[haiku-commits] haiku: hrev52835 - docs/user/interface src/kits/interface headers/os/interface

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 3 Feb 2019 13:04:16 -0500 (EST)

hrev52835 adds 1 changeset to branch 'master'
old head: b073a8c83ff43a60cfe688af345abfa053bd7e6d
new head: e5d0c9094d6e01bb29b6ad4c9a43b0ab5e800b8b
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=e5d0c9094d6e+%5Eb073a8c83ff4

----------------------------------------------------------------------------

e5d0c9094d6e: 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@xxxxxxxxx>

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev52835
Commit:      e5d0c9094d6e01bb29b6ad4c9a43b0ab5e800b8b
URL:         https://git.haiku-os.org/haiku/commit/?id=e5d0c9094d6e
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Fri Feb  1 21:43:11 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sun Feb  3 18:04:13 2019 UTC

Ticket:      https://dev.haiku-os.org/ticket/14871

----------------------------------------------------------------------------

4 files changed, 21 insertions(+), 13 deletions(-)
docs/user/interface/View.dox      | 19 ++++++++++++-------
headers/os/interface/View.h       |  2 +-
src/kits/interface/ListView.cpp   |  7 ++++---
src/kits/interface/ScrollView.cpp |  6 ++++--

----------------------------------------------------------------------------

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


Other related posts:

  • » [haiku-commits] haiku: hrev52835 - docs/user/interface src/kits/interface headers/os/interface - waddlesplash