Author: mlytwyn
Date: Fri Jun 26 18:47:48 2015
New Revision: 38700
URL: http://svn.gna.org/viewcvs/gnustep?rev=38700&view=rev
Log:
GSTitleView and GSToolbarCustomizationPalette merges
Modified:
libs/gui/branches/gnustep_testplant_branch/Source/GSTitleView.m
libs/gui/branches/gnustep_testplant_branch/Source/GSToolbarCustomizationPalette.m
Modified: libs/gui/branches/gnustep_testplant_branch/Source/GSTitleView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSTitleView.m?rev=38700&r1=38699&r2=38700&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/GSTitleView.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/GSTitleView.m Fri Jun
26 18:47:48 2015
@@ -189,6 +189,7 @@
RELEASE(textAttributes);
RELEASE(titleColor);
+ [[GSTheme theme] setName: nil forElement: [closeButton cell] temporary: NO];
TEST_RELEASE(closeButton);
TEST_RELEASE(miniaturizeButton);
@@ -206,66 +207,13 @@
- (void) drawRect: (NSRect)rect
{
- GSTheme *theme = [GSTheme theme];
- NSRect workRect = [self bounds];
- NSSize titleSize;
- NSRectEdge top_left[] = {NSMinXEdge, NSMaxYEdge};
- NSRectEdge bottom_right[] = {NSMaxXEdge, NSMinYEdge};
- CGFloat blacks[] = {NSBlack, NSBlack};
- CGFloat grays[] = {NSLightGray, NSLightGray};
- CGFloat darkGrays[] = {NSDarkGray, NSDarkGray};
-
- // Draw the dark gray upper left lines for menu and black for others.
- // Rectangle 1
- if (_ownedByMenu)
- workRect = NSDrawTiledRects(workRect, workRect, top_left, darkGrays, 2);
- else
- workRect = NSDrawTiledRects(workRect, workRect, top_left, blacks, 2);
-
-
- // Rectangle 2
- // Draw the title box's button.
- [theme drawButton: workRect withClip: workRect];
-
- // Overdraw white top and left lines with light gray lines for window title
- workRect.origin.y += 1;
- workRect.size.height -= 1;
- workRect.size.width -= 1;
- if (!_ownedByMenu && (_isKeyWindow || _isMainWindow))
- {
- NSDrawTiledRects(workRect, workRect, top_left, grays, 2);
- }
-
- // Rectangle 3
- // Paint background
- workRect.origin.x += 1;
- workRect.origin.y += 1;
- workRect.size.height -= 2;
- workRect.size.width -= 2;
-
- [titleColor set];
- NSRectFill(workRect);
-
- if (!_ownedByMenu && _isMainWindow && !_isKeyWindow)
- {
- NSRect blRect = workRect;
-
- blRect.origin.y -= 1;
- blRect.size.width += 1;
- blRect.size.height += 1;
- NSDrawTiledRects(blRect, blRect, bottom_right, blacks, 2);
- }
-
+ NSRect workRect = [[GSTheme theme] drawMenuTitleBackground: self
+ withBounds: [self bounds]
+ withClip: rect];
// Draw the title
- titleSize = [self titleSize];
- if (_ownedByMenu)
- {
+ NSSize titleSize = [self titleSize];
workRect.origin.x += 4;
- }
- else
- {
- workRect.origin.x += NSMidX (workRect) - titleSize.width / 2;
- }
+
workRect.origin.y = NSMidY (workRect) - titleSize.height / 2;
workRect.size.height = titleSize.height;
[[_owner title] drawInRect: workRect withAttributes: textAttributes];
@@ -443,12 +391,14 @@
NSSize viewSize;
NSSize buttonSize;
+ [[GSTheme theme] setName: nil forElement: [closeButton cell] temporary:
NO];
ASSIGN(closeButton,
[NSWindow standardWindowButton:
NSWindowCloseButton
forStyleMask:
NSTitledWindowMask | NSClosableWindowMask
| NSMiniaturizableWindowMask]);
+ [[GSTheme theme] setName: @"GSMenuCloseButton" forElement: [closeButton
cell] temporary: NO];
[closeButton setTarget: _owner];
[closeButton setAction: closeAction];
Modified:
libs/gui/branches/gnustep_testplant_branch/Source/GSToolbarCustomizationPalette.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSToolbarCustomizationPalette.m?rev=38700&r1=38699&r2=38700&view=diff
==============================================================================
---
libs/gui/branches/gnustep_testplant_branch/Source/GSToolbarCustomizationPalette.m
(original)
+++
libs/gui/branches/gnustep_testplant_branch/Source/GSToolbarCustomizationPalette.m
Fri Jun 26 18:47:48 2015
@@ -304,6 +304,7 @@
{
NSToolbarItem *item = [toolbar _toolbarItemForIdentifier: identifier
willBeInsertedIntoToolbar: NO];
+ NSDebugLLog(DEBUG_LEVEL, @"item %@ for ident %@", item, identifier);
[_allowedItems addObject: item];
}
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs