mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
chore: upgrade dependencies
This commit is contained in:
@@ -57,7 +57,6 @@ type State struct {
|
||||
|
||||
func NewMainScreen(client *irc.Client) State {
|
||||
newViewport := viewport.New(0, 0)
|
||||
newViewport.Wrap = viewport.Wrap
|
||||
newViewport.Style = MessagesStyle.Copy()
|
||||
|
||||
return State{
|
||||
@@ -227,13 +226,13 @@ func (s *State) Blur() {
|
||||
|
||||
func (s *State) SetSize(width, height int) {
|
||||
s.InputBox.SetSize(width)
|
||||
s.SidePanel.SetSize(width, height, s.InputBox.Style.GetVerticalFrameSize())
|
||||
s.SidePanel.SetSize(width, height, s.InputBox.Style.GetVerticalPadding())
|
||||
|
||||
// We floor because width is an int and some fractions are lost when casting
|
||||
// and also because we ceil the sidepanel's width
|
||||
// -3 for the tab bar height
|
||||
newWidth := int(math.Floor(float64(width)*8/10) - float64(s.Viewport.Style.GetHorizontalFrameSize()))
|
||||
newHeight := height - s.InputBox.Style.GetVerticalFrameSize() - s.Viewport.Style.GetVerticalFrameSize() - 3
|
||||
newWidth := int(math.Floor(float64(width) * 8 / 10))
|
||||
newHeight := height - s.InputBox.Style.GetVerticalFrameSize() - 3
|
||||
|
||||
s.Viewport.Width = newWidth
|
||||
s.Viewport.Height = newHeight
|
||||
|
||||
@@ -39,7 +39,7 @@ func (s *SidePanelState) getHeader() string {
|
||||
if len(s.Client.Channels) != 0 {
|
||||
usersCount = len(s.Client.Channels[s.Client.ActiveChannelIndex].Users)
|
||||
}
|
||||
separator := strings.Repeat("—", s.Viewport.Width) + "\n"
|
||||
separator := strings.Repeat("—", s.Viewport.Width-s.Viewport.Style.GetHorizontalFrameSize()) + "\n"
|
||||
header := fmt.Sprintf("Users in this channel (%d)\n", usersCount) + separator
|
||||
|
||||
return header
|
||||
@@ -61,7 +61,6 @@ func (s *SidePanelState) getLatestNicks() []string {
|
||||
func NewSidePanel(client *irc.Client) *SidePanelState {
|
||||
newViewport := viewport.New(0, 0)
|
||||
newViewport.Style = SidePanelStyle.Copy()
|
||||
newViewport.Wrap = viewport.Wrap
|
||||
|
||||
return &SidePanelState{
|
||||
Client: client,
|
||||
@@ -119,7 +118,7 @@ func (s *SidePanelState) UpdateNicks() {
|
||||
func (s *SidePanelState) SetSize(width, height, inputboxHeight int) {
|
||||
// We ceil here because width is an int and some fractions are lost
|
||||
// -1 is for some extra invisible margin or padding between the sidepanel and the inputbox
|
||||
newWidth := int(math.Ceil(math.Ceil((float64(width) * 2 / 10)) - float64(s.Viewport.Style.GetHorizontalFrameSize())))
|
||||
newWidth := int(math.Ceil((float64(width) * 2 / 10)))
|
||||
newHeight := height - inputboxHeight - s.Viewport.Style.GetVerticalFrameSize() - 1
|
||||
|
||||
s.Viewport.Style = s.Viewport.Style.Width(newWidth)
|
||||
|
||||
Reference in New Issue
Block a user