[haiku-commits] haiku: hrev54473 - src/kits/tracker

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 28 Jul 2020 21:54:40 -0400 (EDT)

hrev54473 adds 1 changeset to branch 'master'
old head: 494bd14713c07b382f9a8bd8177425668e642e84
new head: d548fb2b3e493004761739c3e3fcc008ec497860
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=d548fb2b3e49+%5E494bd14713c0

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

d548fb2b3e49: Tracker: Rework BFilePanel compatibility code.
  
  Instead of adding "dummy views", leave the original views intact
  and just add a resizing hack to take care of any movements that
  apps have inflicted.
  
  Fixes #16411, a crash in WonderBrush, and compatibility issues
  in some other applications.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

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

Revision:    hrev54473
Commit:      d548fb2b3e493004761739c3e3fcc008ec497860
URL:         https://git.haiku-os.org/haiku/commit/?id=d548fb2b3e49
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Jul 29 01:53:19 2020 UTC

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

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

2 files changed, 10 insertions(+), 18 deletions(-)
src/kits/tracker/FilePanel.cpp     | 10 ++++++++++
src/kits/tracker/FilePanelPriv.cpp | 18 ------------------

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

diff --git a/src/kits/tracker/FilePanel.cpp b/src/kits/tracker/FilePanel.cpp
index 539b7eaf5c..99a01b5826 100644
--- a/src/kits/tracker/FilePanel.cpp
+++ b/src/kits/tracker/FilePanel.cpp
@@ -116,6 +116,16 @@ BFilePanel::Show()
                fWindow->Show();
 
        fWindow->Activate();
+
+#if 1
+       // The Be Book gives the names for some of the child views so that apps
+       // could move them around if they needed to, but we have most in 
layouts,
+       // so once the window has been opened, we have to forcibly resize 
"PoseView"
+       // (fBackView) to fully invalidate its layout in case any of the 
controls
+       // in it have been moved.
+       fWindow->FindView("PoseView")->ResizeBy(1, 1);
+       fWindow->FindView("PoseView")->ResizeBy(-1, -1);
+#endif
 }
 
 
diff --git a/src/kits/tracker/FilePanelPriv.cpp 
b/src/kits/tracker/FilePanelPriv.cpp
index e905781e6e..aa7d5d5d24 100644
--- a/src/kits/tracker/FilePanelPriv.cpp
+++ b/src/kits/tracker/FilePanelPriv.cpp
@@ -909,24 +909,6 @@ TFilePanel::RestoreState()
 
        // Finish UI creation now that the PoseView is initialized
        InitLayout();
-
-#if 1
-       // The Be Book gives the names for some of these views so that apps 
could
-       // move them around if they needed to, but we have them here in layouts,
-       // so we need to change their names and add dummy views for 
compatibility.
-       // (The same is done for the PoseView above.)
-       fPoseView->TitleView()->SetName("ActualTitleView");
-       fPoseView->CountView()->SetName("ActualCountView");
-       fPoseView->HScrollBar()->SetName("ActualHScrollBar");
-       fPoseView->VScrollBar()->SetName("ActualVScrollBar");
-
-       const char* views[] = {"TitleView", "HScrollBar", "VScrollBar", 
"CountVw", NULL};
-       for (int i = 0; views[i] != NULL; i++) {
-               BView* dummy = new BView(BRect(), views[i], B_FOLLOW_NONE, 0);
-               fBackView->AddChild(dummy);
-               dummy->Hide();
-       }
-#endif
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev54473 - src/kits/tracker - waddlesplash