Compare commits

..

3 Commits

Author SHA1 Message Date
Lea Anthony db2745e453 Rename main.tmpl.go to main.go.tmpl to remove IDE warnings 2023-01-22 16:29:14 +11:00
Lea Anthony 56dba5c3a4 Initial template support (likely to change) 2023-01-22 15:29:53 +11:00
Lea Anthony 3ccf027624 Initial template support (likely to change) 2023-01-22 15:28:45 +11:00
29 changed files with 23 additions and 91 deletions
@@ -250,7 +250,6 @@ func (cba *ControlBase) Size() (width, height int) {
rect := w32.GetWindowRect(cba.hwnd)
width = int(rect.Right - rect.Left)
height = int(rect.Bottom - rect.Top)
width, height = cba.scaleToDefaultDPI(width, height)
return
}
@@ -499,14 +498,6 @@ func (cba *ControlBase) scaleWithWindowDPI(width, height int) (int, int) {
return scaledWidth, scaledHeight
}
func (cba *ControlBase) scaleToDefaultDPI(width, height int) (int, int) {
dpix, dpiy := cba.GetWindowDPI()
scaledWidth := ScaleToDefaultDPI(width, dpix)
scaledHeight := ScaleToDefaultDPI(height, dpiy)
return scaledWidth, scaledHeight
}
func (cba *ControlBase) tryInvokeOnCurrentGoRoutine(f func()) bool {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
@@ -149,8 +149,3 @@ func ScreenToClientRect(hwnd w32.HWND, rect *w32.RECT) *Rect {
func ScaleWithDPI(pixels int, dpi uint) int {
return (pixels * int(dpi)) / 96
}
// ScaleToDefaultDPI scales the pixels from scaled DPI-Space to default DPI-Space (96).
func ScaleToDefaultDPI(pixels int, dpi uint) int {
return (pixels * 96) / int(dpi)
}
-30
View File
@@ -1,30 +0,0 @@
# TODO
Informal and incomplete list of things needed in v3.
## General
- [ ] Generate Bindings
- [ ] Generate TS Models
- [ ] Port NSIS creation
- [ ] Dev Mode
- [ ] Generate Info.Plist from `info.json`
- [ ] Windows Port
- [ ] Linux Port
## Runtime
- [ ] Pass window ID with runtime calls in JS
- [ ] Implement alias for `window` in JS
- [ ] Implement runtime dispatcher
## Templates
- [ ] Create plain template
- [ ] Improve default template
## Runtime
- [ ] To log or not to log?
- [ ] Unify cross-platform events, eg. `onClose`
-1
View File
@@ -11,7 +11,6 @@ import (
func main() {
app := clir.NewCli("Wails", "The Wails CLI", "v3")
app.NewSubCommandFunction("build", "Build the project", commands.Build)
app.NewSubCommandFunction("init", "Initialise a new project", commands.Init)
task := app.NewSubCommand("task", "Run and list tasks")
task.NewSubCommandFunction("run", "Run a task", commands.RunTask)
-11
View File
@@ -1,11 +0,0 @@
package commands
import (
"github.com/wailsapp/wails/v3/internal/flags"
)
func Build(options *flags.Build) error {
return RunTask(&RunTaskOptions{
Name: "build",
})
}
-5
View File
@@ -1,5 +0,0 @@
package flags
type Build struct {
Common
}

Some files were not shown because too many files have changed in this diff Show More