mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
Add GSThemeDisabledState
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29455 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1d764b8771
commit
82d6f25159
5 changed files with 26 additions and 1 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,4 +1,12 @@
|
|||
2010-01-29 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
2010-02-01 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/GSTheme.m:
|
||||
* Source/GSThemeDrawing.m:
|
||||
* Source/NSButtonCell.m
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||
Add a new theme state, GSThemeDisabledState.
|
||||
|
||||
2010-01-31 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/GSTheme.m:
|
||||
* Source/GSThemeDrawing.m:
|
||||
|
|
|
@ -315,6 +315,7 @@ GSThemeFillStyleFromString(NSString *s);
|
|||
*/
|
||||
typedef enum {
|
||||
GSThemeNormalState = 0, /** A control in its normal state */
|
||||
GSThemeDisabledState, /** A control which is disabled */
|
||||
GSThemeHighlightedState, /** A control which is highlighted */
|
||||
GSThemeSelectedState /** A control which is selected */
|
||||
} GSThemeControlState;
|
||||
|
|
|
@ -1287,6 +1287,9 @@ typedef struct {
|
|||
case GSThemeNormalState:
|
||||
fullName = aName;
|
||||
break;
|
||||
case GSThemeDisabledState:
|
||||
fullName = [aName stringByAppendingString: @"Disabled"];
|
||||
break;
|
||||
case GSThemeHighlightedState:
|
||||
fullName = [aName stringByAppendingString: @"Highlighted"];
|
||||
break;
|
||||
|
|
|
@ -80,6 +80,10 @@
|
|||
{
|
||||
color = [NSColor selectedControlColor];
|
||||
}
|
||||
else
|
||||
{
|
||||
color = [NSColor controlBackgroundColor];
|
||||
}
|
||||
}
|
||||
|
||||
tiles = [self tilesNamed: name state: state];
|
||||
|
@ -141,6 +145,10 @@
|
|||
{
|
||||
[self drawGrayBezel: frame withClip: NSZeroRect];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self drawButton: frame withClip: NSZeroRect];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -910,6 +910,11 @@ typedef struct _GSButtonCellFlags
|
|||
buttonState = GSThemeSelectedState;
|
||||
}
|
||||
|
||||
if (_cell.is_disabled && buttonState != GSThemeHighlightedState)
|
||||
{
|
||||
buttonState = GSThemeDisabledState;
|
||||
}
|
||||
|
||||
[[GSTheme theme] drawButton: cellFrame
|
||||
in: self
|
||||
view: controlView
|
||||
|
|
Loading…
Reference in a new issue