Author: gcasa
Date: Thu Jun 25 20:18:41 2015
New Revision: 38681
URL: http://svn.gna.org/viewcvs/gnustep?rev=38681&view=rev
Log:
Added methods to retrieve dimensions for titlebar buttons and padding
dimensions in a theme specific way rather than having them hard-coded.
Modified:
libs/gui/trunk/ChangeLog
libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h
libs/gui/trunk/Source/GSStandardWindowDecorationView.m
libs/gui/trunk/Source/GSThemeDrawing.m
Modified: libs/gui/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38681&r1=38680&r2=38681&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog (original)
+++ libs/gui/trunk/ChangeLog Thu Jun 25 20:18:41 2015
@@ -1,3 +1,11 @@
+2015-06-25 14:17-EDT Gregory John Casamento <[email protected]>
+
+ * Headers/Additions/GNUstepGUI/GSTheme.h: Declarations for new theme
+ methods.
+ * Source/GSStandardWindowDecorationView.m Changes to use new methods.
+ * Source/GSThemeDrawing.m: Add methods to allow retrieving dimensions
+ for window decorations in a theme specific manner.
+
2015-06-14 17:47-EDT Gregory John Casamento <[email protected]>
* Headers/AppKit/NSAnimationContext.h
Modified: libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h?rev=38681&r1=38680&r2=38681&view=diff
==============================================================================
--- libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h (original)
+++ libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h Thu Jun 25
20:18:41 2015
@@ -1163,6 +1163,14 @@
- (float) resizebarHeight;
+- (float) titlebarButtonSize;
+
+- (float) titlebarPaddingRight;
+
+- (float) titlebarPaddingTop;
+
+- (float) titlebarPaddingLeft;
+
- (void) drawWindowBorder: (NSRect)rect
withFrame: (NSRect)frame
forStyleMask: (unsigned int)styleMask
Modified: libs/gui/trunk/Source/GSStandardWindowDecorationView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSStandardWindowDecorationView.m?rev=38681&r1=38680&r2=38681&view=diff
==============================================================================
--- libs/gui/trunk/Source/GSStandardWindowDecorationView.m (original)
+++ libs/gui/trunk/Source/GSStandardWindowDecorationView.m Thu Jun 25
20:18:41 2015
@@ -108,15 +108,18 @@
}
if (hasCloseButton)
{
- closeButtonRect = NSMakeRect(
- [self bounds].size.width - 15 - 4, [self bounds].size.height - 15 - 4,
15, 15);
+ closeButtonRect = NSMakeRect([self bounds].size.width - [theme
titlebarButtonSize] -
+ [theme titlebarPaddingRight], [self
bounds].size.height -
+ [theme titlebarButtonSize] - [theme
titlebarPaddingTop],
+ [theme titlebarButtonSize], [theme
titlebarButtonSize]);
[closeButton setFrame: closeButtonRect];
}
if (hasMiniaturizeButton)
{
- miniaturizeButtonRect = NSMakeRect(
- 4, [self bounds].size.height - 15 - 4, 15, 15);
+ miniaturizeButtonRect = NSMakeRect([theme titlebarPaddingLeft], [self
bounds].size.height -
+ [theme titlebarButtonSize] - [theme
titlebarPaddingTop],
+ [theme titlebarButtonSize], [theme
titlebarButtonSize]);
[miniaturizeButton setFrame: miniaturizeButtonRect];
}
}
Modified: libs/gui/trunk/Source/GSThemeDrawing.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSThemeDrawing.m?rev=38681&r1=38680&r2=38681&view=diff
==============================================================================
--- libs/gui/trunk/Source/GSThemeDrawing.m (original)
+++ libs/gui/trunk/Source/GSThemeDrawing.m Thu Jun 25 20:18:41 2015
@@ -1495,6 +1495,10 @@
/* These include the black border. */
#define TITLE_HEIGHT 23.0
#define RESIZE_HEIGHT 9.0
+#define TITLEBAR_BUTTON_SIZE 15.0
+#define TITLEBAR_PADDING_TOP 4.0
+#define TITLEBAR_PADDING_RIGHT 4.0
+#define TITLEBAR_PADDING_LEFT 4.0
- (float) titlebarHeight
{
@@ -1504,6 +1508,26 @@
- (float) resizebarHeight
{
return RESIZE_HEIGHT;
+}
+
+- (float) titlebarButtonSize
+{
+ return TITLEBAR_BUTTON_SIZE;
+}
+
+- (float) titlebarPaddingRight
+{
+ return TITLEBAR_PADDING_RIGHT;
+}
+
+- (float) titlebarPaddingTop
+{
+ return TITLEBAR_PADDING_TOP;
+}
+
+- (float) titlebarPaddingLeft
+{
+ return TITLEBAR_PADDING_LEFT;
}
static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs