mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 02:30:59 +00:00
* Source/GSTheme.m (-tilesNamed:state:): Interpret .9.png files
as NinePatch=YES. If a tile isn't listed in GSThemeTiles in the plist, try to find it in the ThemeTiles directory anyway. This lets you avoid declaring tiles in the info plist. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37208 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b1340d7958
commit
3b991352f8
2 changed files with 33 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2013-10-08 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Source/GSTheme.m (-tilesNamed:state:): Interpret .9.png files
|
||||||
|
as NinePatch=YES. If a tile isn't listed in GSThemeTiles in the
|
||||||
|
plist, try to find it in the ThemeTiles directory anyway. This
|
||||||
|
lets you avoid declaring tiles in the info plist.
|
||||||
|
|
||||||
2013-10-08 Eric Wasylishen <ewasylishen@gmail.com>
|
2013-10-08 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/GSThemeDrawing.m (NSBox): If drawing with theme tiles,
|
* Source/GSThemeDrawing.m (NSBox): If drawing with theme tiles,
|
||||||
|
|
|
@ -1170,7 +1170,8 @@ typedef struct {
|
||||||
image = [[_imageClass alloc] initWithContentsOfFile: path];
|
image = [[_imageClass alloc] initWithContentsOfFile: path];
|
||||||
if (image != nil)
|
if (image != nil)
|
||||||
{
|
{
|
||||||
if ([[info objectForKey: @"NinePatch"] boolValue])
|
if ([[info objectForKey: @"NinePatch"] boolValue]
|
||||||
|
|| [file hasSuffix: @".9"])
|
||||||
{
|
{
|
||||||
tiles = [[GSDrawTiles alloc]
|
tiles = [[GSDrawTiles alloc]
|
||||||
initWithNinePatchImage: image];
|
initWithNinePatchImage: image];
|
||||||
|
@ -1187,7 +1188,30 @@ typedef struct {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (tiles == nil)
|
||||||
|
{
|
||||||
|
NSString *imagePath;
|
||||||
|
|
||||||
|
// Try 9-patch first
|
||||||
|
imagePath = [_bundle pathForResource: fullName
|
||||||
|
ofType: @"9.png"
|
||||||
|
inDirectory: @"ThemeTiles"];
|
||||||
|
if (imagePath != nil)
|
||||||
|
{
|
||||||
|
image
|
||||||
|
= [[_imageClass alloc] initWithContentsOfFile: imagePath];
|
||||||
|
if (image != nil)
|
||||||
|
{
|
||||||
|
tiles = [[GSDrawTiles alloc]
|
||||||
|
initWithNinePatchImage: image];
|
||||||
|
[tiles setFillStyle: GSThemeFillStyleScaleAll];
|
||||||
|
RELEASE(image);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tiles == nil)
|
||||||
{
|
{
|
||||||
NSArray *imageTypes;
|
NSArray *imageTypes;
|
||||||
NSString *imagePath;
|
NSString *imagePath;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue