mirror of
https://github.com/mrusme/neonmodem.git
synced 2025-02-02 15:07:59 -05:00
Fixed formatting
This commit is contained in:
parent
fc51e5794c
commit
5acfb29c3a
@ -47,14 +47,20 @@ func (sys *System) Connect(sysURL string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
privateKeyBytes := x509.MarshalPKCS1PrivateKey(privateKey)
|
privateKeyBytes := x509.MarshalPKCS1PrivateKey(privateKey)
|
||||||
privateKeyPEM := string(pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: privateKeyBytes}))
|
privateKeyPEM := string(pem.EncodeToMemory(&pem.Block{
|
||||||
|
Type: "PRIVATE KEY",
|
||||||
|
Bytes: privateKeyBytes,
|
||||||
|
}))
|
||||||
|
|
||||||
// Public key
|
// Public key
|
||||||
publicKeyBytes, err := x509.MarshalPKIXPublicKey(&privateKey.PublicKey)
|
publicKeyBytes, err := x509.MarshalPKIXPublicKey(&privateKey.PublicKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
publicKeyPEM := string(pem.EncodeToMemory(&pem.Block{Type: "PUBLIC KEY", Bytes: publicKeyBytes}))
|
publicKeyPEM := string(pem.EncodeToMemory(&pem.Block{
|
||||||
|
Type: "PUBLIC KEY",
|
||||||
|
Bytes: publicKeyBytes,
|
||||||
|
}))
|
||||||
|
|
||||||
// Client ID
|
// Client ID
|
||||||
uuidV4, err := uuid.NewRandom()
|
uuidV4, err := uuid.NewRandom()
|
||||||
|
@ -31,7 +31,11 @@ func getLines(s string) (lines []string, widest int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PlaceOverlay places fg on top of bg.
|
// PlaceOverlay places fg on top of bg.
|
||||||
func PlaceOverlay(x, y int, fg, bg string, shadow bool, opts ...WhitespaceOption) string {
|
func PlaceOverlay(
|
||||||
|
x, y int,
|
||||||
|
fg, bg string,
|
||||||
|
shadow bool, opts ...WhitespaceOption,
|
||||||
|
) string {
|
||||||
fgLines, fgWidth := getLines(fg)
|
fgLines, fgWidth := getLines(fg)
|
||||||
bgLines, bgWidth := getLines(bg)
|
bgLines, bgWidth := getLines(bg)
|
||||||
bgHeight := len(bgLines)
|
bgHeight := len(bgLines)
|
||||||
|
@ -45,25 +45,41 @@ type Theme struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(cfg *config.Config) (*Theme) {
|
func New(cfg *config.Config) *Theme {
|
||||||
t := new(Theme)
|
t := new(Theme)
|
||||||
|
|
||||||
t.PostsList.List.Focused = t.fromConfig(&cfg.Theme.PostsList.List.Focused)
|
t.PostsList.List.Focused =
|
||||||
t.PostsList.List.Blurred = t.fromConfig(&cfg.Theme.PostsList.List.Blurred)
|
t.fromConfig(&cfg.Theme.PostsList.List.Focused)
|
||||||
t.PostsList.Item.Focused = t.fromConfig(&cfg.Theme.PostsList.Item.Focused)
|
t.PostsList.List.Blurred =
|
||||||
t.PostsList.Item.Blurred = t.fromConfig(&cfg.Theme.PostsList.Item.Blurred)
|
t.fromConfig(&cfg.Theme.PostsList.List.Blurred)
|
||||||
t.PostsList.Item.Selected = t.fromConfig(&cfg.Theme.PostsList.Item.Selected)
|
t.PostsList.Item.Focused =
|
||||||
t.PostsList.ItemDetail.Focused = t.fromConfig(&cfg.Theme.PostsList.ItemDetail.Focused)
|
t.fromConfig(&cfg.Theme.PostsList.Item.Focused)
|
||||||
t.PostsList.ItemDetail.Blurred = t.fromConfig(&cfg.Theme.PostsList.ItemDetail.Blurred)
|
t.PostsList.Item.Blurred =
|
||||||
t.PostsList.ItemDetail.Selected = t.fromConfig(&cfg.Theme.PostsList.ItemDetail.Selected)
|
t.fromConfig(&cfg.Theme.PostsList.Item.Blurred)
|
||||||
t.DialogBox.Window.Focused = t.fromConfig(&cfg.Theme.DialogBox.Window.Focused)
|
t.PostsList.Item.Selected =
|
||||||
t.DialogBox.Window.Blurred = t.fromConfig(&cfg.Theme.DialogBox.Window.Blurred)
|
t.fromConfig(&cfg.Theme.PostsList.Item.Selected)
|
||||||
t.DialogBox.Titlebar.Focused = t.fromConfig(&cfg.Theme.DialogBox.Titlebar.Focused)
|
t.PostsList.ItemDetail.Focused =
|
||||||
t.DialogBox.Titlebar.Blurred = t.fromConfig(&cfg.Theme.DialogBox.Titlebar.Blurred)
|
t.fromConfig(&cfg.Theme.PostsList.ItemDetail.Focused)
|
||||||
t.DialogBox.Bottombar = t.fromConfig(&cfg.Theme.DialogBox.Bottombar)
|
t.PostsList.ItemDetail.Blurred =
|
||||||
t.Post.Author = t.fromConfig(&cfg.Theme.Post.Author)
|
t.fromConfig(&cfg.Theme.PostsList.ItemDetail.Blurred)
|
||||||
t.Post.Subject = t.fromConfig(&cfg.Theme.Post.Subject)
|
t.PostsList.ItemDetail.Selected =
|
||||||
t.Reply.Author = t.fromConfig(&cfg.Theme.Reply.Author)
|
t.fromConfig(&cfg.Theme.PostsList.ItemDetail.Selected)
|
||||||
|
t.DialogBox.Window.Focused =
|
||||||
|
t.fromConfig(&cfg.Theme.DialogBox.Window.Focused)
|
||||||
|
t.DialogBox.Window.Blurred =
|
||||||
|
t.fromConfig(&cfg.Theme.DialogBox.Window.Blurred)
|
||||||
|
t.DialogBox.Titlebar.Focused =
|
||||||
|
t.fromConfig(&cfg.Theme.DialogBox.Titlebar.Focused)
|
||||||
|
t.DialogBox.Titlebar.Blurred =
|
||||||
|
t.fromConfig(&cfg.Theme.DialogBox.Titlebar.Blurred)
|
||||||
|
t.DialogBox.Bottombar =
|
||||||
|
t.fromConfig(&cfg.Theme.DialogBox.Bottombar)
|
||||||
|
t.Post.Author =
|
||||||
|
t.fromConfig(&cfg.Theme.Post.Author)
|
||||||
|
t.Post.Subject =
|
||||||
|
t.fromConfig(&cfg.Theme.Post.Subject)
|
||||||
|
t.Reply.Author =
|
||||||
|
t.fromConfig(&cfg.Theme.Reply.Author)
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,4 +93,3 @@ func (t *Theme) fromConfig(itemCfg *config.ThemeItemConfig) lipgloss.Style {
|
|||||||
Foreground(itemCfg.Foreground).
|
Foreground(itemCfg.Foreground).
|
||||||
Background(itemCfg.Background)
|
Background(itemCfg.Background)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,10 @@ func (m Model) buildView(cached bool) string {
|
|||||||
m.textarea.SetWidth(m.viewcacheTextareaXY[2])
|
m.textarea.SetWidth(m.viewcacheTextareaXY[2])
|
||||||
m.textarea.SetHeight(m.viewcacheTextareaXY[3])
|
m.textarea.SetHeight(m.viewcacheTextareaXY[3])
|
||||||
|
|
||||||
return helpers.PlaceOverlay(m.viewcacheTextareaXY[0], m.viewcacheTextareaXY[1], m.textarea.View(), m.viewcache, false)
|
return helpers.PlaceOverlay(
|
||||||
|
m.viewcacheTextareaXY[0], m.viewcacheTextareaXY[1],
|
||||||
|
m.textarea.View(), m.viewcache,
|
||||||
|
false)
|
||||||
}
|
}
|
||||||
|
|
||||||
m.ctx.Logger.Debugln("View()")
|
m.ctx.Logger.Debugln("View()")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user