edox: Don't show top bar when showing theme info.
SVN revision: 42803
This commit is contained in:
parent
a1d1cc3e01
commit
3b79831679
102
dox/dox.c
102
dox/dox.c
|
@ -44,13 +44,14 @@
|
||||||
Display *disp;
|
Display *disp;
|
||||||
Root VRoot;
|
Root VRoot;
|
||||||
|
|
||||||
Window win_main, win_title, win_exit, win_next, win_prev, win_text,
|
static Window win_main = None, win_text = None;
|
||||||
win_cover;
|
static Window win_title = None, win_exit = None;
|
||||||
Imlib_Image im_text;
|
static Window win_next = None, win_prev = None;
|
||||||
Imlib_Image im_title;
|
|
||||||
Imlib_Image im_prev1, im_prev2;
|
static Imlib_Image im_title = NULL;
|
||||||
Imlib_Image im_next1, im_next2;
|
static Imlib_Image im_prev1 = NULL, im_prev2 = NULL;
|
||||||
Imlib_Image im_exit1, im_exit2;
|
static Imlib_Image im_next1 = NULL, im_next2 = NULL;
|
||||||
|
static Imlib_Image im_exit1 = NULL, im_exit2 = NULL;
|
||||||
|
|
||||||
static const char doxdir[] = ENLIGHTENMENT_ROOT "/E-docs";
|
static const char doxdir[] = ENLIGHTENMENT_ROOT "/E-docs";
|
||||||
char *docdir = NULL;
|
char *docdir = NULL;
|
||||||
|
@ -58,6 +59,8 @@ char *docdir = NULL;
|
||||||
static Atom ATOM_WM_DELETE_WINDOW = None;
|
static Atom ATOM_WM_DELETE_WINDOW = None;
|
||||||
static Atom ATOM_WM_PROTOCOLS = None;
|
static Atom ATOM_WM_PROTOCOLS = None;
|
||||||
|
|
||||||
|
static char show_top_bar = 1;
|
||||||
|
|
||||||
static Window
|
static Window
|
||||||
FindRootWindow(Display * dpy)
|
FindRootWindow(Display * dpy)
|
||||||
{
|
{
|
||||||
|
@ -322,6 +325,9 @@ main(int argc, char **argv)
|
||||||
docdir = strdup(doxdir);
|
docdir = strdup(doxdir);
|
||||||
s = EMALLOC(char, strlen(docdir) + strlen(docfile) + 2 + 20);
|
s = EMALLOC(char, strlen(docdir) + strlen(docfile) + 2 + 20);
|
||||||
|
|
||||||
|
if (strstr(docdir, "/ABOUT"))
|
||||||
|
show_top_bar = 0;
|
||||||
|
|
||||||
sprintf(s, "%s/%s", docdir, docfile);
|
sprintf(s, "%s/%s", docdir, docfile);
|
||||||
findLocalizedFile(s);
|
findLocalizedFile(s);
|
||||||
|
|
||||||
|
@ -345,22 +351,8 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
VRootInit();
|
VRootInit();
|
||||||
|
|
||||||
im_title = ImageLoadDox("title.png");
|
t = (show_top_bar) ? 16 : 0;
|
||||||
imlib_context_set_image(im_title);
|
|
||||||
ibd.left = 50;
|
|
||||||
ibd.right = 2;
|
|
||||||
ibd.top = 2;
|
|
||||||
ibd.bottom = 2;
|
|
||||||
imlib_image_set_border(&ibd);
|
|
||||||
|
|
||||||
im_prev1 = ImageLoadDox("prev1.png");
|
|
||||||
im_prev2 = ImageLoadDox("prev2.png");
|
|
||||||
im_next1 = ImageLoadDox("next1.png");
|
|
||||||
im_next2 = ImageLoadDox("next2.png");
|
|
||||||
im_exit1 = ImageLoadDox("exit1.png");
|
|
||||||
im_exit2 = ImageLoadDox("exit2.png");
|
|
||||||
|
|
||||||
t = 16;
|
|
||||||
wx = (VRoot.w - w) / 2;
|
wx = (VRoot.w - w) / 2;
|
||||||
wy = (VRoot.h - (h + t)) / 2;
|
wy = (VRoot.h - (h + t)) / 2;
|
||||||
#ifdef USE_XINERAMA
|
#ifdef USE_XINERAMA
|
||||||
|
@ -393,39 +385,57 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
win_main = CreateWindow(VRoot.win, wx, wy, w, h + t);
|
win_main = CreateWindow(VRoot.win, wx, wy, w, h + t);
|
||||||
win_title =
|
|
||||||
XCreateSimpleWindow(disp, win_main, 0, 0, (w - 64 - 64 - t), t, 0, 0, 0);
|
|
||||||
win_prev =
|
|
||||||
XCreateSimpleWindow(disp, win_main, (w - 64 - 64 - t), 0, 64, t, 0, 0, 0);
|
|
||||||
win_next =
|
|
||||||
XCreateSimpleWindow(disp, win_main, (w - 64 - 64 - t) + 64, 0, 64, t, 0,
|
|
||||||
0, 0);
|
|
||||||
win_exit =
|
|
||||||
XCreateSimpleWindow(disp, win_main, (w - 64 - 64 - t) + 64 + 64, 0, t, t,
|
|
||||||
0, 0, 0);
|
|
||||||
win_text = XCreateSimpleWindow(disp, win_main, 0, t, w, h, 0, 0, 0);
|
|
||||||
|
|
||||||
XSelectInput(disp, win_main, KeyPressMask | KeyReleaseMask);
|
XSelectInput(disp, win_main, KeyPressMask | KeyReleaseMask);
|
||||||
XSelectInput(disp, win_prev, ButtonPressMask | ButtonReleaseMask);
|
win_text = XCreateSimpleWindow(disp, win_main, 0, t, w, h, 0, 0, 0);
|
||||||
XSelectInput(disp, win_next, ButtonPressMask | ButtonReleaseMask);
|
|
||||||
XSelectInput(disp, win_exit, ButtonPressMask | ButtonReleaseMask);
|
|
||||||
XSelectInput(disp, win_text, ButtonPressMask | ButtonReleaseMask |
|
XSelectInput(disp, win_text, ButtonPressMask | ButtonReleaseMask |
|
||||||
PointerMotionMask);
|
PointerMotionMask);
|
||||||
|
|
||||||
draw = XCreatePixmap(disp, win_text, w, h, VRoot.depth);
|
draw = XCreatePixmap(disp, win_text, w, h, VRoot.depth);
|
||||||
|
|
||||||
ApplyImage1(win_title, im_title);
|
|
||||||
ApplyImage1(win_prev, im_prev1);
|
|
||||||
ApplyImage1(win_next, im_next1);
|
|
||||||
ApplyImage1(win_exit, im_exit1);
|
|
||||||
|
|
||||||
l = RenderPage(draw, pagenum, w, h);
|
l = RenderPage(draw, pagenum, w, h);
|
||||||
UPDATE_NOW;
|
UPDATE_NOW;
|
||||||
|
|
||||||
XMapWindow(disp, win_title);
|
if (show_top_bar)
|
||||||
XMapWindow(disp, win_prev);
|
{
|
||||||
XMapWindow(disp, win_next);
|
win_title = XCreateSimpleWindow(disp, win_main,
|
||||||
XMapWindow(disp, win_exit);
|
0, 0, (w - 64 - 64 - t), t, 0, 0, 0);
|
||||||
|
win_prev = XCreateSimpleWindow(disp, win_main,
|
||||||
|
(w - 64 - 64 - t), 0, 64, t, 0, 0, 0);
|
||||||
|
win_next = XCreateSimpleWindow(disp, win_main,
|
||||||
|
(w - 64 - 64 - t) + 64, 0, 64, t,
|
||||||
|
0, 0, 0);
|
||||||
|
win_exit = XCreateSimpleWindow(disp, win_main,
|
||||||
|
(w - 64 - 64 - t) + 64 + 64, 0, t, t,
|
||||||
|
0, 0, 0);
|
||||||
|
XSelectInput(disp, win_prev, ButtonPressMask | ButtonReleaseMask);
|
||||||
|
XSelectInput(disp, win_next, ButtonPressMask | ButtonReleaseMask);
|
||||||
|
XSelectInput(disp, win_exit, ButtonPressMask | ButtonReleaseMask);
|
||||||
|
|
||||||
|
im_title = ImageLoadDox("title.png");
|
||||||
|
imlib_context_set_image(im_title);
|
||||||
|
ibd.left = 50;
|
||||||
|
ibd.right = 2;
|
||||||
|
ibd.top = 2;
|
||||||
|
ibd.bottom = 2;
|
||||||
|
imlib_image_set_border(&ibd);
|
||||||
|
|
||||||
|
im_prev1 = ImageLoadDox("prev1.png");
|
||||||
|
im_prev2 = ImageLoadDox("prev2.png");
|
||||||
|
im_next1 = ImageLoadDox("next1.png");
|
||||||
|
im_next2 = ImageLoadDox("next2.png");
|
||||||
|
im_exit1 = ImageLoadDox("exit1.png");
|
||||||
|
im_exit2 = ImageLoadDox("exit2.png");
|
||||||
|
|
||||||
|
ApplyImage1(win_title, im_title);
|
||||||
|
ApplyImage1(win_prev, im_prev1);
|
||||||
|
ApplyImage1(win_next, im_next1);
|
||||||
|
ApplyImage1(win_exit, im_exit1);
|
||||||
|
|
||||||
|
XMapWindow(disp, win_title);
|
||||||
|
XMapWindow(disp, win_prev);
|
||||||
|
XMapWindow(disp, win_next);
|
||||||
|
XMapWindow(disp, win_exit);
|
||||||
|
}
|
||||||
XMapWindow(disp, win_text);
|
XMapWindow(disp, win_text);
|
||||||
XMapWindow(disp, win_main);
|
XMapWindow(disp, win_main);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue