Author: gcasa
Date: Fri Jun 26 02:13:05 2015
New Revision: 38687
URL: http://svn.gna.org/viewcvs/gnustep?rev=38687&view=rev
Log:
Add more theme methods for theming windows.
Added:
libs/gui/trunk/Source/GSThemeWindow.m
Modified:
libs/gui/trunk/ChangeLog
libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h
libs/gui/trunk/Source/GNUmakefile
libs/gui/trunk/Source/NSWindow.m
Modified: libs/gui/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38687&r1=38686&r2=38687&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog (original)
+++ libs/gui/trunk/ChangeLog Fri Jun 26 02:13:05 2015
@@ -1,3 +1,12 @@
+2015-06-25 20:11-EDT Gregory John Casamento <[email protected]>
+
+ * Headers/Additions/GNUstepGUI/GSTheme.h: Add declarations for method
+ * Source/GNUmakefile: Add new file GSThemeWindow.m
+ * Source/GSThemeWindow.m: Add method standardWindowButton:
+ forStyleMask:.
+ * Source/NSWindow.m: Call theme methods to return standardWindowButton:
+ forStyleMask:.
+
2015-06-25 14:17-EDT Gregory John Casamento <[email protected]>
* Headers/Additions/GNUstepGUI/GSTheme.h: Declarations for new theme
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=38687&r1=38686&r2=38687&view=diff
==============================================================================
--- libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h (original)
+++ libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h Fri Jun 26
02:13:05 2015
@@ -1465,5 +1465,20 @@
- (Class) pageLayoutClass;
@end
+@interface GSTheme (NSWindow)
+/**
+ * This method returns the standard window button for the
+ * given mask for the current theme.
+ */
+- (NSButton *) standardWindowButton: (NSWindowButton)button
+ forStyleMask: (NSUInteger) mask;
+
+/**
+ * This method does any additional setup after the default
+ * cell is set.
+ */
+- (void) didSetDefaultButtonCell: (NSButtonCell *)aCell;
+@end
+
#endif /* OS_API_VERSION */
#endif /* _GNUstep_H_GSTheme */
Modified: libs/gui/trunk/Source/GNUmakefile
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GNUmakefile?rev=38687&r1=38686&r2=38687&view=diff
==============================================================================
--- libs/gui/trunk/Source/GNUmakefile (original)
+++ libs/gui/trunk/Source/GNUmakefile Fri Jun 26 02:13:05 2015
@@ -235,6 +235,7 @@
GSThemePanel.m \
GSThemePrintPanels.m \
GSThemeTools.m \
+GSThemeWindow.m \
GSTitleView.m \
GSToolTips.m \
GSToolbarView.m \
Added: libs/gui/trunk/Source/GSThemeWindow.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSThemeWindow.m?rev=38687&view=auto
==============================================================================
--- libs/gui/trunk/Source/GSThemeWindow.m (added)
+++ libs/gui/trunk/Source/GSThemeWindow.m Fri Jun 26 02:13:05 2015
@@ -0,0 +1,89 @@
+/** <title>GSThemeWindow</title>
+
+ <abstract>The theme methods for window specific functions</abstract>
+
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+ Author: Gregory Casamento <[email protected]>
+ Date: Jun 2015
+
+ This file is part of the GNU Objective C User interface library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; see the file COPYING.LIB.
+ If not, see <http://www.gnu.org/licenses/> or write to the
+ Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#import "AppKit/NSWindow.h"
+#import "AppKit/NSImage.h"
+#import "AppKit/NSButton.h"
+
+#import "GNUstepGUI/GSTheme.h"
+#import "GNUstepGUI/GSWindowDecorationView.h"
+#import "GSThemePrivate.h"
+
+@implementation GSTheme (NSWindow)
+- (NSButton *) standardWindowButton: (NSWindowButton)button
+ forStyleMask: (NSUInteger) mask
+{
+ NSButton *newButton;
+
+ newButton = [[NSButton alloc] init];
+ [newButton setRefusesFirstResponder: YES];
+ [newButton setButtonType: NSMomentaryChangeButton];
+ [newButton setImagePosition: NSImageOnly];
+ [newButton setBordered: YES];
+ [newButton setTag: button];
+
+ switch (button)
+ {
+ case NSWindowCloseButton:
+ [newButton setImage: [NSImage imageNamed: @"common_Close"]];
+ [newButton setAlternateImage: [NSImage imageNamed: @"common_CloseH"]];
+ /* TODO: -performClose: should (but doesn't currently) highlight the
+ button, which is wrong here. When -performClose: is fixed, we'll
need a
+ different method here. */
+ [newButton setAction: @selector(performClose:)];
+ break;
+
+ case NSWindowMiniaturizeButton:
+ [newButton setImage: [NSImage imageNamed: @"common_Miniaturize"]];
+ [newButton setAlternateImage: [NSImage imageNamed:
@"common_MiniaturizeH"]];
+ [newButton setAction: @selector(miniaturize:)];
+ break;
+
+ case NSWindowZoomButton:
+ // FIXME
+ [newButton setAction: @selector(zoom:)];
+ break;
+
+ case NSWindowToolbarButton:
+ // FIXME
+ [newButton setAction: @selector(toggleToolbarShown:)];
+ break;
+ case NSWindowDocumentIconButton:
+ default:
+ // FIXME
+ break;
+ }
+
+ return AUTORELEASE(newButton);
+}
+
+- (void) didSetDefaultButtonCell: (NSButtonCell *)aCell
+{
+ // default implementation does nothing...
+}
+@end
Modified: libs/gui/trunk/Source/NSWindow.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSWindow.m?rev=38687&r1=38686&r2=38687&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSWindow.m (original)
+++ libs/gui/trunk/Source/NSWindow.m Fri Jun 26 02:13:05 2015
@@ -3234,48 +3234,8 @@
+ (NSButton *) standardWindowButton: (NSWindowButton)button
forStyleMask: (NSUInteger) mask
{
- NSButton *newButton;
-
- newButton = [[NSButton alloc] init];
- [newButton setRefusesFirstResponder: YES];
- [newButton setButtonType: NSMomentaryChangeButton];
- [newButton setImagePosition: NSImageOnly];
- [newButton setBordered: YES];
- [newButton setTag: button];
-
- switch (button)
- {
- case NSWindowCloseButton:
- [newButton setImage: [NSImage imageNamed: @"common_Close"]];
- [newButton setAlternateImage: [NSImage imageNamed: @"common_CloseH"]];
- /* TODO: -performClose: should (but doesn't currently) highlight the
- button, which is wrong here. When -performClose: is fixed, we'll
need a
- different method here. */
- [newButton setAction: @selector(performClose:)];
- break;
-
- case NSWindowMiniaturizeButton:
- [newButton setImage: [NSImage imageNamed: @"common_Miniaturize"]];
- [newButton setAlternateImage: [NSImage imageNamed:
@"common_MiniaturizeH"]];
- [newButton setAction: @selector(miniaturize:)];
- break;
-
- case NSWindowZoomButton:
- // FIXME
- [newButton setAction: @selector(zoom:)];
- break;
-
- case NSWindowToolbarButton:
- // FIXME
- [newButton setAction: @selector(toggleToolbarShown:)];
- break;
- case NSWindowDocumentIconButton:
- default:
- // FIXME
- break;
- }
-
- return AUTORELEASE(newButton);
+ return [[GSTheme theme] standardWindowButton: button
+ forStyleMask: mask];
}
- (NSButton *) standardWindowButton: (NSWindowButton)button
@@ -5164,6 +5124,7 @@
[aCell setKeyEquivalent: @"\r"];
[aCell setKeyEquivalentModifierMask: 0];
+ [[GSTheme theme] didSetDefaultButtonCell: aCell];
}
- (void) disableKeyEquivalentForDefaultButtonCell
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs