Author: mlytwyn
Date: Thu Aug 13 20:30:58 2015
New Revision: 38879
URL: http://svn.gna.org/viewcvs/gnustep?rev=38879&view=rev
Log:
Per Greg's instructions I've made the new button margins as the only option -
and also made some minor tweaks to the sizing
Modified:
plugins/themes/WinUXTheme/WinNSButton.m
Modified: plugins/themes/WinUXTheme/WinNSButton.m
URL:
http://svn.gna.org/viewcvs/gnustep/plugins/themes/WinUXTheme/WinNSButton.m?rev=38879&r1=38878&r2=38879&view=diff
==============================================================================
--- plugins/themes/WinUXTheme/WinNSButton.m (original)
+++ plugins/themes/WinUXTheme/WinNSButton.m Thu Aug 13 20:30:58 2015
@@ -99,9 +99,9 @@
[self releaseTheme: hTheme];
}
-- (GSThemeMargins) gsButtonMarginsForCell: (NSCell*)cell
- style: (int)style
- state: (GSThemeControlState)state
+- (GSThemeMargins) buttonMarginsForCell: (NSCell*)cell
+ style: (int)style
+ state: (GSThemeControlState)state
{
GSThemeMargins margins = { 0 };
@@ -141,8 +141,10 @@
break;
case NSRegularSquareBezelStyle:
+ margins.left = 2; margins.top = 2; margins.right = 2; margins.bottom = 2;
+ break;
+
case NSShadowlessSquareBezelStyle:
- margins.left = 2; margins.top = 2; margins.right = 2; margins.bottom = 2;
break;
case NSThickSquareBezelStyle:
@@ -188,66 +190,5 @@
return margins;
}
-- (GSThemeMargins) windowsButtonMarginsForCell: (NSCell*)cell
- style: (int)style
- state: (GSThemeControlState)state
-{
- if(!IsThemeActive())
- {
- return [super buttonMarginsForCell: cell
- style: style
- state: state];
- }
-
- HTHEME hTheme;
- NSWindow *window = [[cell controlView] window];
- HWND hwnd = (HWND)[window windowNumber];
-
- hTheme = OpenThemeData(hwnd, L"button");
- if (hTheme != NULL)
- {
- BOOL result = NO;
- GSThemeMargins margins = {0, 0, 0, 0};
-
- if (IsThemePartDefined(hTheme, BP_PUSHBUTTON, 0))
- {
- int drawState = _ButtonStateForThemeControlState(state);
- HDC hDC = GetCurrentHDC();
- MARGINS win32Margins;
-
- result = (GetThemeMargins(hTheme, hDC, BP_PUSHBUTTON, drawState,
- TMT_CONTENTMARGINS, NULL, &win32Margins)
== S_OK);
- if (result)
- {
- margins.left = win32Margins.cxLeftWidth;
- margins.right = win32Margins.cxRightWidth;
- margins.top = win32Margins.cyTopHeight;
- margins.bottom = win32Margins.cyBottomHeight;
- }
- ReleaseCurrentHDC(hDC);
- }
-
- CloseThemeData(hTheme);
- if (result)
- {
- return margins;
- }
- }
-
- return [super buttonMarginsForCell: cell
- style: style
- state: state];
-}
-
-- (GSThemeMargins) buttonMarginsForCell: (NSCell*)cell
- style: (int)style
- state: (GSThemeControlState)state
-{
- NSUserDefaults *userDefs = [NSUserDefaults standardUserDefaults];
-
- if ([userDefs boolForKey: @"GSUseInternalThemeMargins"])
- return [self gsButtonMarginsForCell: cell style: style state: state];
- return [self windowsButtonMarginsForCell: cell style: style state: state];
-}
@end
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs