graphics glitch fix & fixed wine registry issue
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
Icon = "Icon.png"
|
||||
Name = "TurtleSilicon"
|
||||
ID = "com.tairasu.turtlesilicon"
|
||||
Version = "1.2.0"
|
||||
Build = 33
|
||||
Version = "1.2.1"
|
||||
Build = 37
|
||||
|
2
main.go
2
main.go
@@ -15,7 +15,7 @@ import (
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
const appVersion = "1.2.0"
|
||||
const appVersion = "1.2.1"
|
||||
|
||||
func main() {
|
||||
TSApp := app.NewWithID("com.tairasu.turtlesilicon")
|
||||
|
@@ -173,6 +173,7 @@ func createWineRegistryComponents() {
|
||||
enableOptionAsAltButton = widget.NewButton("Enable", func() {
|
||||
enableOptionAsAltButton.Disable()
|
||||
disableOptionAsAltButton.Disable()
|
||||
remapOperationInProgress = true
|
||||
|
||||
// Show loading state in status label
|
||||
fyne.Do(func() {
|
||||
@@ -182,6 +183,10 @@ func createWineRegistryComponents() {
|
||||
|
||||
// Run in goroutine to avoid blocking UI
|
||||
go func() {
|
||||
defer func() {
|
||||
remapOperationInProgress = false
|
||||
}()
|
||||
|
||||
if err := utils.SetOptionAsAltEnabled(true); err != nil {
|
||||
debug.Printf("Failed to enable Option-as-Alt mapping: %v", err)
|
||||
// Update UI on main thread
|
||||
@@ -210,6 +215,7 @@ func createWineRegistryComponents() {
|
||||
disableOptionAsAltButton = widget.NewButton("Disable", func() {
|
||||
enableOptionAsAltButton.Disable()
|
||||
disableOptionAsAltButton.Disable()
|
||||
remapOperationInProgress = true
|
||||
|
||||
// Show loading state in status label
|
||||
fyne.Do(func() {
|
||||
@@ -219,6 +225,10 @@ func createWineRegistryComponents() {
|
||||
|
||||
// Run in goroutine to avoid blocking UI
|
||||
go func() {
|
||||
defer func() {
|
||||
remapOperationInProgress = false
|
||||
}()
|
||||
|
||||
if err := utils.SetOptionAsAltEnabled(false); err != nil {
|
||||
debug.Printf("Failed to disable Option-as-Alt mapping: %v", err)
|
||||
// Update UI on main thread
|
||||
@@ -298,8 +308,7 @@ func startPulsingEffect() {
|
||||
dots := ""
|
||||
|
||||
for pulsingActive {
|
||||
select {
|
||||
case <-pulsingTicker.C:
|
||||
<-pulsingTicker.C
|
||||
if pulsingActive {
|
||||
// Cycle through different dot patterns for visual effect
|
||||
switch len(dots) {
|
||||
@@ -326,7 +335,6 @@ func startPulsingEffect() {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
|
@@ -66,8 +66,55 @@ func showOptionsPopup() {
|
||||
|
||||
// Set the close button action to hide the popup
|
||||
closeButton.OnTapped = func() {
|
||||
if remapOperationInProgress {
|
||||
// Show warning popup instead of closing
|
||||
showRemapWarningPopup()
|
||||
} else {
|
||||
popup.Hide()
|
||||
}
|
||||
}
|
||||
|
||||
popup.Show()
|
||||
}
|
||||
|
||||
// showRemapWarningPopup shows a warning popup when user tries to close options during remap operation
|
||||
func showRemapWarningPopup() {
|
||||
if currentWindow == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Create warning content
|
||||
warningTitle := widget.NewRichTextFromMarkdown("# ⚠️ Please Wait")
|
||||
warningMessage := widget.NewRichTextFromMarkdown("**Remap operation is in progress.**\n\nThe wine registry is being modified. This will take a moment.\n\nPlease wait for the operation to complete before closing the options.")
|
||||
|
||||
// Create OK button
|
||||
okButton := widget.NewButton("OK", func() {
|
||||
// This will be set when the popup is created
|
||||
})
|
||||
okButton.Importance = widget.HighImportance
|
||||
|
||||
// Create warning content container
|
||||
warningContent := container.NewVBox(
|
||||
container.NewCenter(warningTitle),
|
||||
widget.NewSeparator(),
|
||||
warningMessage,
|
||||
widget.NewSeparator(),
|
||||
container.NewCenter(okButton),
|
||||
)
|
||||
|
||||
// Calculate smaller popup size
|
||||
windowSize := currentWindow.Content().Size()
|
||||
popupWidth := windowSize.Width * 2 / 3
|
||||
popupHeight := windowSize.Height / 2
|
||||
|
||||
// Create the warning popup
|
||||
warningPopup := widget.NewModalPopUp(container.NewPadded(warningContent), currentWindow.Canvas())
|
||||
warningPopup.Resize(fyne.NewSize(popupWidth, popupHeight))
|
||||
|
||||
// Set the OK button action to hide the warning popup
|
||||
okButton.OnTapped = func() {
|
||||
warningPopup.Hide()
|
||||
}
|
||||
|
||||
warningPopup.Show()
|
||||
}
|
||||
|
@@ -45,6 +45,7 @@ var (
|
||||
|
||||
// State variables
|
||||
currentWineRegistryEnabled bool
|
||||
remapOperationInProgress bool
|
||||
|
||||
// Pulsing effect variables (pulsingActive is in status.go)
|
||||
pulsingTicker *time.Ticker
|
||||
|
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
wineRegistrySection = "[Software\\Wine\\Mac Driver]"
|
||||
wineRegistrySection = "[Software\\\\Wine\\\\Mac Driver]"
|
||||
leftOptionKey = "\"LeftOptionIsAlt\"=\"Y\""
|
||||
rightOptionKey = "\"RightOptionIsAlt\"=\"Y\""
|
||||
wineLoaderPath = "/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/CrossOver-Hosted Application/wineloader2"
|
||||
|
BIN
turtlesilicon
Executable file
BIN
turtlesilicon
Executable file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user