diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-02-07 22:01:03 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-02-07 22:01:03 +0000 |
commit | 7c62692d430af7313d52257895cfa8298676b6f6 (patch) | |
tree | e29d1348de49aa33b8423ed2290002e39c7a0d1c /src/gui_xmebw.c | |
parent | f97ca8f0665f4604f7778ea709573d920ab83240 (diff) | |
download | vim-git-7c62692d430af7313d52257895cfa8298676b6f6.tar.gz |
updated for version 7.0049
Diffstat (limited to 'src/gui_xmebw.c')
-rw-r--r-- | src/gui_xmebw.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui_xmebw.c b/src/gui_xmebw.c index aa22a88b1..ff7d2e68d 100644 --- a/src/gui_xmebw.c +++ b/src/gui_xmebw.c @@ -292,13 +292,14 @@ set_pixmap(XmEnhancedButtonWidget eb) int x; int y; unsigned int height, width, border, depth; - int status; + int status = 0; Pixmap mask; Pixmap pix = None; Pixmap arm_pix = None; Pixmap ins_pix = None; Pixmap high_pix = None; char **data = (char **) eb->enhancedbutton.pixmap_data; + char *fname = (char *) eb->enhancedbutton.pixmap_file; int shift; GC gc; @@ -313,6 +314,7 @@ set_pixmap(XmEnhancedButtonWidget eb) root = RootWindow(dpy, scr); eb->label.pixmap = None; + eb->enhancedbutton.pixmap_depth = 0; eb->enhancedbutton.pixmap_width = 0; eb->enhancedbutton.pixmap_height = 0; @@ -321,6 +323,14 @@ set_pixmap(XmEnhancedButtonWidget eb) eb->enhancedbutton.highlight_pixmap = None; eb->enhancedbutton.insensitive_pixmap = None; + /* We use dynamic colors, get them now. */ + motif_get_toolbar_colors( + &eb->core.background_pixel, + &eb->primitive.foreground, + &eb->primitive.bottom_shadow_color, + &eb->primitive.top_shadow_color, + &eb->primitive.highlight_color); + /* Setup color subsititution table. */ color[0].pixel = eb->core.background_pixel; color[1].pixel = eb->core.background_pixel; @@ -337,9 +347,12 @@ set_pixmap(XmEnhancedButtonWidget eb) attr.colorsymbols = color; attr.numsymbols = XtNumber(color); - status = XpmCreatePixmapFromData(dpy, root, data, &pix, &mask, &attr); + if (fname) + status = XpmReadFileToPixmap(dpy, root, fname, &pix, &mask, &attr); + if (!fname || status != XpmSuccess) + status = XpmCreatePixmapFromData(dpy, root, data, &pix, &mask, &attr); - /* If somethin failed, we will fill in the default pixmap. */ + /* If something failed, we will fill in the default pixmap. */ if (status != XpmSuccess) status = XpmCreatePixmapFromData(dpy, root, blank_xpm, &pix, &mask, &attr); |