Merge branch 'v0.3.1'
* v0.3.1: Fix vertical resizing Fix GetText to return actual text not representation Update version number Clear notification when sending message on channel Reset offset when sending message
This commit is contained in:
commit
0e7dac5ffe
@ -194,11 +194,12 @@ func (i *Input) Clear() {
|
||||
i.Par.Text = ""
|
||||
i.CursorPositionScreen = 0
|
||||
i.CursorPositionText = 0
|
||||
i.Offset = 0
|
||||
}
|
||||
|
||||
// GetText returns the text currently in the input
|
||||
func (i *Input) GetText() string {
|
||||
return i.Par.Text
|
||||
return string(i.Text)
|
||||
}
|
||||
|
||||
// GetMaxWidth returns the maximum number of positions
|
||||
|
@ -163,6 +163,12 @@ func actionKeyEvent(ctx *context.AppContext, ev termbox.Event) {
|
||||
|
||||
func actionResizeEvent(ctx *context.AppContext, ev termbox.Event) {
|
||||
termui.Body.Width = termui.TermWidth()
|
||||
|
||||
// Vertical resize components
|
||||
ctx.View.Channels.List.Height = termui.TermHeight() - ctx.View.Input.Par.Height
|
||||
ctx.View.Chat.List.Height = termui.TermHeight() - ctx.View.Input.Par.Height
|
||||
ctx.View.Debug.List.Height = termui.TermHeight() - ctx.View.Input.Par.Height
|
||||
|
||||
termui.Body.Align()
|
||||
termui.Render(termui.Body)
|
||||
}
|
||||
@ -214,10 +220,16 @@ func actionSend(ctx *context.AppContext) {
|
||||
ctx.View.Input.Clear()
|
||||
ctx.View.Refresh()
|
||||
|
||||
// Send message
|
||||
ctx.Service.SendMessage(
|
||||
ctx.View.Channels.SelectedChannel,
|
||||
message,
|
||||
)
|
||||
|
||||
// Clear notification icon if there is any
|
||||
ctx.Service.MarkAsRead(ctx.View.Channels.SelectedChannel)
|
||||
ctx.View.Channels.SetChannels(ctx.Service.ChannelsToString())
|
||||
termui.Render(ctx.View.Channels)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user