Adding methods to draw knob and bar to theme.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31666 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2010-11-26 22:48:46 +00:00
parent 03ef6c2fb5
commit 5751234b4b
4 changed files with 42 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2010-11-26 Gregory John Casamento <greg.casamento@gmail.com>
* Source/GSThemeDrawing.m: Added methods to draw NSSliderCell view.
* Source/NSSliderCell.m: Added call in drawKnobInCell:... and
drawBarInside:.. to drawing methods in GSTheme.
* Headers/Additions/GNUstepGUI/GSTheme.h:
Added declaration for new method.
2010-11-26 Gregory John Casamento <greg.casamento@gmail.com>
* Source/GSThemeDrawing.m: Added method to draw NSScrollView view.

View file

@ -957,6 +957,12 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
- (void) drawScrollViewRect: (NSRect)rect
inView: (NSView *)view;
- (void) drawBarInside: (NSRect)rect
inCell: (NSCell *)cell
flipped: (BOOL)flipped;
- (void) drawKnobInCell: (NSCell *)cell;
@end
/**

View file

@ -51,6 +51,7 @@
#import "AppKit/NSTabView.h"
#import "AppKit/NSTabViewItem.h"
#import "AppKit/PSOperators.h"
#import "AppKit/NSSliderCell.h"
#import "GNUstepGUI/GSToolbarView.h"
#import "GNUstepGUI/GSTitleView.h"
@ -2028,4 +2029,26 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
}
}
}
- (void) drawBarInside: (NSRect)rect
inCell: (NSCell *)cell
flipped: (BOOL)flipped
{
NSSliderType type = [(NSSliderCell *)cell sliderType];
if (type == NSLinearSlider)
{
[[NSColor scrollBarColor] set];
NSRectFill(rect);
}
}
- (void) drawKnobInCell: (NSCell *)cell
{
NSView *controlView = [cell controlView];
NSSliderCell *sliderCell = (NSSliderCell *)cell;
[sliderCell drawKnob:
[sliderCell knobRectFlipped:
[controlView isFlipped]]];
}
@end

View file

@ -42,6 +42,7 @@
#import "AppKit/NSSliderCell.h"
#import "AppKit/NSTextFieldCell.h"
#import "AppKit/NSWindow.h"
#import <GNUstepGUI/GSTheme.h>
DEFINE_RINT_IF_MISSING
#ifndef HAVE_ATAN2F
@ -230,11 +231,9 @@ float _floatValueForMousePoint (NSPoint point, NSRect knobRect,
only.</p> */
- (void) drawBarInside: (NSRect)rect flipped: (BOOL)flipped
{
if (_type == NSLinearSlider)
{
[[NSColor scrollBarColor] set];
NSRectFill(rect);
}
[[GSTheme theme] drawBarInside: rect
inCell: self
flipped: flipped];
}
/**<p>Returns the rect in which to draw the knob, based on the
@ -295,7 +294,7 @@ float _floatValueForMousePoint (NSPoint point, NSRect knobRect,
*/
- (void) drawKnob
{
[self drawKnob: [self knobRectFlipped: [_control_view isFlipped]]];
[[GSTheme theme] drawKnobInCell: self];
}
/**<p>Draws the knob in <var>knobRect</var>. Before calling this