mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-08 23:04:15 +01:00
changed stuff in WMSetBoxExpandsToParent
This commit is contained in:
22
WINGs/wbox.c
22
WINGs/wbox.c
@@ -23,6 +23,11 @@ typedef struct W_Box {
|
||||
|
||||
short borderWidth;
|
||||
|
||||
int topOffs;
|
||||
int bottomOffs;
|
||||
int leftOffs;
|
||||
int rightOffs;
|
||||
|
||||
unsigned horizontal:1;
|
||||
} Box;
|
||||
|
||||
@@ -53,8 +58,11 @@ static void resizedParent(void *self, WMNotification *notif)
|
||||
{
|
||||
WMView *view = (WMView*)WMGetNotificationObject(notif);
|
||||
WMSize size = WMGetViewSize(view);
|
||||
WMBox *box = (WMBox*)self;
|
||||
|
||||
WMResizeWidget((WMWidget*)self, size.width, size.height);
|
||||
WMMoveWidget(box, box->leftOffs, box->topOffs);
|
||||
WMResizeWidget(box, size.width - (box->leftOffs + box->rightOffs),
|
||||
size.height - (box->topOffs + box->bottomOffs));
|
||||
}
|
||||
|
||||
|
||||
@@ -242,16 +250,24 @@ WMSetBoxHorizontal(WMBox *box, Bool flag)
|
||||
|
||||
|
||||
void
|
||||
WMSetBoxExpandsToParent(WMBox *box)
|
||||
WMSetBoxExpandsToParent(WMBox *box, int topOffs, int bottomOffs,
|
||||
int leftOffs, int rightOffs)
|
||||
{
|
||||
WMSize size = W_VIEW(box)->parent->size;
|
||||
|
||||
box->topOffs = topOffs;
|
||||
box->bottomOffs = bottomOffs;
|
||||
box->leftOffs = leftOffs;
|
||||
box->rightOffs = rightOffs;
|
||||
|
||||
WMAddNotificationObserver(resizedParent, box,
|
||||
WMViewSizeDidChangeNotification,
|
||||
W_VIEW(box)->parent);
|
||||
WMSetViewNotifySizeChanges(W_VIEW(box)->parent, True);
|
||||
|
||||
WMResizeWidget(box, size.width, size.height);
|
||||
WMMoveWidget(box, leftOffs, topOffs);
|
||||
WMResizeWidget(box, size.width - (leftOffs + rightOffs),
|
||||
size.height - (topOffs + bottomOffs));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user