diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-23 00:30:12 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-23 00:30:12 +0000 |
| commit | 6e425a9de8c003b5a733621a6b6730ec3cc902b8 (patch) | |
| tree | 314123bcab78ff295f38f85f31dc141e5fe22d15 /appl/wm/sh.b | |
| parent | 74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a (diff) | |
20061220
Diffstat (limited to 'appl/wm/sh.b')
| -rw-r--r-- | appl/wm/sh.b | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/appl/wm/sh.b b/appl/wm/sh.b index 159ce6bc..8f634329 100644 --- a/appl/wm/sh.b +++ b/appl/wm/sh.b @@ -92,6 +92,7 @@ shwin_cfg := array[] of { rdreq: list of Rdreq; menuindex := "0"; holding := 0; +haskbdfocus := 0; plumbed := 0; rawon := 0; rawinput := ""; @@ -260,16 +261,22 @@ main(ctxt: ref Draw->Context, argv: list of string) c := <-wm.ctl or c = <-t.wreq or c = <-titlectl => + (nil, flds) := sys->tokenize(c, " \t"); + if(flds != nil && hd flds == "haskbdfocus" && tl flds != nil){ + haskbdfocus = int hd tl flds; + setcols(t); + } tkclient->wmctl(t, c); ecmd := <-edit => editor(t, ecmd); sendinput(t); c := <-keys => - cut(t, 1); char := c[1]; if(char == '\\') char = c[2]; + if(char != ESC) + cut(t, 1); if(rawon){ if(int cmd(t, ".ft.t compare insert >= outpoint")){ rawinput[len rawinput] = char; @@ -488,14 +495,30 @@ setholding(t: ref Tk->Toplevel, hold: int) if(hold == holding) return; holding = hold; - color := "blue"; if(!holding){ - color = "black"; tkclient->settitle(t, winname); sendinput(t); }else tkclient->settitle(t, winname+" (holding)"); - cmd(t, ".ft.t configure -foreground "+color); + setcols(t); +} + +setcols(t: ref Tk->Toplevel) +{ + fgcol := "black"; + if(holding){ + if(haskbdfocus) + fgcol = "#000099FF"; # DMedblue + else + fgcol = "#005DBBFF"; # DGreyblue + }else{ + if(haskbdfocus) + fgcol = "black"; + else + fgcol = "#666666FF"; # dark grey + } + cmd(t, ".ft.t configure -foreground "+fgcol+" -selectforeground "+fgcol); + cmd(t, ".ft.t tag configure sel -foreground "+fgcol); } tkunquote(s: string): string |
