瀏覽代碼

Made a number of style changes

arianagiroux 1 周之前
父節點
當前提交
9dfae44517
共有 1 個文件被更改,包括 21 次插入14 次删除
  1. 21 14
      tui.go

+ 21 - 14
tui.go

@@ -32,16 +32,17 @@ var (
 			Faint(true).
 			Italic(true)
 
-	variadicTitleStyle = lipgloss.NewStyle().
-				Width(80).
-				Align(lipgloss.Left).
-				Italic(true)
+	variadicMarginStyle = lipgloss.NewStyle().
+				Padding(0, 1)
 
 	variadicDataStyle = lipgloss.NewStyle().
-				Width(40).
+				Padding(0, 1).
+				BorderForeground(lipgloss.Color("8")).
+				Italic(true).
 				BorderStyle(lipgloss.ASCIIBorder())
 
 	borderStyle = lipgloss.NewStyle().
+			BorderForeground(lipgloss.Color("8")).
 			Width(80).
 			Padding(1, 2).
 			Margin(1).
@@ -586,6 +587,7 @@ func (e edit) render() tea.Msg {
 	}
 
 	borderStyle := lipgloss.NewStyle().
+		BorderForeground(lipgloss.Color("8")).
 		BorderStyle(lipgloss.NormalBorder()).
 		Margin(1).
 		Padding(0, 1)
@@ -662,7 +664,7 @@ func (i Issue) render() tea.Msg {
 	output = output + titleStyle.Render(i.Title)
 
 	// status
-	output = output + fmt.Sprintf("\n%s", detailStyle.Render(i.Status.Data))
+	output = output + fmt.Sprintf("\n%s\n", detailStyle.Render(i.Status.Data))
 
 	// variadics
 	var tags string
@@ -677,21 +679,26 @@ func (i Issue) render() tea.Msg {
 	}
 	blockedby = strings.TrimRight(blockedby, ", ")
 
+	var tagsString string // placeholder for variadic styling
 	if len(i.Tags.Fields) > 0 {
-		output = output + variadicTitleStyle.Render("\n\nTags:")
-		output = output + fmt.Sprintf("\n%s", variadicDataStyle.Render(tags))
+		tagsString = tagsString + "\nTags:\n"
+		tagsString = tagsString + variadicDataStyle.Render(tags)
+		tagsString = variadicMarginStyle.Render(tagsString)
 	}
-
+	output = output + tagsString
+	var blockersString string // placeholder for variadic styling
 	if len(i.Blockedby.Fields) > 0 {
-		output = output + variadicTitleStyle.Render("\n\nBlockedby:")
-		output = output + fmt.Sprintf("\n%s", variadicDataStyle.Render(blockedby))
+		blockersString = blockersString + "\nBlockedby:\n"
+		blockersString = blockersString + variadicDataStyle.Render(fmt.Sprintf("%s", blockedby))
+		blockersString = variadicMarginStyle.Render(blockersString)
 	}
+	output = output + blockersString
 
 	// description
 	output = output + titleStyle.Render("\n\nDescription:\n")
 	output = output + fmt.Sprintf("\n%s", i.Description.Data)
 
-	return borderStyle.Render(output)
+	return lipgloss.Wrap(output, 80, "\n")
 }
 
 // keyhelp cmd for Issue widget
@@ -702,7 +709,7 @@ func (i Issue) keyhelp() string {
 	if IsIssueCollection(remainder) {
 		escStr = "\t\tesc: back"
 	}
-	output = output + fmt.Sprintf("e: edit issue%s\t\tctrl+c: quit", escStr)
+	output = output + fmt.Sprintf("e: edit%s\t\tctrl+c: quit", escStr)
 	return output
 }
 
@@ -784,7 +791,7 @@ func (ic IssueCollection) render() tea.Msg {
 // keyhelp cmd for IssueCollection widget
 func (ic IssueCollection) keyhelp() string {
 	var output string
-	output = output + "tab/shift+tab: select\t\tenter: view issue\nc: create new issue\t\td: delete selected issue\ne: edit selected issue"
+	output = output + "tab/shift+tab: select\t\tenter: view\nc: create\t\td: delete\ne: edit"
 	return output
 }