Some cleanup in Backround preflet:

* rename a couple of members for imroved clarity
* adjust formatting in header

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42971 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2011-10-29 17:12:44 +00:00
parent d817520f98
commit 4d9b54c175
2 changed files with 93 additions and 93 deletions
+23 -23
View File
@@ -72,10 +72,10 @@ BackgroundsView::BackgroundsView()
{ {
SetBorder(B_NO_BORDER); SetBorder(B_NO_BORDER);
fPreview = new BBox("preview"); fPreviewBox = new BBox("preview");
fPreview->SetLabel(B_TRANSLATE("Preview")); fPreviewBox->SetLabel(B_TRANSLATE("Preview"));
fPreView = new PreView(); fPreview = new Preview();
fTopLeft = new FramePart(FRAME_TOP_LEFT); fTopLeft = new FramePart(FRAME_TOP_LEFT);
fTop = new FramePart(FRAME_TOP); fTop = new FramePart(FRAME_TOP);
@@ -111,7 +111,7 @@ BackgroundsView::BackgroundsView()
.Add(fTop, 1, 0) .Add(fTop, 1, 0)
.Add(fTopRight, 2, 0) .Add(fTopRight, 2, 0)
.Add(fLeft, 0, 1) .Add(fLeft, 0, 1)
.Add(fPreView, 1, 1) .Add(fPreview, 1, 1)
.Add(fRight, 2, 1) .Add(fRight, 2, 1)
.Add(fBottomLeft, 0, 2) .Add(fBottomLeft, 0, 2)
.Add(fBottom, 1, 2) .Add(fBottom, 1, 2)
@@ -129,7 +129,7 @@ BackgroundsView::BackgroundsView()
.AddGlue() .AddGlue()
.View(); .View();
fPreview->AddChild(view); fPreviewBox->AddChild(view);
BBox* rightbox = new BBox("rightbox"); BBox* rightbox = new BBox("rightbox");
@@ -227,7 +227,7 @@ BackgroundsView::BackgroundsView()
view = BLayoutBuilder::Group<>() view = BLayoutBuilder::Group<>()
.AddGroup(B_VERTICAL, 10) .AddGroup(B_VERTICAL, 10)
.AddGroup(B_HORIZONTAL, 10) .AddGroup(B_HORIZONTAL, 10)
.Add(fPreview) .Add(fPreviewBox)
.Add(rightbox) .Add(rightbox)
.End() .End()
.AddGroup(B_HORIZONTAL, 0) .AddGroup(B_HORIZONTAL, 0)
@@ -306,8 +306,8 @@ BackgroundsView::MessageReceived(BMessage* msg)
case kMsgUpdatePreviewPlacement: case kMsgUpdatePreviewPlacement:
{ {
BString xstring, ystring; BString xstring, ystring;
xstring << (int)fPreView->fPoint.x; xstring << (int)fPreview->fPoint.x;
ystring << (int)fPreView->fPoint.y; ystring << (int)fPreview->fPoint.y;
fXPlacementText->SetText(xstring.String()); fXPlacementText->SetText(xstring.String());
fYPlacementText->SetText(ystring.String()); fYPlacementText->SetText(ystring.String());
_UpdatePreview(); _UpdatePreview();
@@ -865,7 +865,7 @@ BackgroundsView::_UpdatePreview()
fXPlacementText->TextView()->MakeEditable(textEnabled); fXPlacementText->TextView()->MakeEditable(textEnabled);
fYPlacementText->TextView()->MakeEditable(textEnabled); fYPlacementText->TextView()->MakeEditable(textEnabled);
fPreView->ClearViewBitmap(); fPreview->ClearViewBitmap();
int32 index = ((BGImageMenuItem*)fImageMenu->FindMarked())->ImageIndex(); int32 index = ((BGImageMenuItem*)fImageMenu->FindMarked())->ImageIndex();
if (index >= 0) { if (index >= 0) {
@@ -877,22 +877,22 @@ BackgroundsView::_UpdatePreview()
atoi(fYPlacementText->Text())), atoi(fYPlacementText->Text())),
fIconLabelOutline->Value() == B_CONTROL_ON, 0, 0); fIconLabelOutline->Value() == B_CONTROL_ON, 0, 0);
if (info->fMode == BackgroundImage::kAtOffset) { if (info->fMode == BackgroundImage::kAtOffset) {
fPreView->SetEnabled(true); fPreview->SetEnabled(true);
fPreView->fPoint.x = atoi(fXPlacementText->Text()); fPreview->fPoint.x = atoi(fXPlacementText->Text());
fPreView->fPoint.y = atoi(fYPlacementText->Text()); fPreview->fPoint.y = atoi(fYPlacementText->Text());
} else } else
fPreView->SetEnabled(false); fPreview->SetEnabled(false);
fPreView->fImageBounds = BRect(bitmap->Bounds()); fPreview->fImageBounds = BRect(bitmap->Bounds());
fCurrent->Show(info, fPreView); fCurrent->Show(info, fPreview);
delete info; delete info;
} }
} else } else
fPreView->SetEnabled(false); fPreview->SetEnabled(false);
fPreView->SetViewColor(fPicker->ValueAsColor()); fPreview->SetViewColor(fPicker->ValueAsColor());
fPreView->Invalidate(); fPreview->Invalidate();
} }
@@ -1144,7 +1144,7 @@ BackgroundsView::FoundPositionSetting()
// #pragma mark - // #pragma mark -
PreView::PreView() Preview::Preview()
: :
BControl("PreView", NULL, NULL, B_WILL_DRAW | B_SUBPIXEL_PRECISE) BControl("PreView", NULL, NULL, B_WILL_DRAW | B_SUBPIXEL_PRECISE)
{ {
@@ -1159,7 +1159,7 @@ PreView::PreView()
void void
PreView::AttachedToWindow() Preview::AttachedToWindow()
{ {
rgb_color color = ViewColor(); rgb_color color = ViewColor();
BControl::AttachedToWindow(); BControl::AttachedToWindow();
@@ -1168,7 +1168,7 @@ PreView::AttachedToWindow()
void void
PreView::MouseDown(BPoint point) Preview::MouseDown(BPoint point)
{ {
if (IsEnabled() && Bounds().Contains(point)) { if (IsEnabled() && Bounds().Contains(point)) {
uint32 buttons; uint32 buttons;
@@ -1190,7 +1190,7 @@ PreView::MouseDown(BPoint point)
void void
PreView::MouseUp(BPoint point) Preview::MouseUp(BPoint point)
{ {
if (IsTracking()) { if (IsTracking()) {
SetTracking(false); SetTracking(false);
@@ -1201,7 +1201,7 @@ PreView::MouseUp(BPoint point)
void void
PreView::MouseMoved(BPoint point, uint32 transit, const BMessage* message) Preview::MouseMoved(BPoint point, uint32 transit, const BMessage* message)
{ {
if (!IsTracking()) { if (!IsTracking()) {
BCursor cursor(IsEnabled() BCursor cursor(IsEnabled()
@@ -78,9 +78,9 @@ private:
}; };
class PreView : public BControl { class Preview : public BControl {
public: public:
PreView(); Preview();
BPoint fPoint; BPoint fPoint;
BRect fImageBounds; BRect fImageBounds;
@@ -148,8 +148,8 @@ protected:
BMenu* fWorkspaceMenu; BMenu* fWorkspaceMenu;
BTextControl* fXPlacementText; BTextControl* fXPlacementText;
BTextControl* fYPlacementText; BTextControl* fYPlacementText;
PreView* fPreView; Preview* fPreview;
BBox* fPreview; BBox* fPreviewBox;
BFilePanel* fFolderPanel; BFilePanel* fFolderPanel;
ImageFilePanel* fPanel; ImageFilePanel* fPanel;