this is done
This commit is contained in:
parent
161136cd57
commit
580bdaa245
37
main.c
37
main.c
|
@ -63,8 +63,8 @@ struct Screen *screen;
|
||||||
struct Window *window;
|
struct Window *window;
|
||||||
struct Gadget *windowGadgets;
|
struct Gadget *windowGadgets;
|
||||||
|
|
||||||
#define ABOUT_WINDOW_WIDTH (240)
|
#define ABOUT_WINDOW_WIDTH (350)
|
||||||
#define ABOUT_WINDOW_HEIGHT (50)
|
#define ABOUT_WINDOW_HEIGHT (75)
|
||||||
|
|
||||||
struct NewWindow aboutWindowLayout = {
|
struct NewWindow aboutWindowLayout = {
|
||||||
40, 40,
|
40, 40,
|
||||||
|
@ -247,8 +247,8 @@ struct Gadget *buildUI(void) {
|
||||||
// http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_3._guide/node0274.html
|
// http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_3._guide/node0274.html
|
||||||
currentGadget = CreateContext(&glist);
|
currentGadget = CreateContext(&glist);
|
||||||
|
|
||||||
ng.ng_LeftEdge = WINDOW_CHROME_WIDTH;
|
ng.ng_LeftEdge = window->BorderLeft;
|
||||||
ng.ng_TopEdge = 11;
|
ng.ng_TopEdge = window->BorderTop;
|
||||||
ng.ng_Height = 12;
|
ng.ng_Height = 12;
|
||||||
ng.ng_Width = 0;
|
ng.ng_Width = 0;
|
||||||
ng.ng_GadgetText = NULL;
|
ng.ng_GadgetText = NULL;
|
||||||
|
@ -259,7 +259,7 @@ struct Gadget *buildUI(void) {
|
||||||
ng.ng_Flags = PLACETEXT_IN;
|
ng.ng_Flags = PLACETEXT_IN;
|
||||||
|
|
||||||
// Timer display
|
// Timer display
|
||||||
ng.ng_Width = WINDOW_WIDTH - WINDOW_CHROME_WIDTH * 2;
|
ng.ng_Width = window->Width - window->BorderLeft - window->BorderRight;
|
||||||
ng.ng_TextAttr = &Topaz160;
|
ng.ng_TextAttr = &Topaz160;
|
||||||
ng.ng_Height = 20;
|
ng.ng_Height = 20;
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ struct Gadget *buildUI(void) {
|
||||||
ng.ng_Height = 12;
|
ng.ng_Height = 12;
|
||||||
|
|
||||||
// start/stop button
|
// start/stop button
|
||||||
ng.ng_Width = (WINDOW_WIDTH - WINDOW_CHROME_WIDTH * 2) / 2;
|
ng.ng_Width = (window->Width - window->BorderLeft - window->BorderRight) / 2;
|
||||||
ng.ng_TopEdge += 18;
|
ng.ng_TopEdge += 18;
|
||||||
if (timerIsRunning) {
|
if (timerIsRunning) {
|
||||||
ng.ng_GadgetText = "_Stop";
|
ng.ng_GadgetText = "_Stop";
|
||||||
|
@ -295,7 +295,7 @@ struct Gadget *buildUI(void) {
|
||||||
);
|
);
|
||||||
|
|
||||||
// reset button
|
// reset button
|
||||||
ng.ng_LeftEdge += (WINDOW_WIDTH - WINDOW_CHROME_WIDTH * 2) / 2;
|
ng.ng_LeftEdge += ng.ng_Width; // lol reuse it
|
||||||
ng.ng_GadgetText = "_Reset";
|
ng.ng_GadgetText = "_Reset";
|
||||||
ng.ng_GadgetID = RESET_BUTTON_ID;
|
ng.ng_GadgetID = RESET_BUTTON_ID;
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ struct Gadget *buildUI(void) {
|
||||||
|
|
||||||
// hours slider
|
// hours slider
|
||||||
ng.ng_LeftEdge = 85;
|
ng.ng_LeftEdge = 85;
|
||||||
ng.ng_Width = (WINDOW_WIDTH - WINDOW_CHROME_WIDTH * 2) - 85 + 4;
|
ng.ng_Width = window->Width - window->BorderLeft - window->BorderRight - ng.ng_LeftEdge + 4;
|
||||||
ng.ng_TopEdge += 12;
|
ng.ng_TopEdge += 12;
|
||||||
// The level is also displayed to the left of the slider by default.
|
// The level is also displayed to the left of the slider by default.
|
||||||
// We need to leave space for its rendering, which is done separately
|
// We need to leave space for its rendering, which is done separately
|
||||||
|
@ -580,6 +580,26 @@ int openAboutWindow(void) {
|
||||||
TAG_DONE
|
TAG_DONE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ng.ng_TopEdge += 15;
|
||||||
|
currentGadget = CreateGadget(
|
||||||
|
TEXT_KIND,
|
||||||
|
currentGadget,
|
||||||
|
&ng,
|
||||||
|
GTTX_Text, "Sound: Reception bell by cdrk (CC-BY 4.0)",
|
||||||
|
GTTX_CopyText, TRUE,
|
||||||
|
TAG_DONE
|
||||||
|
);
|
||||||
|
|
||||||
|
ng.ng_TopEdge += 10;
|
||||||
|
currentGadget = CreateGadget(
|
||||||
|
TEXT_KIND,
|
||||||
|
currentGadget,
|
||||||
|
&ng,
|
||||||
|
GTTX_Text, "freesound.org/people/cdrk/sounds/264594/",
|
||||||
|
GTTX_CopyText, TRUE,
|
||||||
|
TAG_DONE
|
||||||
|
);
|
||||||
|
|
||||||
AddGList(aboutWindow, glist, -1, -1, NULL);
|
AddGList(aboutWindow, glist, -1, -1, NULL);
|
||||||
RefreshGList(glist, aboutWindow, NULL, -1);
|
RefreshGList(glist, aboutWindow, NULL, -1);
|
||||||
GT_RefreshWindow(aboutWindow, NULL);
|
GT_RefreshWindow(aboutWindow, NULL);
|
||||||
|
@ -855,6 +875,7 @@ int main() {
|
||||||
handleTimerMessage();
|
handleTimerMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// open up the about menu outside of event handling
|
||||||
if (openAboutWindowNext) {
|
if (openAboutWindowNext) {
|
||||||
if (openAboutWindow()) terminated = TRUE;
|
if (openAboutWindow()) terminated = TRUE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue