Update tcell
This commit is contained in:
@ -24,7 +24,7 @@ import (
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/gomuks/interface"
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
)
|
||||
|
||||
type gomuksPointerContainer struct {
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// +build cgo
|
||||
//go:build cgo
|
||||
|
||||
package ui
|
||||
|
||||
@ -27,11 +27,12 @@ import (
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
"maunium.net/go/mautrix"
|
||||
"maunium.net/go/mautrix/crypto"
|
||||
"maunium.net/go/mautrix/crypto/ssss"
|
||||
"maunium.net/go/mautrix/id"
|
||||
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
)
|
||||
|
||||
func autocompleteDeviceUserID(cmd *CommandAutocomplete) (completions []string, newText string) {
|
||||
|
@ -23,9 +23,10 @@ import (
|
||||
|
||||
"github.com/lithammer/fuzzysearch/fuzzy"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/debug"
|
||||
|
@ -1,8 +1,8 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
)
|
||||
|
@ -23,10 +23,11 @@ import (
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/event"
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/matrix/rooms"
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
|
@ -25,15 +25,15 @@ import (
|
||||
"github.com/mattn/go-runewidth"
|
||||
sync "github.com/sasha-s/go-deadlock"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/event"
|
||||
"maunium.net/go/mautrix/id"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/gomuks/interface"
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
"maunium.net/go/gomuks/lib/open"
|
||||
"maunium.net/go/gomuks/ui/messages"
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
|
@ -21,12 +21,14 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
"maunium.net/go/mautrix/event"
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
)
|
||||
|
@ -20,9 +20,10 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/ui/messages/tstring"
|
||||
|
@ -25,12 +25,13 @@ import (
|
||||
"maunium.net/go/mautrix/crypto/attachment"
|
||||
"maunium.net/go/mautrix/event"
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/gomuks/interface"
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
"maunium.net/go/gomuks/lib/ansimage"
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
"maunium.net/go/gomuks/ui/messages/tstring"
|
||||
|
@ -18,8 +18,8 @@ package html
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
type BaseEntity struct {
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"go.mau.fi/mauview"
|
||||
)
|
||||
|
||||
type BlockquoteEntity struct {
|
||||
|
@ -17,7 +17,7 @@
|
||||
package html
|
||||
|
||||
import (
|
||||
"maunium.net/go/mauview"
|
||||
"go.mau.fi/mauview"
|
||||
)
|
||||
|
||||
type BreakEntity struct {
|
||||
|
@ -17,8 +17,8 @@
|
||||
package html
|
||||
|
||||
import (
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
type CodeBlockEntity struct {
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"go.mau.fi/mauview"
|
||||
)
|
||||
|
||||
type ContainerEntity struct {
|
||||
|
@ -17,8 +17,8 @@
|
||||
package html
|
||||
|
||||
import (
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
// AdjustStyleFunc is a lambda function type to edit an existing tcell Style.
|
||||
|
@ -19,7 +19,7 @@ package html
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"go.mau.fi/mauview"
|
||||
)
|
||||
|
||||
type HorizontalLineEntity struct {
|
||||
|
@ -21,8 +21,9 @@ import (
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
"maunium.net/go/mauview"
|
||||
)
|
||||
|
||||
type ListEntity struct {
|
||||
|
@ -28,11 +28,11 @@ import (
|
||||
"github.com/lucasb-eyer/go-colorful"
|
||||
"golang.org/x/net/html"
|
||||
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/event"
|
||||
"maunium.net/go/mautrix/id"
|
||||
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/matrix/rooms"
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
@ -60,7 +60,7 @@ func AdjustStyleUnderline(style tcell.Style) tcell.Style {
|
||||
}
|
||||
|
||||
func AdjustStyleStrikethrough(style tcell.Style) tcell.Style {
|
||||
return style.Strikethrough(true)
|
||||
return style.StrikeThrough(true)
|
||||
}
|
||||
|
||||
func AdjustStyleTextColor(color tcell.Color) func(tcell.Style) tcell.Style {
|
||||
|
@ -22,8 +22,9 @@ import (
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
"maunium.net/go/mauview"
|
||||
)
|
||||
|
||||
type TextEntity struct {
|
||||
|
@ -17,9 +17,10 @@
|
||||
package messages
|
||||
|
||||
import (
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/ui/messages/html"
|
||||
|
@ -20,12 +20,13 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/event"
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/gomuks/interface"
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
"maunium.net/go/gomuks/matrix/rooms"
|
||||
"maunium.net/go/gomuks/ui/messages/html"
|
||||
|
@ -17,9 +17,10 @@
|
||||
package messages
|
||||
|
||||
import (
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
)
|
||||
@ -55,6 +56,7 @@ func (msg *RedactedMessage) Height() int {
|
||||
|
||||
const RedactionChar = '█'
|
||||
const RedactionMaxWidth = 40
|
||||
|
||||
var RedactionStyle = tcell.StyleDefault.Foreground(tcell.NewRGBColor(50, 0, 0))
|
||||
|
||||
func (msg *RedactedMessage) Draw(screen mauview.Screen) {
|
||||
|
@ -20,8 +20,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"maunium.net/go/gomuks/matrix/muksevt"
|
||||
"maunium.net/go/mauview"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/ui/messages/tstring"
|
||||
|
@ -18,9 +18,9 @@ package tstring
|
||||
|
||||
import (
|
||||
"github.com/mattn/go-runewidth"
|
||||
"maunium.net/go/mauview"
|
||||
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
type Cell struct {
|
||||
|
@ -22,9 +22,8 @@ import (
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
type TString []Cell
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// +build !cgo
|
||||
//go:build !cgo
|
||||
|
||||
package ui
|
||||
|
||||
|
@ -20,8 +20,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
type PasswordModal struct {
|
||||
|
@ -24,9 +24,10 @@ import (
|
||||
|
||||
sync "github.com/sasha-s/go-deadlock"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/gomuks/matrix/rooms"
|
||||
|
@ -27,8 +27,8 @@ import (
|
||||
"github.com/mattn/go-runewidth"
|
||||
"github.com/zyedidia/clipboard"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix"
|
||||
"maunium.net/go/mautrix/crypto/attachment"
|
||||
|
@ -19,7 +19,7 @@ package ui
|
||||
import (
|
||||
"time"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"go.mau.fi/mauview"
|
||||
)
|
||||
|
||||
type SyncingModal struct {
|
||||
|
@ -22,9 +22,10 @@ import (
|
||||
"math"
|
||||
"strconv"
|
||||
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/matrix/rooms"
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
|
6
ui/ui.go
6
ui/ui.go
@ -22,10 +22,10 @@ import (
|
||||
|
||||
"github.com/zyedidia/clipboard"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/interface"
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
)
|
||||
|
||||
type View string
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// +build cgo
|
||||
//go:build cgo
|
||||
|
||||
package ui
|
||||
|
||||
@ -24,13 +24,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/crypto"
|
||||
"maunium.net/go/mautrix/event"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/mautrix/crypto"
|
||||
"maunium.net/go/mautrix/event"
|
||||
)
|
||||
|
||||
type EmojiView struct {
|
||||
|
@ -19,15 +19,15 @@ package ui
|
||||
import (
|
||||
"math"
|
||||
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix"
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/mautrix/id"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/debug"
|
||||
"maunium.net/go/gomuks/interface"
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
)
|
||||
|
||||
type LoginView struct {
|
||||
|
@ -25,19 +25,19 @@ import (
|
||||
|
||||
sync "github.com/sasha-s/go-deadlock"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/gomuks/ui/messages"
|
||||
"maunium.net/go/mautrix/id"
|
||||
"maunium.net/go/mautrix/pushrules"
|
||||
|
||||
"maunium.net/go/gomuks/config"
|
||||
"maunium.net/go/gomuks/debug"
|
||||
ifc "maunium.net/go/gomuks/interface"
|
||||
"maunium.net/go/gomuks/lib/notification"
|
||||
"maunium.net/go/gomuks/matrix/rooms"
|
||||
"maunium.net/go/gomuks/ui/messages"
|
||||
"maunium.net/go/gomuks/ui/widget"
|
||||
"maunium.net/go/mautrix/pushrules"
|
||||
)
|
||||
|
||||
type MainView struct {
|
||||
@ -189,7 +189,7 @@ func (view *MainView) OnKeyEvent(event mauview.KeyEvent) bool {
|
||||
msgView := view.currentRoom.MessageView()
|
||||
msgView.AddScrollOffset(-msgView.TotalHeight())
|
||||
case "add_newline":
|
||||
return view.flex.OnKeyEvent(tcell.NewEventKey(tcell.KeyEnter, '\n', event.Modifiers()|tcell.ModShift, ""))
|
||||
return view.flex.OnKeyEvent(tcell.NewEventKey(tcell.KeyEnter, '\n', event.Modifiers()|tcell.ModShift))
|
||||
case "next_active_room":
|
||||
view.SwitchRoom(view.roomList.NextWithActivity())
|
||||
case "show_bare":
|
||||
|
@ -17,8 +17,8 @@
|
||||
package widget
|
||||
|
||||
import (
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
// Border is a simple tview widget that renders a horizontal or vertical bar.
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/tcell"
|
||||
|
||||
"maunium.net/go/mautrix/id"
|
||||
)
|
||||
|
@ -22,8 +22,8 @@ import (
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
|
||||
"maunium.net/go/mauview"
|
||||
"maunium.net/go/tcell"
|
||||
"go.mau.fi/mauview"
|
||||
"go.mau.fi/tcell"
|
||||
)
|
||||
|
||||
func WriteLineSimple(screen mauview.Screen, line string, x, y int) {
|
||||
|
Reference in New Issue
Block a user