Resync changes from github repo
This commit is contained in:
parent
e9905c02f6
commit
232e7e726b
@ -1,4 +1,10 @@
|
||||
boltbrowser
|
||||
===========
|
||||
|
||||
A CLI Browser for BoltDB Files
|
||||
A CLI Browser for BoltDB Files
|
||||
|
||||
![Image of About Screen]
|
||||
(http://bullercodeworks.com/boltbrowser/ss2.png)
|
||||
|
||||
![Image of Main Browser]
|
||||
(http://bullercodeworks.com/boltbrowser/ss1.png)
|
||||
|
@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/br0xen/bolt"
|
||||
"github.com/boltdb/bolt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/br0xen/bolt"
|
||||
"github.com/boltdb/bolt"
|
||||
"github.com/nsf/termbox-go"
|
||||
"os"
|
||||
"syscall"
|
||||
|
@ -16,9 +16,8 @@ const (
|
||||
|
||||
func defaultScreensForData(db *BoltDB) []Screen {
|
||||
var view_port ViewPort
|
||||
var cursor Cursor
|
||||
|
||||
browser_screen := BrowserScreen{db: db, cursor: cursor, view_port: view_port}
|
||||
browser_screen := BrowserScreen{db: db, view_port: view_port}
|
||||
about_screen := AboutScreen(0)
|
||||
screens := [...]Screen{
|
||||
&browser_screen,
|
||||
|
@ -44,8 +44,20 @@ func (screen *AboutScreen) drawScreen(style Style) {
|
||||
"| |_| || || || | | |_| || | | || || _ | _____| || |___ | | | |",
|
||||
"|_______||_______||_______||___| |_______||___| |_||_______||__| |__||_______||_______||___| |_|",
|
||||
}
|
||||
if width < 100 {
|
||||
template = [...]string{
|
||||
" ____ ____ _ _____ ____ ____ ____ _ _ ____ ___ ____ ",
|
||||
"| _ || || | | || _ || _ | | || | _ | || || || _ | ",
|
||||
"| |_||| _ || | |_ _|| |_||| | || | _ || || || || ___|| _|| | || ",
|
||||
"| ||| | || | | | | || |_|| || | || |||___ | |_ | |_||_ ",
|
||||
"| _ |||_| || |___| | | _ || _ |||_| || ||__ || _|| __ |",
|
||||
"| |_||| || | | | |_||| | | || || _ | __| || |_ | | | |",
|
||||
"|____||____||_____|_| |____||_| |_||____||__| |__||____||___||_| |_|",
|
||||
}
|
||||
}
|
||||
first_line := template[0]
|
||||
start_x := (width - len(first_line)) / 2
|
||||
//start_x := (width - len(first_line)) / 2
|
||||
start_y := ((height - 2*len(template)) / 2) - 2
|
||||
x_pos := start_x
|
||||
y_pos := start_y
|
||||
@ -97,7 +109,7 @@ func (screen *AboutScreen) drawScreen(style Style) {
|
||||
{"?", "this screen"},
|
||||
{"q", "quit program"},
|
||||
}
|
||||
x_pos = start_x + 20
|
||||
x_pos = start_x // + 20
|
||||
y_pos++
|
||||
|
||||
drawCommandsAtPoint(commands1[:], x_pos, y_pos+1, style)
|
||||
|
@ -2,8 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/br0xen/termbox-util"
|
||||
"github.com/nsf/termbox-go"
|
||||
"gogs.bullercodeworks.com/brian/termbox-util"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@ -16,7 +16,6 @@ type ViewPort struct {
|
||||
|
||||
type BrowserScreen struct {
|
||||
db *BoltDB
|
||||
cursor Cursor
|
||||
view_port ViewPort
|
||||
queued_command string
|
||||
current_path []string
|
||||
|
Loading…
Reference in New Issue
Block a user