* Clean up * Inserted window-covering view in layout hierarchy. (I removed SetLayout(). Is everything as it should be now?) * Moved creation and resizing of bitmap around and added some temporary printfs trying to figure out the drawing glitch to the right of the barberpole. The view has its view color set to B_TRANSPARENT_COLOR, but that should not affect the area to the right, outside of it. This might be unrelated, but for some reason the activity view fails to keep its barberpole bitmap bounds in sync with the view bounds. The bitmap gets created to match view bounds in AllAttached(), gets recreated by FrameResized() and yet in Draw() it does not always match the view's bounds.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32438 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
#include "ZipOMaticActivity.h"
|
#include "ZipOMaticActivity.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
Activity::Activity(BRect frame, const char* name, uint32 resizingMode,
|
Activity::Activity(BRect frame, const char* name, uint32 resizingMode,
|
||||||
uint32 flags)
|
uint32 flags)
|
||||||
:
|
:
|
||||||
@@ -12,8 +15,6 @@ Activity::Activity(BRect frame, const char* name, uint32 resizingMode,
|
|||||||
fIsRunning(false),
|
fIsRunning(false),
|
||||||
fBitmap(NULL)
|
fBitmap(NULL)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
|
||||||
|
|
||||||
fPattern.data[0] = 0x0f;
|
fPattern.data[0] = 0x0f;
|
||||||
fPattern.data[1] = 0x1e;
|
fPattern.data[1] = 0x1e;
|
||||||
fPattern.data[2] = 0x3c;
|
fPattern.data[2] = 0x3c;
|
||||||
@@ -22,8 +23,6 @@ Activity::Activity(BRect frame, const char* name, uint32 resizingMode,
|
|||||||
fPattern.data[5] = 0xe1;
|
fPattern.data[5] = 0xe1;
|
||||||
fPattern.data[6] = 0xc3;
|
fPattern.data[6] = 0xc3;
|
||||||
fPattern.data[7] = 0x87;
|
fPattern.data[7] = 0x87;
|
||||||
|
|
||||||
_CreateBitmap();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -33,6 +32,14 @@ Activity::~Activity()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Activity::AllAttached()
|
||||||
|
{
|
||||||
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
|
_CreateBitmap();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Activity::Start()
|
Activity::Start()
|
||||||
{
|
{
|
||||||
@@ -86,6 +93,18 @@ Activity::Pulse()
|
|||||||
void
|
void
|
||||||
Activity::Draw(BRect rect)
|
Activity::Draw(BRect rect)
|
||||||
{
|
{
|
||||||
|
BRect viewRect = Bounds();
|
||||||
|
BRect bitmapRect = fBitmap->Bounds();
|
||||||
|
|
||||||
|
if (bitmapRect != viewRect) {
|
||||||
|
printf("Activity::Draw(): bitmapRect != viewRect\n");
|
||||||
|
bitmapRect.PrintToStream();
|
||||||
|
viewRect.PrintToStream();
|
||||||
|
|
||||||
|
delete fBitmap;
|
||||||
|
_CreateBitmap();
|
||||||
|
}
|
||||||
|
|
||||||
_DrawOnBitmap(IsRunning());
|
_DrawOnBitmap(IsRunning());
|
||||||
SetDrawingMode(B_OP_COPY);
|
SetDrawingMode(B_OP_COPY);
|
||||||
DrawBitmap(fBitmap);
|
DrawBitmap(fBitmap);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public:
|
|||||||
void Pause();
|
void Pause();
|
||||||
void Stop();
|
void Stop();
|
||||||
bool IsRunning();
|
bool IsRunning();
|
||||||
|
virtual void AllAttached();
|
||||||
virtual void Pulse();
|
virtual void Pulse();
|
||||||
virtual void Draw(BRect draw);
|
virtual void Draw(BRect draw);
|
||||||
virtual void FrameResized(float width, float height);
|
virtual void FrameResized(float width, float height);
|
||||||
|
|||||||
@@ -61,14 +61,15 @@ ZippoWindow::ZippoWindow(BRect frame, BMessage* refs)
|
|||||||
|
|
||||||
BSeparatorView* separator = new BSeparatorView(B_HORIZONTAL);
|
BSeparatorView* separator = new BSeparatorView(B_HORIZONTAL);
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
BLayoutBuilder::Group<>(this)
|
||||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 10)
|
.AddGroup(B_VERTICAL, 10)
|
||||||
.Add(fActivityView)
|
.Add(fActivityView)
|
||||||
.Add(fArchiveNameView)
|
.Add(fArchiveNameView)
|
||||||
.Add(fZipOutputView)
|
.Add(fZipOutputView)
|
||||||
.Add(separator)
|
.Add(separator)
|
||||||
.Add(fStopButton)
|
.Add(fStopButton)
|
||||||
.SetInsets(14, 14, 14, 14)
|
.SetInsets(14, 14, 14, 14)
|
||||||
|
.End()
|
||||||
.End();
|
.End();
|
||||||
|
|
||||||
if (refs != NULL) {
|
if (refs != NULL) {
|
||||||
@@ -266,11 +267,3 @@ ZippoWindow::_CloseWindowOrKeepOpen()
|
|||||||
PostMessage(B_QUIT_REQUESTED);
|
PostMessage(B_QUIT_REQUESTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
ZippoWindow::Zoom(BPoint origin, float width, float height)
|
|
||||||
{
|
|
||||||
// TODO: Think about removing this method when
|
|
||||||
// zipomatic's new layout code works right.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ public:
|
|||||||
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
virtual void Zoom(BPoint origin, float width, float height);
|
|
||||||
|
|
||||||
bool IsZipping();
|
bool IsZipping();
|
||||||
void StopZipping();
|
void StopZipping();
|
||||||
|
|||||||
Reference in New Issue
Block a user