From 666f3b596d7bcd29ee9043b39f25ffb3568296a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Mon, 2 Jan 2023 15:33:12 -0500 Subject: [PATCH] Renamed windows/dialogs --- ui/ui.go | 4 ++-- ui/views/posts/posts.go | 4 ++-- .../postcreatedialog.go => postcreate/postcreate.go} | 6 +++++- .../{postdialog/postdialog.go => postshow/postshow.go} | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) rename ui/windows/{postcreatedialog/postcreatedialog.go => postcreate/postcreate.go} (99%) rename ui/windows/{postdialog/postdialog.go => postshow/postshow.go} (99%) diff --git a/ui/ui.go b/ui/ui.go index bf688e9..3029527 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -10,7 +10,7 @@ import ( "github.com/mrusme/gobbs/ui/header" "github.com/mrusme/gobbs/ui/views/posts" "github.com/mrusme/gobbs/ui/windowmanager" - "github.com/mrusme/gobbs/ui/windows/postdialog" + "github.com/mrusme/gobbs/ui/windows/postshow" "github.com/mrusme/gobbs/ui/views" @@ -108,7 +108,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.ctx.Logger.Debugln("received WinOpen") ccmds = m.wm.Open( msg.Target, - postdialog.NewModel(m.ctx), + postshow.NewModel(m.ctx), [4]int{3, 2, 10, 6}, &msg, ) diff --git a/ui/views/posts/posts.go b/ui/views/posts/posts.go index f6ffe1c..e54207a 100644 --- a/ui/views/posts/posts.go +++ b/ui/views/posts/posts.go @@ -15,7 +15,7 @@ import ( "github.com/mrusme/gobbs/models/reply" "github.com/mrusme/gobbs/ui/cmd" "github.com/mrusme/gobbs/ui/ctx" - "github.com/mrusme/gobbs/ui/windows/postdialog" + "github.com/mrusme/gobbs/ui/windows/postshow" ) var ( @@ -148,7 +148,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if ok { // m.ctx.Loading = true // cmds = append(cmds, m.loadItem(&i)) - cmd := cmd.New(cmd.WinOpen, postdialog.WIN_ID, cmd.Arg{ + cmd := cmd.New(cmd.WinOpen, postshow.WIN_ID, cmd.Arg{ Name: "post", Value: &i, }) diff --git a/ui/windows/postcreatedialog/postcreatedialog.go b/ui/windows/postcreate/postcreate.go similarity index 99% rename from ui/windows/postcreatedialog/postcreatedialog.go rename to ui/windows/postcreate/postcreate.go index 806f175..8b18b98 100644 --- a/ui/windows/postcreatedialog/postcreatedialog.go +++ b/ui/windows/postcreate/postcreate.go @@ -1,4 +1,4 @@ -package postcreatedialog +package postcreate import ( "fmt" @@ -19,6 +19,10 @@ import ( "github.com/mrusme/gobbs/ui/helpers" ) +var ( + WIN_ID = "postcreate" +) + type KeyMap struct { Refresh key.Binding Select key.Binding diff --git a/ui/windows/postdialog/postdialog.go b/ui/windows/postshow/postshow.go similarity index 99% rename from ui/windows/postdialog/postdialog.go rename to ui/windows/postshow/postshow.go index b4cc47b..b3c204c 100644 --- a/ui/windows/postdialog/postdialog.go +++ b/ui/windows/postshow/postshow.go @@ -1,4 +1,4 @@ -package postdialog +package postshow import ( "fmt" @@ -19,7 +19,7 @@ import ( ) var ( - WIN_ID = "postShow" + WIN_ID = "postshow" viewportStyle = lipgloss.NewStyle(). Margin(0, 0, 0, 0).