Changeset 1099
- Timestamp:
- 6/3/2009 3:24:58 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/eraser6/Eraser.Util/UxThemeApi.cs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Eraser.Util/UxThemeApi.cs
r1098 r1099 160 160 IntPtr hDC = e.Graphics.GetHdc(); 161 161 Rectangle rect = e.AffectedBounds; 162 rect.Width = GutterWidth;163 162 rect.Inflate(-2, -2); 164 163 rect.Offset(1, 1); 165 rect.Size = new Size( rect.Width, rect.Height + 1);164 rect.Size = new Size(GutterWidth, rect.Height + 1); 166 165 167 166 NativeMethods.DrawThemeBackground(hTheme, hDC, … … 175 174 Rectangle rect = Rectangle.Truncate(e.Graphics.VisibleClipBounds); 176 175 rect.Inflate(-1, 0); 177 rect.Offset( 1, 0);176 rect.Offset(2, 0); 178 177 IntPtr hDC = e.Graphics.GetHdc(); 179 178 … … 209 208 } 210 209 211 Rectangle imgRect = e.ImageRectangle; 212 imgRect.Inflate(4, 3); 213 imgRect.Offset(1, 0); 214 Rectangle bgRect = imgRect; 210 //Create the rectangle for the checkmark: 211 // 1. Offset by 2px 212 // 2. Inflate by (4, 3) 213 // 3. Increase width by 1px to fall on even x-coordinate (correction for odd pixel offset) 214 Rectangle imgRect = new Rectangle(e.ImageRectangle.Left + 2 - 4, 215 e.ImageRectangle.Top - 3, 216 e.ImageRectangle.Width + 4 * 2 + 1, e.ImageRectangle.Height + 3 * 2); 215 217 216 218 IntPtr hDC = e.Graphics.GetHdc(); … … 221 223 NativeMethods.DrawThemeBackground(hTheme, hDC, 222 224 (int)NativeMethods.MENUPARTS.MENU_POPUPCHECKBACKGROUND, bgState, 223 ref bgRect, ref bgRect);225 ref imgRect, ref imgRect); 224 226 225 227 int checkState = (int)(item.Checked ? … … 242 244 243 245 Rectangle newRect = e.TextRectangle; 244 newRect.Offset( 1, 0);246 newRect.Offset(2, 0); 245 247 e.TextRectangle = newRect; 246 248 Rectangle rect = new Rectangle(e.TextRectangle.Left, 0, … … 297 299 (int)NativeMethods.MENUPARTS.MENU_POPUPCHECK, 0, 298 300 IntPtr.Zero, NativeMethods.THEMESIZE.TS_TRUE, ref checkSize); 299 return 2 * checkSize.Width ;301 return 2 * checkSize.Width + margins.Left + margins.Width - 1; 300 302 } 301 303 }
Note: See TracChangeset
for help on using the changeset viewer.
