mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Modified NSDrawGrayBezel and NSDrawWhiteBezel so that they look nicer
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10696 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
529c95f758
commit
0e4a09cb8d
1 changed files with 20 additions and 12 deletions
|
@ -447,12 +447,12 @@ NSDrawButton(const NSRect aRect, const NSRect clipRect)
|
|||
void
|
||||
NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect)
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMinXEdge, NSMaxYEdge, NSMinXEdge, NSMaxYEdge,
|
||||
NSMaxXEdge, NSMinYEdge, NSMaxXEdge, NSMinYEdge};
|
||||
NSRectEdge down_sides[] = {NSMinXEdge, NSMinYEdge, NSMinXEdge, NSMinYEdge,
|
||||
NSMaxXEdge, NSMaxYEdge, NSMaxXEdge, NSMaxYEdge};
|
||||
float grays[] = {NSDarkGray, NSDarkGray, NSBlack, NSBlack,
|
||||
NSWhite, NSWhite, NSLightGray, NSLightGray};
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||
NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge,
|
||||
NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge};
|
||||
float grays[] = {NSWhite, NSWhite, NSDarkGray, NSDarkGray,
|
||||
NSLightGray, NSLightGray, NSBlack, NSBlack};
|
||||
NSRect rect;
|
||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
|
||||
|
@ -460,11 +460,19 @@ NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect)
|
|||
{
|
||||
rect = NSDrawTiledRects(aRect, clipRect,
|
||||
down_sides, grays, 8);
|
||||
// to give a really clean look we add 2 dark gray points
|
||||
DPSsetgray(ctxt, NSDarkGray);
|
||||
DPSrectfill(ctxt, NSMinX(aRect) + 1., NSMaxY(aRect) - 2., 1., 1.);
|
||||
DPSrectfill(ctxt, NSMaxX(aRect) - 2., NSMinY(aRect) + 1., 1., 1.);
|
||||
}
|
||||
else
|
||||
{
|
||||
rect = NSDrawTiledRects(aRect, clipRect,
|
||||
up_sides, grays, 8);
|
||||
// to give a really clean look we add 2 dark gray points
|
||||
DPSsetgray(ctxt, NSDarkGray);
|
||||
DPSrectfill(ctxt, NSMinX(aRect) + 1., NSMinY(aRect) + 1., 1., 1.);
|
||||
DPSrectfill(ctxt, NSMaxX(aRect) - 2., NSMaxY(aRect) - 2., 1., 1.);
|
||||
}
|
||||
|
||||
DPSsetgray(ctxt, NSLightGray);
|
||||
|
@ -503,12 +511,12 @@ NSDrawGroove(const NSRect aRect, const NSRect clipRect)
|
|||
void
|
||||
NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect)
|
||||
{
|
||||
NSRectEdge up_sides[] = {NSMinXEdge, NSMaxYEdge, NSMinXEdge, NSMaxYEdge,
|
||||
NSMaxXEdge, NSMinYEdge, NSMaxXEdge, NSMinYEdge};
|
||||
NSRectEdge down_sides[] = {NSMinXEdge, NSMinYEdge, NSMinXEdge, NSMinYEdge,
|
||||
NSMaxXEdge, NSMaxYEdge, NSMaxXEdge, NSMaxYEdge};
|
||||
float grays[] = {NSDarkGray, NSDarkGray, NSDarkGray, NSDarkGray,
|
||||
NSWhite, NSWhite, NSLightGray, NSLightGray};
|
||||
NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge,
|
||||
NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge};
|
||||
NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge,
|
||||
NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge};
|
||||
float grays[] = {NSWhite, NSWhite, NSDarkGray, NSDarkGray,
|
||||
NSLightGray, NSLightGray, NSDarkGray, NSDarkGray};
|
||||
NSRect rect;
|
||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
|
||||
|
|
Loading…
Reference in a new issue