Finalize v1.23

This commit is contained in:
Evan Su 2022-03-19 21:02:06 -04:00 committed by GitHub
parent 9e396d3b71
commit eb18e852d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 44 deletions

View File

@ -29,7 +29,6 @@ import (
"io" "io"
"math" "math"
"math/big" "math/big"
"net/http"
"os" "os"
"path/filepath" "path/filepath"
"regexp" "regexp"
@ -60,7 +59,6 @@ var font []byte
// Generic variables // Generic variables
var version = "v1.23" var version = "v1.23"
var window *giu.MasterWindow var window *giu.MasterWindow
var windowOptimized bool
var dpi float32 var dpi float32
var mode string var mode string
var working bool var working bool
@ -144,28 +142,6 @@ var rs32, _ = infectious.NewFEC(32, 96)
var rs64, _ = infectious.NewFEC(64, 192) var rs64, _ = infectious.NewFEC(64, 192)
var rs128, _ = infectious.NewFEC(128, 136) var rs128, _ = infectious.NewFEC(128, 136)
// File checksum generator variables
var csProgress float32
var csMd5 string
var csSha1 string
var csSha256 string
var csSha3 string
var csBlake2b string
var csBlake2s string
var csValidate string
var md5Color = color.RGBA{0x00, 0x00, 0x00, 0x00}
var sha1Color = color.RGBA{0x00, 0x00, 0x00, 0x00}
var sha256Color = color.RGBA{0x00, 0x00, 0x00, 0x00}
var sha3Color = color.RGBA{0x00, 0x00, 0x00, 0x00}
var blake2bColor = color.RGBA{0x00, 0x00, 0x00, 0x00}
var blake2sColor = color.RGBA{0x00, 0x00, 0x00, 0x00}
var md5Selected = true
var sha1Selected = true
var sha256Selected = true
var sha3Selected = false
var blake2bSelected = false
var blake2sSelected = false
func draw() { func draw() {
giu.SingleWindow().Layout( giu.SingleWindow().Layout(
giu.Custom(func() { giu.Custom(func() {
@ -583,10 +559,7 @@ func draw() {
), ),
giu.Custom(func() { giu.Custom(func() {
if !windowOptimized || windowOptimized { window.SetSize(int(442*dpi), giu.GetCursorPos().Y)
windowOptimized = true
window.SetSize(int(442*dpi), giu.GetCursorPos().Y+1)
}
}), }),
) )
} }
@ -1704,7 +1677,7 @@ func main() {
giu.SetDefaultFontFromBytes(font, 18) giu.SetDefaultFontFromBytes(font, 18)
// Create the master window // Create the master window
window = giu.NewMasterWindow("Picocrypt", 442, 532, giu.MasterWindowFlagsNotResizable) window = giu.NewMasterWindow("Picocrypt", 442, 452, giu.MasterWindowFlagsNotResizable)
dialog.Init() dialog.Init()
// Set window icon // Set window icon
@ -1721,21 +1694,6 @@ func main() {
// Set universal DPI // Set universal DPI
dpi = giu.Context.GetPlatform().GetContentScale() dpi = giu.Context.GetPlatform().GetContentScale()
// Start a goroutine to check if a newer version is available
go func() {
v, err := http.Get("https://raw.githubusercontent.com/HACKERALERT/Picocrypt/main/internals/version.txt")
if err == nil {
body, err := io.ReadAll(v.Body)
v.Body.Close()
if err == nil {
if string(body[:5]) != version {
mainStatus = fmt.Sprintf("A newer version (%s) is available.", string(body[:5]))
mainStatusColor = color.RGBA{0x00, 0xff, 0x00, 0xff}
}
}
}
}()
// Start the UI // Start the UI
window.Run(draw) window.Run(draw)
} }