mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Use wGetColorForColormap() when allocating border pixel.
Cut down on code duplication by using the new wGetColorForColormap() function in allocFrameBorderPixel().
This commit is contained in:
committed by
Carlos R. Mafra
parent
69ff0d72cc
commit
c3a2438fac
@@ -34,6 +34,7 @@
|
|||||||
#include "WindowMaker.h"
|
#include "WindowMaker.h"
|
||||||
#include "GNUstep.h"
|
#include "GNUstep.h"
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
#include "resources.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "wcore.h"
|
#include "wcore.h"
|
||||||
#include "framewin.h"
|
#include "framewin.h"
|
||||||
@@ -65,14 +66,8 @@ static void allocFrameBorderPixel(Colormap colormap, char *color_name, unsigned
|
|||||||
|
|
||||||
*pixel = NULL;
|
*pixel = NULL;
|
||||||
|
|
||||||
if (!XParseColor(dpy, colormap, color_name, &xcol)) {
|
if (! wGetColorForColormap(colormap, color_name, &xcol))
|
||||||
wwarning(_("could not parse color \"%s\""), color_name);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
if (!XAllocColor(dpy, colormap, &xcol)) {
|
|
||||||
wwarning(_("could not allocate color \"%s\""), color_name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
*pixel = wmalloc(sizeof(unsigned long));
|
*pixel = wmalloc(sizeof(unsigned long));
|
||||||
if (*pixel)
|
if (*pixel)
|
||||||
|
|||||||
Reference in New Issue
Block a user