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.
This commit is contained in:
parent
58f263a2c5
commit
ec25a0451d
@ -1049,20 +1049,23 @@ BContainerWindow::InitLayout()
|
|||||||
|
|
||||||
fCountContainer->GroupLayout()->AddView(fPoseView->CountView(), 0.25f);
|
fCountContainer->GroupLayout()->AddView(fPoseView->CountView(), 0.25f);
|
||||||
|
|
||||||
// Eliminate the extra borders
|
bool forFilePanel = PoseView()->IsFilePanel();
|
||||||
fPoseContainer->GridLayout()->SetInsets(-1, 0, -1, -1);
|
if (!forFilePanel) {
|
||||||
fCountContainer->GroupLayout()->SetInsets(0, -1, 0, 0);
|
// Eliminate the extra borders
|
||||||
|
fPoseContainer->GridLayout()->SetInsets(-1, 0, -1, -1);
|
||||||
|
fCountContainer->GroupLayout()->SetInsets(0, -1, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (fPoseView->VScrollBar() != NULL) {
|
if (fPoseView->VScrollBar() != NULL) {
|
||||||
fVScrollBarContainer = new BGroupView(B_VERTICAL, 0);
|
fVScrollBarContainer = new BGroupView(B_VERTICAL, 0);
|
||||||
fVScrollBarContainer->GroupLayout()->AddView(fPoseView->VScrollBar());
|
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);
|
fPoseContainer->GridLayout()->AddView(fVScrollBarContainer, 1, 1);
|
||||||
}
|
}
|
||||||
if (fPoseView->HScrollBar() != NULL) {
|
if (fPoseView->HScrollBar() != NULL) {
|
||||||
BGroupView* hScrollBarContainer = new BGroupView(B_VERTICAL, 0);
|
BGroupView* hScrollBarContainer = new BGroupView(B_VERTICAL, 0);
|
||||||
hScrollBarContainer->GroupLayout()->AddView(fPoseView->HScrollBar());
|
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);
|
fCountContainer->GroupLayout()->AddView(hScrollBarContainer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,6 @@ namespace BPrivate {
|
|||||||
|
|
||||||
class BPoseView;
|
class BPoseView;
|
||||||
|
|
||||||
const int32 kCountViewWidth = 76;
|
|
||||||
|
|
||||||
|
|
||||||
class BCountView : public BView {
|
class BCountView : public BView {
|
||||||
// displays the item count and a barber pole while the view is updating
|
// displays the item count and a barber pole while the view is updating
|
||||||
|
@ -44,6 +44,7 @@ All rights reserved.
|
|||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
#include <GridView.h>
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
@ -245,6 +246,13 @@ TFilePanel::TFilePanel(file_panel_mode mode, BMessenger* target,
|
|||||||
fBorderedView = new BorderedView;
|
fBorderedView = new BorderedView;
|
||||||
CreatePoseView(model);
|
CreatePoseView(model);
|
||||||
fBorderedView->GroupLayout()->SetInsets(1);
|
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);
|
fPoseView->SetRefFilter(filter);
|
||||||
if (!fIsSavePanel)
|
if (!fIsSavePanel)
|
||||||
fPoseView->SetMultipleSelection(multipleSelection);
|
fPoseView->SetMultipleSelection(multipleSelection);
|
||||||
@ -735,16 +743,16 @@ TFilePanel::Init(const BMessage*)
|
|||||||
|
|
||||||
// Add PoseView
|
// Add PoseView
|
||||||
PoseView()->SetName("ActualPoseView");
|
PoseView()->SetName("ActualPoseView");
|
||||||
fBorderedView->SetName("PoseView");
|
fPoseContainer->SetName("PoseView");
|
||||||
fBorderedView->SetResizingMode(B_FOLLOW_ALL);
|
fPoseContainer->SetResizingMode(B_FOLLOW_ALL);
|
||||||
fBorderedView->EnableBorderHighlight(true);
|
fBorderedView->EnableBorderHighlight(true);
|
||||||
|
|
||||||
rect = windRect;
|
rect = windRect;
|
||||||
rect.OffsetTo(10, fDirMenuField->Frame().bottom + 10);
|
rect.OffsetTo(10, fDirMenuField->Frame().bottom + 10);
|
||||||
rect.bottom = windRect.bottom - 60;
|
rect.bottom = windRect.bottom - 60;
|
||||||
rect.right -= B_V_SCROLL_BAR_WIDTH + 20;
|
rect.right -= B_V_SCROLL_BAR_WIDTH + 20;
|
||||||
fBorderedView->MoveTo(rect.LeftTop());
|
fPoseContainer->MoveTo(rect.LeftTop());
|
||||||
fBorderedView->ResizeTo(rect.Width(), rect.Height());
|
fPoseContainer->ResizeTo(rect.Width(), rect.Height());
|
||||||
|
|
||||||
PoseView()->AddScrollBars();
|
PoseView()->AddScrollBars();
|
||||||
PoseView()->SetDragEnabled(false);
|
PoseView()->SetDragEnabled(false);
|
||||||
@ -753,28 +761,10 @@ TFilePanel::Init(const BMessage*)
|
|||||||
PoseView()->SetSelectionChangedHook(true);
|
PoseView()->SetSelectionChangedHook(true);
|
||||||
PoseView()->DisableSaveLocation();
|
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)
|
if (fIsSavePanel)
|
||||||
fBackView->AddChild(fBorderedView, fTextControl);
|
fBackView->AddChild(fPoseContainer, fTextControl);
|
||||||
else
|
else
|
||||||
fBackView->AddChild(fBorderedView);
|
fBackView->AddChild(fPoseContainer);
|
||||||
|
|
||||||
AddShortcut('W', B_COMMAND_KEY, new BMessage(kCancelButton));
|
AddShortcut('W', B_COMMAND_KEY, new BMessage(kCancelButton));
|
||||||
AddShortcut('H', B_COMMAND_KEY, new BMessage(kSwitchToHome));
|
AddShortcut('H', B_COMMAND_KEY, new BMessage(kSwitchToHome));
|
||||||
@ -918,29 +908,25 @@ TFilePanel::RestoreState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finish UI creation now that the PoseView is initialized
|
// Finish UI creation now that the PoseView is initialized
|
||||||
fBorderedView->GroupLayout()->AddView(0, fPoseView->TitleView());
|
InitLayout();
|
||||||
|
|
||||||
BRect rect(fBorderedView->Frame());
|
#if 1
|
||||||
rect.right = rect.left + kCountViewWidth;
|
// The Be Book gives the names for some of these views so that apps could
|
||||||
rect.top = rect.bottom + 1;
|
// move them around if they needed to, but we have them here in layouts,
|
||||||
rect.bottom = rect.top + PoseView()->HScrollBar()->Bounds().Height() - 1;
|
// so we need to change their names and add dummy views for compatibility.
|
||||||
PoseView()->CountView()->MoveTo(rect.LeftTop());
|
// (The same is done for the PoseView above.)
|
||||||
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.
|
|
||||||
fPoseView->TitleView()->SetName("ActualTitleView");
|
fPoseView->TitleView()->SetName("ActualTitleView");
|
||||||
BView* dummyTitleView = new BView(BRect(), "TitleView", B_FOLLOW_NONE, 0);
|
fPoseView->CountView()->SetName("ActualCountView");
|
||||||
fBackView->AddChild(dummyTitleView);
|
fPoseView->HScrollBar()->SetName("ActualHScrollBar");
|
||||||
dummyTitleView->Hide();
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user