Compare commits

..

7 Commits

Author SHA1 Message Date
Lea Anthony 37b395c308 [v3] Add Naive build command 2023-01-22 20:40:35 +11:00
Lea Anthony 428584d583 [v3] Add TODO 2023-01-22 16:52:26 +11:00
Lea Anthony ee1978aa42 [v3] Initial template support (likely to change) 2023-01-22 15:39:57 +11:00
Sebastian Bauer 895d6d4b80 Size() calculates DPIs back to default space. (#2325) 2023-01-22 15:25:26 +11:00
github-actions[bot] a5ddce2c7c chore: update sponsors.svg (#2317)
Co-authored-by: leaanthony <leaanthony@users.noreply.github.com>
2023-01-22 15:25:04 +11:00
Richard Guay e4789750c8 Updating and Adding (#2324)
* Adding Tutorial link

* Fixed EmailIt, Modal File Manager, and ScriptBar descriptions and added BulletinBoard

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-01-22 07:28:51 +11:00
Brian Dwyer f8c673874b Fix memory leak on Darwin when toggling system tray icon (#2322) 2023-01-21 15:46:06 +11:00
29 changed files with 91 additions and 23 deletions
@@ -250,6 +250,7 @@ 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
}
@@ -498,6 +499,14 @@ 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,3 +149,8 @@ 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
@@ -0,0 +1,30 @@
# 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,6 +11,7 @@ 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
@@ -0,0 +1,11 @@
package commands
import (
"github.com/wailsapp/wails/v3/internal/flags"
)
func Build(options *flags.Build) error {
return RunTask(&RunTaskOptions{
Name: "build",
})
}
+5
View File
@@ -0,0 +1,5 @@
package flags
type Build struct {
Common
}

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