mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-12 07:44:03 +09:00
zfm: the 'm' menu wip
This commit is contained in:
@@ -288,7 +288,25 @@ let opPanelDraw = (wo) => {
|
|||||||
|
|
||||||
|
|
||||||
let paletteDraw = (wo) => {
|
let paletteDraw = (wo) => {
|
||||||
|
function hr(y) {
|
||||||
|
con.move(y, xp)
|
||||||
|
print(`\x84196u`.repeat(POPUP_WIDTH - 2))
|
||||||
|
}
|
||||||
|
|
||||||
|
con.color_pair(COL_TEXT, COL_BACK)
|
||||||
|
|
||||||
|
let xp = wo.x + 1
|
||||||
|
let yp = wo.y + 1
|
||||||
|
|
||||||
|
// erase first
|
||||||
|
for (let y = 0; y <= POPUP_HEIGHT-2; y++) {
|
||||||
|
con.move(yp + y, xp)
|
||||||
|
print(" ".repeat(POPUP_WIDTH-2))
|
||||||
|
}
|
||||||
|
|
||||||
|
// finally draw something
|
||||||
|
con.move(yp, xp)
|
||||||
|
print("More commands (hit m to return):")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -418,6 +436,8 @@ const LEFTPANEL = windows[0][0]
|
|||||||
const OPPANEL = windows[0][1]
|
const OPPANEL = windows[0][1]
|
||||||
const RIGHTPANEL = windows[0][2]
|
const RIGHTPANEL = windows[0][2]
|
||||||
|
|
||||||
|
let currentPopup = 0
|
||||||
|
|
||||||
function drawTitle() {
|
function drawTitle() {
|
||||||
// draw window title
|
// draw window title
|
||||||
con.color_pair(COL_BACK, COL_TEXT)
|
con.color_pair(COL_BACK, COL_TEXT)
|
||||||
@@ -457,12 +477,20 @@ function drawOpPanel() {
|
|||||||
OPPANEL.drawFrame()
|
OPPANEL.drawFrame()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function drawPopupPanel() {
|
||||||
|
if (currentPopup) {
|
||||||
|
windows[currentPopup][0].drawContents()
|
||||||
|
windows[currentPopup][0].drawFrame()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function redraw() {
|
function redraw() {
|
||||||
clearScr()
|
clearScr()
|
||||||
drawTitle()
|
drawTitle()
|
||||||
drawFilePanel()
|
drawFilePanel()
|
||||||
drawOpPanel()
|
drawOpPanel()
|
||||||
|
drawPopupPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearScr() {
|
function clearScr() {
|
||||||
@@ -495,9 +523,15 @@ while (!exit) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if (keyJustHit && keysym == 'z') {
|
if (keyJustHit) {
|
||||||
windowMode = 1 - windowMode
|
if (keysym == 'z') {
|
||||||
redraw()
|
windowMode = 1 - windowMode
|
||||||
|
redraw()
|
||||||
|
}
|
||||||
|
else if (keysym == 'm') {
|
||||||
|
currentPopup = 1 - currentPopup
|
||||||
|
redraw()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
windows[windowFocus].forEach(it => {
|
windows[windowFocus].forEach(it => {
|
||||||
|
|||||||
Reference in New Issue
Block a user