mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
feat: disable connect button when host, port and nickname are empty
This commit is contained in:
@@ -225,10 +225,10 @@ func (s *State) SetSize(width, height int) {
|
||||
s.InputBox.SetSize(width)
|
||||
s.SidePanel.SetSize(width, height, s.InputBox.Style.GetVerticalFrameSize())
|
||||
|
||||
// We floor here because width is an int and some fractions are lost
|
||||
// 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.0/10.0) - float64(s.Viewport.Style.GetHorizontalFrameSize()))
|
||||
newWidth := int(math.Floor(float64(width)*8/10) - float64(s.Viewport.Style.GetHorizontalFrameSize()))
|
||||
newHeight := height - s.InputBox.Style.GetVerticalFrameSize() - s.Viewport.Style.GetVerticalFrameSize() - 3
|
||||
|
||||
s.Viewport.Width = newWidth
|
||||
|
||||
@@ -119,7 +119,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.0 / 10.0)) - float64(s.Viewport.Style.GetHorizontalFrameSize())))
|
||||
newWidth := int(math.Ceil(math.Ceil((float64(width) * 2 / 10)) - float64(s.Viewport.Style.GetHorizontalFrameSize())))
|
||||
newHeight := height - inputboxHeight - s.Viewport.Style.GetVerticalFrameSize() - 1
|
||||
|
||||
s.Viewport.Style = s.Viewport.Style.Width(newWidth)
|
||||
|
||||
@@ -95,11 +95,11 @@ var (
|
||||
leftArrowDim = tab.Copy().
|
||||
Border(leftArrowBorder, true).
|
||||
BorderForeground(ui.PrimaryColor).
|
||||
Foreground(ui.ArrowsDimColor)
|
||||
Foreground(ui.DisabledColor)
|
||||
rightArrowDim = tab.Copy().
|
||||
Border(rightArrowBorder, true).
|
||||
BorderForeground(ui.PrimaryColor).
|
||||
Foreground(ui.ArrowsDimColor)
|
||||
Foreground(ui.DisabledColor)
|
||||
|
||||
leftArrowLit = tab.Copy().
|
||||
Border(leftArrowBorder, true).
|
||||
|
||||
Reference in New Issue
Block a user