Changeset - r18406:ba2bbd601cc7
[Not reviewed]
master
0 2 0
frosch - 13 years ago 2011-11-18 20:38:30
frosch@openttd.org
(svn r23252) -Codechange: Add WD_BEVEL_xxx constants.
2 files changed with 15 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -184,20 +184,20 @@ void DrawFrameRect(int left, int top, in
 
		uint interior;
 

	
 
		if (flags & FR_LOWERED) {
 
			GfxFillRect(left,     top,     left,  bottom,     dark);
 
			GfxFillRect(left + 1, top,     right, top,        dark);
 
			GfxFillRect(right,    top + 1, right, bottom - 1, light);
 
			GfxFillRect(left + 1, bottom,  right, bottom,     light);
 
			GfxFillRect(left,                 top,                left,                   bottom,                   dark);
 
			GfxFillRect(left + WD_BEVEL_LEFT, top,                right,                  top,                      dark);
 
			GfxFillRect(right,                top + WD_BEVEL_TOP, right,                  bottom - WD_BEVEL_BOTTOM, light);
 
			GfxFillRect(left + WD_BEVEL_LEFT, bottom,             right,                  bottom,                   light);
 
			interior = (flags & FR_DARKENED ? medium_dark : medium_light);
 
		} else {
 
			GfxFillRect(left,     top,    left,      bottom - 1, light);
 
			GfxFillRect(left + 1, top,    right - 1, top,        light);
 
			GfxFillRect(right,    top,    right,     bottom - 1, dark);
 
			GfxFillRect(left,     bottom, right,     bottom,     dark);
 
			GfxFillRect(left,                 top,                left,                   bottom - WD_BEVEL_BOTTOM, light);
 
			GfxFillRect(left + WD_BEVEL_LEFT, top,                right - WD_BEVEL_RIGHT, top,                      light);
 
			GfxFillRect(right,                top,                right,                  bottom - WD_BEVEL_BOTTOM, dark);
 
			GfxFillRect(left,                 bottom,             right,                  bottom,                   dark);
 
			interior = medium_dark;
 
		}
 
		if (!(flags & FR_BORDERONLY)) {
 
			GfxFillRect(left + 1, top + 1, right - 1, bottom - 1, interior);
 
			GfxFillRect(left + WD_BEVEL_LEFT, top + WD_BEVEL_TOP, right - WD_BEVEL_RIGHT, bottom - WD_BEVEL_BOTTOM, interior);
 
		}
 
	}
 
}
src/window_gui.h
Show inline comments
 
@@ -56,6 +56,12 @@ enum WidgetDrawDistances {
 
	WD_SCROLLBAR_TOP    = 2,    ///< Top offset of scrollbar.
 
	WD_SCROLLBAR_BOTTOM = 2,    ///< Bottom offset of scrollbar.
 

	
 
	/* Size of the pure frame bevel without any padding. */
 
	WD_BEVEL_LEFT       = 1,    ///< Width of left bevel border.
 
	WD_BEVEL_RIGHT      = 1,    ///< Width of right bevel border.
 
	WD_BEVEL_TOP        = 1,    ///< Height of top bevel border.
 
	WD_BEVEL_BOTTOM     = 1,    ///< Height of bottom bevel border.
 

	
 
	/* FrameRect widgets, all text buttons, panel, editbox */
 
	WD_FRAMERECT_LEFT   = 2,    ///< Offset at left to draw the frame rectangular area
 
	WD_FRAMERECT_RIGHT  = 2,    ///< Offset at right to draw the frame rectangular area
0 comments (0 inline, 0 general)