The complete S&T group has an additional, surrounding magnetic border now. Fixes #7437.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42378 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <WindowPrivate.h>
|
||||
|
||||
#include "DrawingEngine.h"
|
||||
#include "SATWindow.h"
|
||||
|
||||
|
||||
//#define DEBUG_SATDECORATOR
|
||||
@@ -66,6 +67,13 @@ SATDecorAddOn::InitCheck() const
|
||||
}
|
||||
|
||||
|
||||
WindowBehaviour*
|
||||
SATDecorAddOn::AllocateWindowBehaviour(Window* window)
|
||||
{
|
||||
return new (std::nothrow)SATWindowBehaviour(window, &fStackAndTile);
|
||||
}
|
||||
|
||||
|
||||
Decorator*
|
||||
SATDecorAddOn::_AllocateDecorator(DesktopSettings& settings, BRect rect,
|
||||
window_look look, uint32 flags)
|
||||
@@ -467,6 +475,40 @@ SATDecorator::GetComponentColors(Component component, uint8 highlight,
|
||||
}
|
||||
|
||||
|
||||
SATWindowBehaviour::SATWindowBehaviour(Window* window, StackAndTile* sat)
|
||||
:
|
||||
DefaultWindowBehaviour(window),
|
||||
|
||||
fStackAndTile(sat)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SATWindowBehaviour::AlterDeltaForSnap(Window* window, BPoint& delta,
|
||||
bigtime_t now)
|
||||
{
|
||||
if (DefaultWindowBehaviour::AlterDeltaForSnap(window, delta, now) == true)
|
||||
return true;
|
||||
|
||||
SATWindow* satWindow = fStackAndTile->GetSATWindow(window);
|
||||
if (satWindow == NULL)
|
||||
return false;
|
||||
SATGroup* group = satWindow->GetGroup();
|
||||
if (group == NULL)
|
||||
return false;
|
||||
|
||||
BRect groupFrame = group->WindowAt(0)->CompleteWindowFrame();
|
||||
for (int32 i = 1; i < group->CountItems(); i++)
|
||||
groupFrame = groupFrame | group->WindowAt(i)->CompleteWindowFrame();
|
||||
|
||||
fMagneticBorder.AlterDeltaForSnap(window->Screen(),
|
||||
groupFrame, delta, now);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
extern "C" DecorAddOn* (instantiate_decor_addon)(image_id id, const char* name)
|
||||
{
|
||||
return new (std::nothrow)SATDecorAddOn(id, name);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "DecorManager.h"
|
||||
#include "DefaultDecorator.h"
|
||||
#include "DefaultWindowBehaviour.h"
|
||||
#include "StackAndTile.h"
|
||||
|
||||
|
||||
@@ -20,6 +21,8 @@ public:
|
||||
|
||||
virtual status_t InitCheck() const;
|
||||
|
||||
virtual WindowBehaviour* AllocateWindowBehaviour(Window* window);
|
||||
|
||||
protected:
|
||||
virtual Decorator* _AllocateDecorator(DesktopSettings& settings,
|
||||
BRect rect, window_look look, uint32 flags);
|
||||
@@ -71,4 +74,18 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SATWindowBehaviour : public DefaultWindowBehaviour {
|
||||
public:
|
||||
SATWindowBehaviour(Window* window,
|
||||
StackAndTile* sat);
|
||||
|
||||
protected:
|
||||
virtual bool AlterDeltaForSnap(Window* window, BPoint& delta,
|
||||
bigtime_t now);
|
||||
|
||||
private:
|
||||
StackAndTile* fStackAndTile;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
|
||||
#include <Region.h>
|
||||
|
||||
#include "MagneticBorder.h"
|
||||
#include "SATDecorator.h"
|
||||
#include "Stacking.h"
|
||||
#include "Tiling.h"
|
||||
@@ -63,6 +65,8 @@ private:
|
||||
Constraint* fKeepMaxHeightConstraint;
|
||||
Constraint* fWidthConstraint;
|
||||
Constraint* fHeightConstraint;
|
||||
|
||||
MagneticBorder fMagneticBorder;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user