hrev54401 adds 3 changesets to branch 'master'
old head: b29bb4bec5886358275e0f2f4413b4a9a57123bd
new head: ec25a0451dcaa0990e335d438460662fbc60c68d
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=ec25a0451dca+%5Eb29bb4bec588
----------------------------------------------------------------------------
bdfb3cd7cd70: BScrollBar: Report a more correct maximum size.
This way, BScrollBar will now be scaled appropriately when used
within layouts, as it is in e.g. Tracker.
58f263a2c5a2: Tracker: Remove usage of hard-coded count view size in
ContainerWindow.
This makes the count view width, height, and font size properly
proportional in the container window. BFilePanel is not yet
fixed however.
ec25a0451dca: Tracker: Eliminate the fixed count-view size altogether.
This moves the scroll bars and the count view into the layout
inside FilePanels, so more shim views for compatibility are now made.
Fixes #13179.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
5 files changed, 45 insertions(+), 60 deletions(-)
src/kits/interface/ScrollBar.cpp | 3 +-
src/kits/tracker/ContainerWindow.cpp | 18 ++++----
src/kits/tracker/CountView.cpp | 4 +-
src/kits/tracker/CountView.h | 2 -
src/kits/tracker/FilePanelPriv.cpp | 78 +++++++++++++-------------------
############################################################################
Commit: bdfb3cd7cd701ddc57263f48ee76a11a3b8ddeb3
URL: https://git.haiku-os.org/haiku/commit/?id=bdfb3cd7cd70
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Sun Jul 5 23:07:44 2020 UTC
BScrollBar: Report a more correct maximum size.
This way, BScrollBar will now be scaled appropriately when used
within layouts, as it is in e.g. Tracker.
----------------------------------------------------------------------------
diff --git a/src/kits/interface/ScrollBar.cpp b/src/kits/interface/ScrollBar.cpp
index d9ad1902e5..ed26de53d0 100644
--- a/src/kits/interface/ScrollBar.cpp
+++ b/src/kits/interface/ScrollBar.cpp
@@ -1035,7 +1035,8 @@ BScrollBar::MinSize()
BSize
BScrollBar::MaxSize()
{
- BSize maxSize = _MinSize();
+ BSize maxSize;
+ GetPreferredSize(&maxSize.width, &maxSize.height);
if (fOrientation == B_HORIZONTAL)
maxSize.width = B_SIZE_UNLIMITED;
else
############################################################################
Commit: 58f263a2c5a280789cbe27e5c7ecba7d3c74dd50
URL: https://git.haiku-os.org/haiku/commit/?id=58f263a2c5a2
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Sun Jul 5 23:14:19 2020 UTC
Tracker: Remove usage of hard-coded count view size in ContainerWindow.
This makes the count view width, height, and font size properly
proportional in the container window. BFilePanel is not yet
fixed however.
----------------------------------------------------------------------------
diff --git a/src/kits/tracker/ContainerWindow.cpp
b/src/kits/tracker/ContainerWindow.cpp
index d32c314969..755e7fe1b6 100644
--- a/src/kits/tracker/ContainerWindow.cpp
+++ b/src/kits/tracker/ContainerWindow.cpp
@@ -1047,10 +1047,7 @@ BContainerWindow::InitLayout()
{
fBorderedView->GroupLayout()->AddView(0, fPoseView->TitleView());
- BLayoutItem* item = fCountContainer->GroupLayout()->AddView(
- fPoseView->CountView());
- item->SetExplicitMinSize(BSize(kCountViewWidth, B_H_SCROLL_BAR_HEIGHT));
- item->SetExplicitMaxSize(BSize(kCountViewWidth, B_SIZE_UNSET));
+ fCountContainer->GroupLayout()->AddView(fPoseView->CountView(), 0.25f);
// Eliminate the extra borders
fPoseContainer->GridLayout()->SetInsets(-1, 0, -1, -1);
diff --git a/src/kits/tracker/CountView.cpp b/src/kits/tracker/CountView.cpp
index 6a119f51fb..129992f7aa 100644
--- a/src/kits/tracker/CountView.cpp
+++ b/src/kits/tracker/CountView.cpp
@@ -159,7 +159,7 @@ BRect
BCountView::TextInvalRect() const
{
BRect result = Bounds();
- result.InsetBy(4, 3);
+ result.InsetBy(4, 4);
// if the barber pole is not present, use its space for text
if (fShowingBarberPole)
@@ -313,7 +313,7 @@ void
BCountView::AttachedToWindow()
{
SetFont(be_plain_font);
- SetFontSize(9);
+ SetFontSize(be_plain_font->Size() * 0.75f);
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
SetLowUIColor(ViewUIColor());
############################################################################
Revision: hrev54401
Commit: ec25a0451dcaa0990e335d438460662fbc60c68d
URL: https://git.haiku-os.org/haiku/commit/?id=ec25a0451dca
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Sun Jul 5 23:44:19 2020 UTC
Ticket: https://dev.haiku-os.org/ticket/13179
Tracker: Eliminate the fixed count-view size altogether.
This moves the scroll bars and the count view into the layout
inside FilePanels, so more shim views for compatibility are now made.
Fixes #13179.
----------------------------------------------------------------------------
diff --git a/src/kits/tracker/ContainerWindow.cpp
b/src/kits/tracker/ContainerWindow.cpp
index 755e7fe1b6..77bc0d36cd 100644
--- a/src/kits/tracker/ContainerWindow.cpp
+++ b/src/kits/tracker/ContainerWindow.cpp
@@ -1049,20 +1049,23 @@ BContainerWindow::InitLayout()
fCountContainer->GroupLayout()->AddView(fPoseView->CountView(), 0.25f);
- // Eliminate the extra borders
- fPoseContainer->GridLayout()->SetInsets(-1, 0, -1, -1);
- fCountContainer->GroupLayout()->SetInsets(0, -1, 0, 0);
+ bool forFilePanel = PoseView()->IsFilePanel();
+ if (!forFilePanel) {
+ // Eliminate the extra borders
+ fPoseContainer->GridLayout()->SetInsets(-1, 0, -1, -1);
+ fCountContainer->GroupLayout()->SetInsets(0, -1, 0, 0);
+ }
if (fPoseView->VScrollBar() != NULL) {
fVScrollBarContainer = new BGroupView(B_VERTICAL, 0);
fVScrollBarContainer->GroupLayout()->AddView(fPoseView->VScrollBar());
- fVScrollBarContainer->GroupLayout()->SetInsets(-1, -1, 0, 0);
+ fVScrollBarContainer->GroupLayout()->SetInsets(-1, forFilePanel
? 0 : -1, 0, 0);
fPoseContainer->GridLayout()->AddView(fVScrollBarContainer, 1,
1);
}
if (fPoseView->HScrollBar() != NULL) {
BGroupView* hScrollBarContainer = new BGroupView(B_VERTICAL, 0);
hScrollBarContainer->GroupLayout()->AddView(fPoseView->HScrollBar());
- hScrollBarContainer->GroupLayout()->SetInsets(0, -1, 0, -1);
+ hScrollBarContainer->GroupLayout()->SetInsets(0, -1, 0,
forFilePanel ? 0 : -1);
fCountContainer->GroupLayout()->AddView(hScrollBarContainer);
}
}
diff --git a/src/kits/tracker/CountView.h b/src/kits/tracker/CountView.h
index 625358e327..af10c2a2f4 100644
--- a/src/kits/tracker/CountView.h
+++ b/src/kits/tracker/CountView.h
@@ -43,8 +43,6 @@ namespace BPrivate {
class BPoseView;
-const int32 kCountViewWidth = 76;
-
class BCountView : public BView {
// displays the item count and a barber pole while the view is updating
diff --git a/src/kits/tracker/FilePanelPriv.cpp
b/src/kits/tracker/FilePanelPriv.cpp
index 91b2631905..fb90d0dd53 100644
--- a/src/kits/tracker/FilePanelPriv.cpp
+++ b/src/kits/tracker/FilePanelPriv.cpp
@@ -44,6 +44,7 @@ All rights reserved.
#include <Debug.h>
#include <Directory.h>
#include <FindDirectory.h>
+#include <GridView.h>
#include <Locale.h>
#include <MenuBar.h>
#include <MenuField.h>
@@ -245,6 +246,13 @@ TFilePanel::TFilePanel(file_panel_mode mode, BMessenger*
target,
fBorderedView = new BorderedView;
CreatePoseView(model);
fBorderedView->GroupLayout()->SetInsets(1);
+
+ fPoseContainer = new BGridView(0.0, 0.0);
+ fPoseContainer->GridLayout()->AddView(fBorderedView, 0, 1);
+
+ fCountContainer = new BGroupView(B_HORIZONTAL, 0);
+ fPoseContainer->GridLayout()->AddView(fCountContainer, 0, 2);
+
fPoseView->SetRefFilter(filter);
if (!fIsSavePanel)
fPoseView->SetMultipleSelection(multipleSelection);
@@ -735,16 +743,16 @@ TFilePanel::Init(const BMessage*)
// Add PoseView
PoseView()->SetName("ActualPoseView");
- fBorderedView->SetName("PoseView");
- fBorderedView->SetResizingMode(B_FOLLOW_ALL);
+ fPoseContainer->SetName("PoseView");
+ fPoseContainer->SetResizingMode(B_FOLLOW_ALL);
fBorderedView->EnableBorderHighlight(true);
rect = windRect;
rect.OffsetTo(10, fDirMenuField->Frame().bottom + 10);
rect.bottom = windRect.bottom - 60;
rect.right -= B_V_SCROLL_BAR_WIDTH + 20;
- fBorderedView->MoveTo(rect.LeftTop());
- fBorderedView->ResizeTo(rect.Width(), rect.Height());
+ fPoseContainer->MoveTo(rect.LeftTop());
+ fPoseContainer->ResizeTo(rect.Width(), rect.Height());
PoseView()->AddScrollBars();
PoseView()->SetDragEnabled(false);
@@ -753,28 +761,10 @@ TFilePanel::Init(const BMessage*)
PoseView()->SetSelectionChangedHook(true);
PoseView()->DisableSaveLocation();
- // horizontal
- rect = fBorderedView->Frame();
- rect.top = rect.bottom;
- rect.bottom = rect.top + (float)B_H_SCROLL_BAR_HEIGHT;
- PoseView()->HScrollBar()->MoveTo(rect.LeftTop());
- PoseView()->HScrollBar()->ResizeTo(rect.Size());
- PoseView()->HScrollBar()->SetResizingMode(B_FOLLOW_LEFT_RIGHT |
B_FOLLOW_BOTTOM);
- fBackView->AddChild(PoseView()->HScrollBar());
-
- // vertical
- rect = fBorderedView->Frame();
- rect.left = rect.right;
- rect.right = rect.left + (float)B_V_SCROLL_BAR_WIDTH;
- PoseView()->VScrollBar()->MoveTo(rect.LeftTop());
- PoseView()->VScrollBar()->ResizeTo(rect.Size());
- PoseView()->VScrollBar()->SetResizingMode(B_FOLLOW_TOP_BOTTOM |
B_FOLLOW_RIGHT);
- fBackView->AddChild(PoseView()->VScrollBar());
-
if (fIsSavePanel)
- fBackView->AddChild(fBorderedView, fTextControl);
+ fBackView->AddChild(fPoseContainer, fTextControl);
else
- fBackView->AddChild(fBorderedView);
+ fBackView->AddChild(fPoseContainer);
AddShortcut('W', B_COMMAND_KEY, new BMessage(kCancelButton));
AddShortcut('H', B_COMMAND_KEY, new BMessage(kSwitchToHome));
@@ -918,29 +908,25 @@ TFilePanel::RestoreState()
}
// Finish UI creation now that the PoseView is initialized
- fBorderedView->GroupLayout()->AddView(0, fPoseView->TitleView());
-
- BRect rect(fBorderedView->Frame());
- rect.right = rect.left + kCountViewWidth;
- rect.top = rect.bottom + 1;
- rect.bottom = rect.top + PoseView()->HScrollBar()->Bounds().Height() -
1;
- PoseView()->CountView()->MoveTo(rect.LeftTop());
- PoseView()->CountView()->ResizeTo(rect.Size());
- PoseView()->CountView()->SetResizingMode(B_FOLLOW_LEFT |
B_FOLLOW_BOTTOM);
- fBackView->AddChild(PoseView()->CountView(), fBorderedView);
-
- PoseView()->HScrollBar()->MoveBy(kCountViewWidth + 1, 0);
- PoseView()->HScrollBar()->ResizeBy(-kCountViewWidth - 1, 0);
-
- // The Be Book states that the BTitleView will have a name of
"TitleView",
- // and so some apps will try to grab it by that name and move it around.
- // They don't need to, because resizing "PoseView" (really the
BorderedView)
- // will resize the BTitleView as well. So just create a dummy view here
- // so that they don't get NULL when trying to find the view.
+ 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");
- BView* dummyTitleView = new BView(BRect(), "TitleView", B_FOLLOW_NONE,
0);
- fBackView->AddChild(dummyTitleView);
- dummyTitleView->Hide();
+ 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
}