Skip to content

Commit

Permalink
add a sweet shadow for the URL open box.
Browse files Browse the repository at this point in the history
also resize index window so the list control will look nicer.
  • Loading branch information
ksherlock committed Jan 16, 2023
1 parent 424c20e commit 58825f6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#define kIndexWindow 0x0100
#define kTextWindow 0x0200
#define kURLWindow 0x0300
#define kURLWindowShadow 0x0301
#define kPrefsWindow 0x0400
#define kNetworkWindow 0x0500
#define kAboutWindow 0x0600
Expand Down
2 changes: 2 additions & 0 deletions gopher.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ void DoOpen(void) {

if (window_count >= 10) return;

GrafPortPtr shadow = NewWindow2(NULL, NULL, WindowDrawControls, NULL, refIsResource, kURLWindowShadow, rWindParam1);
GrafPortPtr win = NewWindow2(NULL, NULL, WindowDrawControls, NULL, refIsResource, kURLWindow, rWindParam1);

ctrlH = GetCtlHandleFromID(win, kGopherURL);
Expand Down Expand Up @@ -480,6 +481,7 @@ void DoOpen(void) {
ProcessQueue();
}
}
CloseWindow(shadow);
CloseWindow(win); // or just hide so url is retained?
InitCursor(); /* reset possible I-beam cursor */
}
Expand Down
37 changes: 31 additions & 6 deletions gopher.rez
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,11 @@ resource rPString (kAddBookmarkItem, nocrossbank){"Add Bookmark..."};
gopher window
*/

#define WindowWidth 560
#define WindowHeight 150

// currently, for the list manager, height must be 10 * x

#define IndexWindowWidth (632-8)
#define IndexWindowHeight (189-29)

resource rWindParam1 (kIndexWindow) {
// visibility toggled after
Expand All @@ -366,7 +369,8 @@ resource rWindParam1 (kIndexWindow) {
{0, 0},
0,
0,
{40, 40, 190, 600}, /* wPosition */
// {40, 40, 190, 600}, /* wPosition */
{29, 8, 189, 632}, /* wPosition */
infront,
kGopherIndex, /* rControlList */
(refIsResource << 10) + /* color table */
Expand All @@ -375,6 +379,9 @@ resource rWindParam1 (kIndexWindow) {
};



#define TextWindowWidth (632-8)
#define TextWindowHeight (196-29)
resource rWindParam1 (kTextWindow) {
fTitle + fMove + fClose + fVis,
kTextWindow, /* title id */
Expand All @@ -388,7 +395,7 @@ resource rWindParam1 (kTextWindow) {
{0, 0},
0,
0, /* info height */
{40, 40, 190, 600}, /* wPosition */
{29, 8, 196, 632}, /* wPosition */
infront,
kGopherText, /* rControlList */
(refIsResource << 10) + /* color table */
Expand Down Expand Up @@ -418,6 +425,24 @@ resource rWindParam1 (kURLWindow) {
singleResource /* control descriptor */
};

resource rWindParam1 (kURLWindowShadow) {
fVis + fFlex,
0, /* title id */
0x0,
{0, 0, 0, 0},
0, /* color table */
{0, 0},
{0, 0},
{0, 0},
{0, 0},
{0, 0},
0,
0,
{50+1, 40+2, 70+1, 600+2}, /* wPosition */
infront,
0, /* rControlList */
0
};

resource rPString (kIndexWindow, nocrossbank){" Gopher "};
resource rPString (kTextWindow, nocrossbank){" Gopher "};
Expand Down Expand Up @@ -481,7 +506,7 @@ resource rControlTemplate (kGopherURL) {

resource rControlTemplate (kGopherIndex) {
kGopherIndex,
{-1, -2, WindowHeight - 1, WindowWidth-22 },
{-1, -2, IndexWindowHeight - 1, IndexWindowWidth-22 },
ListControl {
{ /* optional Fields */
testMemNever, /* flags */
Expand All @@ -502,7 +527,7 @@ resource rControlTemplate (kGopherIndex) {

resource rControlTemplate (kGopherText) {
kGopherText,
{-1, -2, 190, 601 },
{-1, -2, TextWindowHeight - 1, TextWindowWidth+1 },
editTextControl {
{ /* optional Fields */
0x0, /* flags */
Expand Down

0 comments on commit 58825f6

Please sign in to comment.