1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-04 04:44:16 +01:00

various fixes, scrollview scrollers, text painting

This commit is contained in:
kojima
2001-02-20 23:38:36 +00:00
parent 4521852297
commit affcc3babd
12 changed files with 272 additions and 87 deletions

View File

@@ -731,4 +731,37 @@ WMGetViewScreenPosition(WMView *view)
return wmkpoint(x, y);
}
static void resizedParent(void *self, WMNotification *notif)
{
WMSize size = WMGetViewSize((WMView*)WMGetNotificationObject(notif));
WMView *view = (WMView*)self;
W_MoveView(view, view->leftOffs, view->topOffs);
W_ResizeView(view, size.width - (view->leftOffs + view->rightOffs),
size.height - (view->topOffs + view->bottomOffs));
}
void
WMSetViewExpandsToParent(WMView *view, int leftOffs, int topOffs,
int rightOffs, int bottomOffs)
{
WMSize size = view->parent->size;
view->topOffs = topOffs;
view->bottomOffs = bottomOffs;
view->leftOffs = leftOffs;
view->rightOffs = rightOffs;
WMAddNotificationObserver(resizedParent, view,
WMViewSizeDidChangeNotification,
view->parent);
WMSetViewNotifySizeChanges(view->parent, True);
W_MoveView(view, leftOffs, topOffs);
W_ResizeView(view, size.width - (leftOffs + rightOffs),
size.height - (topOffs + bottomOffs));
}