1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-15 05:25:53 +01:00

- Updated WINGs/NEWS with info about hw the API changed how how things

are affected. Fixes for old code too.
- Double buffering in WMList. All widgets or apps using WMList and
  having user drawing porcedures in place will inherit this double
  buffering automatically too.
- New functions in WINGs: WMGetColorAlpha(), WMIsAAFont()
- Misc code cleanups in WINGs and src/dialog.c
This commit is contained in:
dan
2002-10-16 04:05:45 +00:00
parent 2b2fecac12
commit 1e92274495
23 changed files with 346 additions and 243 deletions

View File

@@ -1296,7 +1296,7 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
WMScreen *scr = WMWidgetScreen(lPtr);
int width, height, x, y;
Display *dpy = WMScreenDisplay(scr);
WMColor *white = WMWhiteColor(scr);
WMColor *back = (state & WLDSSelected) ? WMWhiteColor(scr) : WMGrayColor(scr);
WMListItem *item;
WMColor *black = WMBlackColor(scr);
TextureListItem *titem;
@@ -1304,7 +1304,7 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
item = WMGetListItem(lPtr, index);
titem = (TextureListItem*)item->clientData;
if (!titem) {
WMReleaseColor(white);
WMReleaseColor(back);
WMReleaseColor(black);
return;
}
@@ -1314,11 +1314,7 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
x = rect->pos.x;
y = rect->pos.y;
if (state & WLDSSelected)
XFillRectangle(dpy, d, WMColorGC(white), x, y, width, height);
else
XClearArea(dpy, d, x, y, width, height, False);
XFillRectangle(dpy, d, WMColorGC(back), x, y, width, height);
if (titem->preview)
XCopyArea(dpy, titem->preview, d, WMColorGC(black), 0, 0,
@@ -1338,7 +1334,7 @@ paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
strlen(titem->texture));
WMReleaseColor(white);
WMReleaseColor(back);
WMReleaseColor(black);
}

View File

@@ -53,6 +53,7 @@ typedef struct _Panel {
WMColor *white;
WMColor *black;
WMColor *gray;
WMFont *font;
/**/
@@ -433,17 +434,14 @@ paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
_Panel *panel = (_Panel*)WMGetHangedData(lPtr);
WMScreen *scr = WMWidgetScreen(lPtr);
Display *dpy = WMScreenDisplay(scr);
WMColor *backColor = (state & WLDSSelected) ? panel->white : panel->gray;
width = rect->size.width;
height = rect->size.height;
x = rect->pos.x;
y = rect->pos.y;
if (state & WLDSSelected)
XFillRectangle(dpy, d, WMColorGC(panel->white), x, y, width, height);
else
//XClearArea(dpy, d, x, y, width, height, False);
XFillRectangle(dpy, d, WMColorGC(WMGrayColor(scr)), x, y, width, height);
XFillRectangle(dpy, d, WMColorGC(backColor), x, y, width, height);
if (panel->shortcuts[index]) {
WMPixmap *pix = WMGetSystemPixmap(scr, WSICheckMark);
@@ -466,8 +464,11 @@ createPanel(Panel *p)
WMFont *boldFont;
panel->capturing = 0;
panel->white = WMWhiteColor(scr);
panel->black = WMBlackColor(scr);
panel->gray = WMGrayColor(scr);
panel->font = WMSystemFontOfSize(scr, 12);
panel->box = WMCreateBox(panel->parent);
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
@@ -485,9 +486,7 @@ createPanel(Panel *p)
color = WMDarkGrayColor(scr);
WMSetWidgetBackgroundColor(panel->actL, color);
WMReleaseColor(color);
color = WMWhiteColor(scr);
WMSetLabelTextColor(panel->actL, color);
WMReleaseColor(color);
WMSetLabelTextColor(panel->actL, panel->white);
panel->actLs = WMCreateList(panel->box);
WMResizeWidget(panel->actLs, 280, 190);
@@ -632,18 +631,14 @@ InitKeyboardShortcuts(WMScreen *scr, WMWidget *parent)
panel->sectionName = _("Keyboard Shortcut Preferences");
panel->description = _("Change the keyboard shortcuts for actions such\n"
"as changing workspaces and opening menus.");
"as changing workspaces and opening menus.");
panel->parent = parent;
panel->callbacks.createWidgets = createPanel;
panel->callbacks.updateDomain = storeData;
panel->white = WMWhiteColor(scr);
panel->black = WMBlackColor(scr);
panel->font = WMSystemFontOfSize(scr, 12);
AddSection(panel, ICON_FILE);
return panel;
}

View File

@@ -49,6 +49,7 @@ typedef struct _Panel {
WMColor *red;
WMColor *black;
WMColor *white;
WMColor *gray;
WMFont *font;
} _Panel;
@@ -180,24 +181,20 @@ browseForFile(WMWidget *w, void *data)
static void
paintItem(WMList *lPtr, int index, Drawable d, char *text, int state,
WMRect *rect)
paintItem(WMList *lPtr, int index, Drawable d, char *text, int state, WMRect *rect)
{
int width, height, x, y;
_Panel *panel = (_Panel*)WMGetHangedData(lPtr);
WMScreen *scr = WMWidgetScreen(lPtr);
Display *dpy = WMScreenDisplay(scr);
WMColor *backColor = (state & WLDSSelected) ? panel->white : panel->gray;
width = rect->size.width;
height = rect->size.height;
x = rect->pos.x;
y = rect->pos.y;
if (state & WLDSSelected)
XFillRectangle(dpy, d, WMColorGC(panel->white), x, y, width,
height);
else
XClearArea(dpy, d, x, y, width, height, False);
XFillRectangle(dpy, d, WMColorGC(backColor), x, y, width, height);
if (state & 1) {
WMDrawString(scr, d, panel->red, panel->font, x+4, y, text, strlen(text));
@@ -244,6 +241,7 @@ createPanel(Panel *p)
panel->white = WMWhiteColor(scr);
panel->black = WMBlackColor(scr);
panel->gray = WMGrayColor(scr);
panel->red = WMCreateRGBColor(scr, 0xffff, 0, 0, True);
panel->font = WMSystemFontOfSize(scr, 12);

View File

@@ -465,11 +465,12 @@ paintGradListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
{
TexturePanel *panel = (TexturePanel*)WMGetHangedData(lPtr);
WMScreen *scr = WMWidgetScreen(lPtr);
WMColor *white = WMWhiteColor(scr);
WMColor *black = WMBlackColor(scr);
WMColor *gray = WMGrayColor(scr);
WMListItem *item;
int width, height, x, y;
Display *dpy;
WMColor *white = WMWhiteColor(scr);
WMListItem *item;
WMColor *black = WMBlackColor(scr);
dpy = WMScreenDisplay(scr);
@@ -481,7 +482,7 @@ paintGradListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
if (state & WLDSSelected)
XFillRectangle(dpy, d, WMColorGC(white), x, y, width, height);
else
XClearArea(dpy, d, x, y, width, height, False);
XFillRectangle(dpy, d, WMColorGC(gray), x, y, width, height);
item = WMGetListItem(lPtr, index);
@@ -494,6 +495,7 @@ paintGradListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
WMReleaseColor(white);
WMReleaseColor(black);
WMReleaseColor(gray);
}