From da30b74a436244f98b75b339f4b8910117537e47 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 23 Aug 1999 23:18:33 +0000 Subject: [PATCH] Mon Aug 23 16:17:33 PDT 1999 (Raster) menus stay onscreen with menusonscreen on top and left sides now. :) also side ways starup screen patch in :) SVN revision: 82 --- src/ChangeLog | 8 ++++++ src/TODO | 1 + src/menus.c | 6 +++- src/startup.c | 79 +++++++++++++++++++++++++++++++++++---------------- 4 files changed, 68 insertions(+), 26 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 784f0792..edf70c7a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1031,3 +1031,11 @@ Mon Aug 23 14:06:19 PDT 1999 fixed group remembering, some other group stuff, iconfication stuff, alertbox stuff - god - almost everything got a fix somewhere... :) + +------------------------------------------------------------------------------- + +Mon Aug 23 16:17:33 PDT 1999 +(Raster) + +menus stay onscreen with menusonscreen on top and left sides now. :) also side +ways starup screen patch in :) diff --git a/src/TODO b/src/TODO index 38f2ba90..ad153c62 100644 --- a/src/TODO +++ b/src/TODO @@ -6,6 +6,7 @@ user: finer grained control on selecting icon display policy kainx: translucent and group window moves if move != opaque - fix :) kainx: new tooltip stuff doesnt saccoutn for 2x extra in calculating iconbox kainx: reduce need for tooltip text to have auto gened tooltips work +raster: group properties are not remembered :( raster: tooltips fro pager names and iconbox names runs off right edge raster: add dnd to iconbox raster: icoify animation suport diff --git a/src/menus.c b/src/menus.c index cedefdb6..fb65a0af 100644 --- a/src/menus.c +++ b/src/menus.c @@ -310,11 +310,15 @@ ShowMenu(Menu * m, char noshow) wx = root.w - (int)mw - ((int)mw - (int)w); else wx = mode.x - x - ((int)w / 2); - + if ((wx - ((int)w / 2)) < 0) + wx = 0; + if (mode.y + (int)mh > (int)root.h) wy = (int)root.h - (int)mh; else wy = mode.y - y - ((int)h / 2); + if ((wy - ((int)h / 2)) < 0) + wy = 0; } if ((mode.x >= 0) && (mode.y >= 0)) diff --git a/src/startup.c b/src/startup.c index bb3ba9ab..9c089d67 100644 --- a/src/startup.c +++ b/src/startup.c @@ -139,6 +139,7 @@ CreateStartupDisplay(char start) { static Window w1, w2, win1, win2, b1, b2; static Background *bg = NULL; + static Background *bg_sideways = NULL; /* currently used to determine if the startup screen should slide sideways */ static ImageClass *ic = NULL; char pq; @@ -147,6 +148,8 @@ CreateStartupDisplay(char start) EDBUG_RETURN_; if (start) { + bg_sideways = (Background *) FindItem("STARTUP_BACKGROUND_SIDEWAYS", 0, LIST_FINDBY_NAME, + LIST_TYPE_BACKGROUND); ic = (ImageClass *) FindItem("DESKTOP_DRAGBUTTON_HORIZ", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); bg = (Background *) FindItem("STARTUP_BACKGROUND", 0, LIST_FINDBY_NAME, @@ -154,10 +157,21 @@ CreateStartupDisplay(char start) if ((!ic) || (!bg)) EDBUG_RETURN_; - w1 = ECreateWindow(root.win, 0, -(root.h / 2), root.w, root.h, 1); - w2 = ECreateWindow(root.win, 0, (root.h / 2), root.w, root.h, 1); - win1 = ECreateWindow(w1, 0, (root.h / 2), root.w, root.h, 0); - win2 = ECreateWindow(w2, 0, -(root.h / 2), root.w, root.h, 0); + if (bg_sideways) + { + w1 = ECreateWindow(root.win, (root.w / 2), 0, root.w, root.h, 1); + w2 = ECreateWindow(root.win, -(root.w / 2), 0, root.w, root.h, 1); + win1 = ECreateWindow(w1, -(root.w / 2), 0, root.w, root.h, 0); + win2 = ECreateWindow(w2, (root.w / 2), 0, root.w, root.h, 0); + } + else + { + w1 = ECreateWindow(root.win, 0, -(root.h / 2), root.w, root.h, 1); + w2 = ECreateWindow(root.win, 0, (root.h / 2), root.w, root.h, 1); + win1 = ECreateWindow(w1, 0, (root.h / 2), root.w, root.h, 0); + win2 = ECreateWindow(w2, 0, -(root.h / 2), root.w, root.h, 0); + } + EMapWindow(disp, win1); EMapWindow(disp, win2); @@ -184,7 +198,8 @@ CreateStartupDisplay(char start) } else { - int k, spd, y, ty, fy, min, speed; + int k, spd, x, y, xOffset, yOffset, tx, ty, fy, min, speed; + /* we have this many so that we save on lines o code - eAndroid */ struct timeval timev1, timev2; int dsec, dusec; double tm; @@ -196,27 +211,41 @@ CreateStartupDisplay(char start) spd = 16; min = 2; fy = 0; - ty = (root.h / 2); + for (k = 0; k <= 1024; k += spd) - { - gettimeofday(&timev1, NULL); - y = ((fy * (1024 - k)) + (ty * k)) >> 10; - EMoveWindow(disp, w1, 0, -(root.h / 2) - y); - EMoveWindow(disp, w2, 0, (root.h / 2) + y); - XSync(disp, False); - gettimeofday(&timev2, NULL); - dsec = timev2.tv_sec - timev1.tv_sec; - dusec = timev2.tv_usec - timev1.tv_usec; - if (dusec < 0) - { - dsec--; - dusec += 1000000; - } - tm = (double)dsec + (((double)dusec) / 1000000); - spd = (int)((double)speed * tm); - if (spd < min) - spd = min; - } + { + if (bg_sideways) /* so we can have two different slide methods */ + { + ty = (root.w / 2); + xOffset = ((fy * (1024 - k)) + (ty * k)) >> 10; + x = ty; + yOffset = 0; + y = 0; + } else { + ty = (root.h / 2); + xOffset = 0; + x = 0; + yOffset = ((fy * (1024 - k)) + (ty * k)) >> 10; + y = ty; + } + gettimeofday(&timev1, NULL); + EMoveWindow(disp, w1, x + xOffset, -y - yOffset); + EMoveWindow(disp, w2, -x - xOffset, y + yOffset); + XSync(disp, False); + gettimeofday(&timev2, NULL); + dsec = timev2.tv_sec - timev1.tv_sec; + dusec = timev2.tv_usec - timev1.tv_usec; + if (dusec < 0) + { + dsec--; + dusec += 1000000; + } + tm = (double)dsec + (((double)dusec) / 1000000); + spd = (int)((double)speed * tm); + if (spd < min) + spd = min; + } + EDestroyWindow(disp, w1); EDestroyWindow(disp, w2); init_win1 = 0;