* Imported files from OT-current:
- InfoWindow.cpp 1.17, .h 1.5 - TrackerSettingsWindow.cpp 1.9 - ContainerWindow.cpp 1.37, .h 1.7 - DialogPane.cpp 1.4 * This also fixes bug #718. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18481 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -471,7 +471,7 @@ DraggableContainerIcon::FrameMoved(BPoint /*newLocation*/)
|
||||
// This is a trick to get the actual width of all menu items
|
||||
// (BMenuBar may not have set the item coordinates yet...)
|
||||
float width, height;
|
||||
int32 resizingMode = bar->ResizingMode();
|
||||
uint32 resizingMode = bar->ResizingMode();
|
||||
bar->SetResizingMode(B_FOLLOW_NONE);
|
||||
bar->GetPreferredSize(&width, &height);
|
||||
bar->SetResizingMode(resizingMode);
|
||||
@@ -1068,11 +1068,23 @@ BContainerWindow::UpdateBackgroundImage()
|
||||
void
|
||||
BContainerWindow::FrameResized(float, float)
|
||||
{
|
||||
if (PoseView()) {
|
||||
if (PoseView() && dynamic_cast<BDeskWindow *>(this) == NULL) {
|
||||
BRect extent = PoseView()->Extent();
|
||||
if (extent.bottom < PoseView()->Bounds().bottom
|
||||
&& fPreviousBounds.Height() < Bounds().Height()) {
|
||||
PoseView()->ScrollBy(0, max_c(extent.bottom - PoseView()->Bounds().bottom,
|
||||
fPreviousBounds.Height() - Bounds().Height()));
|
||||
}
|
||||
if (extent.right < PoseView()->Bounds().right
|
||||
&& fPreviousBounds.Width() < Bounds().Width()) {
|
||||
PoseView()->ScrollBy(max_c(extent.right - PoseView()->Bounds().right,
|
||||
fPreviousBounds.Width() - Bounds().Width()), 0);
|
||||
}
|
||||
PoseView()->UpdateScrollRange();
|
||||
PoseView()->ResetPosePlacementHint();
|
||||
}
|
||||
|
||||
|
||||
fPreviousBounds = Bounds();
|
||||
fStateNeedsSaving = true;
|
||||
}
|
||||
|
||||
@@ -1288,47 +1300,31 @@ BContainerWindow::ResizeToFit()
|
||||
|
||||
BRect frame(Frame());
|
||||
|
||||
float widthDiff = frame.Width() - PoseView()->Frame().Width();
|
||||
float heightDiff = frame.Height() - PoseView()->Frame().Height();
|
||||
|
||||
// move frame left top on screen
|
||||
BPoint leftTop(frame.LeftTop());
|
||||
leftTop.ConstrainTo(screenFrame);
|
||||
frame.OffsetTo(leftTop);
|
||||
|
||||
// resize to extent size
|
||||
float menuHeight;
|
||||
if (KeyMenuBar())
|
||||
menuHeight = KeyMenuBar()->Bounds().Height();
|
||||
else
|
||||
menuHeight = 0;
|
||||
|
||||
BRect extent(PoseView()->Extent());
|
||||
frame.right = frame.left + extent.Width() + (float)B_V_SCROLL_BAR_WIDTH + 1.0f;
|
||||
frame.bottom = frame.top + extent.Height() + (float)B_H_SCROLL_BAR_HEIGHT + 1.0f
|
||||
+ menuHeight;
|
||||
frame.right = frame.left + extent.Width() + widthDiff;
|
||||
frame.bottom = frame.top + extent.Height() + heightDiff;
|
||||
|
||||
if (PoseView()->ViewMode() == kListMode)
|
||||
frame.bottom += kTitleViewHeight + 1; // account for list titles
|
||||
|
||||
TrackerSettings settings;
|
||||
if (settings.SingleWindowBrowse()
|
||||
&& settings.ShowNavigator()
|
||||
&& Navigator())
|
||||
frame.bottom += fNavigator->Bounds().bottom + 1;
|
||||
|
||||
// ToDo:
|
||||
// clean this up, move each special case to respective class
|
||||
|
||||
if (!TargetModel())
|
||||
frame.bottom += 60; // Open with window
|
||||
else if (TargetModel()->IsQuery())
|
||||
frame.bottom += 15; // account for query string
|
||||
|
||||
// make sure entire window fits on screen
|
||||
frame = frame & screenFrame;
|
||||
|
||||
ResizeTo(frame.Width(), frame.Height());
|
||||
MoveTo(frame.LeftTop());
|
||||
PoseView()->DisableScrollBars();
|
||||
PoseView()->ScrollTo(extent.LeftTop());
|
||||
|
||||
if (PoseView()->Bounds().bottom > extent.bottom)
|
||||
PoseView()->ScrollBy(0, extent.bottom - PoseView()->Bounds().bottom);
|
||||
if (PoseView()->Bounds().right > extent.right)
|
||||
PoseView()->ScrollBy(extent.right - PoseView()->Bounds().right, 0);
|
||||
|
||||
PoseView()->UpdateScrollRange();
|
||||
PoseView()->EnableScrollBars();
|
||||
}
|
||||
@@ -1502,6 +1498,16 @@ BContainerWindow::MessageReceived(BMessage *message)
|
||||
if (settings.ShowNavigator() || settings.ShowFullPathInTitleBar())
|
||||
SetPathWatchingEnabled(true);
|
||||
|
||||
// Update draggable folder icon
|
||||
BView *view = FindView("MenuBar");
|
||||
if (view != NULL) {
|
||||
view = view->FindView("ThisContainer");
|
||||
if (view != NULL) {
|
||||
IconCache::sIconCache->IconChanged(TargetModel());
|
||||
view->Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
// Update window title
|
||||
UpdateTitle();
|
||||
}
|
||||
@@ -3350,6 +3356,8 @@ BContainerWindow::RestoreWindowState(AttributeStreamNode *node)
|
||||
} else
|
||||
sNewWindRect.OffsetBy(kWindowStaggerBy, kWindowStaggerBy);
|
||||
|
||||
fPreviousBounds = Bounds();
|
||||
|
||||
uint32 workspace;
|
||||
if ((fContainerWindowFlags & kRestoreWorkspace)
|
||||
&& node->Read(workspaceAttributeName, 0, B_INT32_TYPE, sizeof(uint32), &workspace) == sizeof(uint32))
|
||||
|
||||
@@ -274,6 +274,7 @@ class BContainerWindow : public BWindow {
|
||||
|
||||
private:
|
||||
BRect fSavedZoomRect;
|
||||
BRect fPreviousBounds;
|
||||
|
||||
static BRect sNewWindRect;
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ DialogPane::DialogPane(BRect mode1Frame, BRect mode2Frame, int32 initialMode,
|
||||
fMode2Frame(mode2Frame),
|
||||
fMode3Frame(mode2Frame)
|
||||
{
|
||||
SetMode(fMode, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +90,7 @@ DialogPane::DialogPane(BRect mode1Frame, BRect mode2Frame, BRect mode3Frame,
|
||||
fMode2Frame(mode2Frame),
|
||||
fMode3Frame(mode3Frame)
|
||||
{
|
||||
SetMode(fMode, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -196,8 +198,6 @@ DialogPane::AttachedToWindow()
|
||||
SetViewColor(parent->ViewColor());
|
||||
SetLowColor(parent->LowColor());
|
||||
}
|
||||
|
||||
SetMode(fMode, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,21 @@ names are registered trademarks or trademarks of their respective holders.
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "Attributes.h"
|
||||
#include "AutoLock.h"
|
||||
#include "Commands.h"
|
||||
#include "DialogPane.h"
|
||||
#include "FSUtils.h"
|
||||
#include "IconCache.h"
|
||||
#include "IconMenuItem.h"
|
||||
#include "InfoWindow.h"
|
||||
#include "Model.h"
|
||||
#include "NavMenu.h"
|
||||
#include "PoseView.h"
|
||||
#include "Tracker.h"
|
||||
#include "WidgetAttributeText.h"
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Debug.h>
|
||||
#include <Directory.h>
|
||||
@@ -56,18 +71,6 @@ All rights reserved.
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "Attributes.h"
|
||||
#include "AutoLock.h"
|
||||
#include "Commands.h"
|
||||
#include "FSUtils.h"
|
||||
#include "IconCache.h"
|
||||
#include "IconMenuItem.h"
|
||||
#include "InfoWindow.h"
|
||||
#include "Model.h"
|
||||
#include "NavMenu.h"
|
||||
#include "PoseView.h"
|
||||
#include "Tracker.h"
|
||||
#include "WidgetAttributeText.h"
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
@@ -31,19 +31,19 @@ of Be Incorporated in the United States and other countries. Other brand product
|
||||
names are registered trademarks or trademarks of their respective holders.
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef INFO_WINDOW_H
|
||||
#define INFO_WINDOW_H
|
||||
|
||||
|
||||
#include <String.h>
|
||||
#include <Window.h>
|
||||
#include <MessageFilter.h>
|
||||
|
||||
#include "DialogPane.h"
|
||||
#include "FilePermissionsView.h"
|
||||
#include "LockingList.h"
|
||||
#include "Utilities.h"
|
||||
|
||||
|
||||
class BMenuField;
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
@@ -75,7 +75,7 @@ TrackerSettingsWindow::TrackerSettingsWindow()
|
||||
|
||||
rect.InsetBy(10, 10);
|
||||
rect.right = rect.left + be_plain_font->StringWidth("Volume Icons")
|
||||
+ B_V_SCROLL_BAR_WIDTH + 40.0f;
|
||||
+ (float)B_V_SCROLL_BAR_WIDTH + 40.0f;
|
||||
fSettingsTypeListView = new BListView(rect, "List View", B_SINGLE_SELECTION_LIST,
|
||||
B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM);
|
||||
BScrollView* scrollView = new BScrollView("scrollview", fSettingsTypeListView,
|
||||
|
||||
Reference in New Issue
Block a user