mirror of
https://github.com/diamondburned/cchat-gtk.git
synced 2025-05-06 06:24:12 +00:00
minor fixes, first of 2021!
This commit is contained in:
parent
c8f5446710
commit
8afbd156bc
2
go.mod
2
go.mod
|
@ -13,7 +13,7 @@ require (
|
|||
github.com/Xuanwo/go-locale v1.0.0
|
||||
github.com/alecthomas/chroma v0.7.3
|
||||
github.com/diamondburned/cchat v0.3.15
|
||||
github.com/diamondburned/cchat-discord v0.0.0-20201231025836-96e97aa11705
|
||||
github.com/diamondburned/cchat-discord v0.0.0-20210101084233-d8599a528770
|
||||
github.com/diamondburned/cchat-mock v0.0.0-20201115033644-df8d1b10f9db
|
||||
github.com/diamondburned/gspell v0.0.0-20201229064336-e43698fd5828
|
||||
github.com/diamondburned/handy v0.0.0-20201229063418-ec23c1370374
|
||||
|
|
6
go.sum
6
go.sum
|
@ -54,6 +54,8 @@ github.com/diamondburned/arikawa/v2 v2.0.0-20201220032235-088b30430377 h1:71BLnE
|
|||
github.com/diamondburned/arikawa/v2 v2.0.0-20201220032235-088b30430377/go.mod h1:e+lhS20ni2luFEU06Pc8paCxgZL99/RZb77dOC82CF0=
|
||||
github.com/diamondburned/arikawa/v2 v2.0.0-20201227001310-f3f075b27f44 h1:i6Jec7bvVY8NhwW3L0SlpfWM6r2p2i67XuhiOEzkfwI=
|
||||
github.com/diamondburned/arikawa/v2 v2.0.0-20201227001310-f3f075b27f44/go.mod h1:e+lhS20ni2luFEU06Pc8paCxgZL99/RZb77dOC82CF0=
|
||||
github.com/diamondburned/arikawa/v2 v2.0.0-20210101083335-169b36126239 h1:ogL6/TJJecNYkvREJa+nHZ326b+QjHN/eLXMUtiyz/A=
|
||||
github.com/diamondburned/arikawa/v2 v2.0.0-20210101083335-169b36126239/go.mod h1:e+lhS20ni2luFEU06Pc8paCxgZL99/RZb77dOC82CF0=
|
||||
github.com/diamondburned/cchat v0.3.11 h1:C1f9Tp7Kz3t+T1SlepL1RS7b/kACAKWAIZXAgJEpCHg=
|
||||
github.com/diamondburned/cchat v0.3.11/go.mod h1:IlMtF+XIvAJh0GL/2yFdf0/34w+Hdy5A1GgvSwAXtQI=
|
||||
github.com/diamondburned/cchat v0.3.15 h1:BJf8ZiRtDWTGMtQ3QqjNU0H+784WSrkJEpFGkKY5gEw=
|
||||
|
@ -68,6 +70,8 @@ github.com/diamondburned/cchat-discord v0.0.0-20201227035212-6beff5225092 h1:oxY
|
|||
github.com/diamondburned/cchat-discord v0.0.0-20201227035212-6beff5225092/go.mod h1:rFBGZYLq0g6Pb/WGN/K0++kXrhCYlQQ1nc2FX4r8CO0=
|
||||
github.com/diamondburned/cchat-discord v0.0.0-20201231025836-96e97aa11705 h1:g0hwnUpeJ3yo7WaVZjWBQw875tnKVjCz4YofnamE9Fg=
|
||||
github.com/diamondburned/cchat-discord v0.0.0-20201231025836-96e97aa11705/go.mod h1:rFBGZYLq0g6Pb/WGN/K0++kXrhCYlQQ1nc2FX4r8CO0=
|
||||
github.com/diamondburned/cchat-discord v0.0.0-20210101084233-d8599a528770 h1:2BeUPBxGYZm3QioWYw9/4PCJAA2x/I8JTYWS4dmqc3o=
|
||||
github.com/diamondburned/cchat-discord v0.0.0-20210101084233-d8599a528770/go.mod h1:Kv+sNS+3UHHDqiuwEkmfaY8nDr3LPryRzCHaV1E6VeM=
|
||||
github.com/diamondburned/cchat-mock v0.0.0-20201115033644-df8d1b10f9db h1:VQI2PdbsdsRJ7d669kp35GbCUO44KZ0Xfqdu4o/oqVg=
|
||||
github.com/diamondburned/cchat-mock v0.0.0-20201115033644-df8d1b10f9db/go.mod h1:M87kjNzWVPlkZycFNzpGPKQXzkHNnZphuwMf3E9ckgc=
|
||||
github.com/diamondburned/gotk3 v0.0.0-20201209182406-e7291341a091 h1:lQpSWzbi3rQf66aMSip/rIypasIFwqCqF0Wfn5og6gw=
|
||||
|
@ -110,6 +114,8 @@ github.com/diamondburned/ningen/v2 v2.0.0-20201227020621-a4e33db11d3c h1:IWn/N54
|
|||
github.com/diamondburned/ningen/v2 v2.0.0-20201227020621-a4e33db11d3c/go.mod h1:zQkAo1RT4ru4HW6B5T4IRO2pee8ITzTUA2Y7XNpgjqo=
|
||||
github.com/diamondburned/ningen/v2 v2.0.0-20201227034843-dc1d22fc28e4 h1:ptIpcyB/FIBM5viKLVXuBiE1utqBcH4S3l5kUQrsL9Q=
|
||||
github.com/diamondburned/ningen/v2 v2.0.0-20201227034843-dc1d22fc28e4/go.mod h1:zQkAo1RT4ru4HW6B5T4IRO2pee8ITzTUA2Y7XNpgjqo=
|
||||
github.com/diamondburned/ningen/v2 v2.0.0-20210101084041-d9a5058b63b5 h1:GKqBXunV2AC/owpkiaFng1wPxgxE76sQ8HEPAHGj29o=
|
||||
github.com/diamondburned/ningen/v2 v2.0.0-20210101084041-d9a5058b63b5/go.mod h1:WRQCUX/dTH4OPEy3JANLA5D6fbumzp5zk03uSUAZppA=
|
||||
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
|
||||
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
|
||||
github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk=
|
||||
|
|
|
@ -12,7 +12,8 @@ import (
|
|||
|
||||
var typingIndicatorCSS = primitives.PrepareCSS(`
|
||||
.typing-indicator {
|
||||
margin: 0 6px;
|
||||
margin: 0 6px;
|
||||
margin-top: 2px;
|
||||
border-radius: 6px 6px 0 0;
|
||||
color: alpha(@theme_fg_color, 0.8);
|
||||
background-color: @theme_base_color;
|
||||
|
@ -44,7 +45,7 @@ func New() *Container {
|
|||
b.Show()
|
||||
|
||||
r, _ := gtk.RevealerNew()
|
||||
r.SetTransitionDuration(50)
|
||||
r.SetTransitionDuration(100)
|
||||
r.SetTransitionType(gtk.REVEALER_TRANSITION_TYPE_CROSSFADE)
|
||||
r.SetRevealChild(false)
|
||||
r.Add(b)
|
||||
|
@ -85,6 +86,10 @@ func (c *Container) TrySubscribe(svmsg cchat.Messenger) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
var noMentionLinks = markup.RenderConfig{
|
||||
NoMentionLinks: true,
|
||||
}
|
||||
|
||||
func render(typers []cchat.Typer) string {
|
||||
// fast path
|
||||
if len(typers) == 0 {
|
||||
|
@ -94,8 +99,10 @@ func render(typers []cchat.Typer) string {
|
|||
var builder strings.Builder
|
||||
|
||||
for i, typer := range typers {
|
||||
output := markup.RenderCmplxWithConfig(typer.Name(), noMentionLinks)
|
||||
|
||||
builder.WriteString("<b>")
|
||||
builder.WriteString(markup.Render(typer.Name()))
|
||||
builder.WriteString(output.Markup)
|
||||
builder.WriteString("</b>")
|
||||
|
||||
switch i {
|
||||
|
|
|
@ -279,7 +279,7 @@ func colorAttrs(c uint32, bg bool) []string {
|
|||
rgb, a := splitRGBA(c)
|
||||
|
||||
// Render the hex representation beforehand.
|
||||
hex := "#" + strconv.FormatUint(uint64(rgb), 16)
|
||||
hex := "#" + hexPad(rgb)
|
||||
|
||||
attrs := make([]string, 1, 4)
|
||||
attrs[0] = wrapKeyValue("color", hex)
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Inject madvdontneed=1 as soon as possible.
|
||||
|
||||
var _ = func() struct{} {
|
||||
// If GODEBUG is not empty, then use that instead of trying to exec our own.
|
||||
if os.Getenv("GODEBUG") != "" {
|
||||
return struct{}{}
|
||||
}
|
||||
|
||||
// Do magic.
|
||||
var environ = append(os.Environ(), "GODEBUG=madvdontneed=1")
|
||||
|
||||
log.Println("execve(2)ing with madvdontneed=1 for aggressive GC.")
|
||||
|
||||
path, err := exec.LookPath(os.Args[0])
|
||||
if err != nil {
|
||||
return struct{}{}
|
||||
}
|
||||
|
||||
if err := syscall.Exec(path, os.Args, environ); err != nil {
|
||||
log.Println("Error while executing:", err)
|
||||
log.Println("Starting up without madvdontneed=1...")
|
||||
return struct{}{}
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
return struct{}{}
|
||||
}()
|
Loading…
Reference in a new issue