Skip to content

Commit

Permalink
feat: add windows options supports DisablePinchZoom configuration(#…
Browse files Browse the repository at this point in the history
…2021) (#3115)

* feat: add windows options supports `IsPinchZoomEnabled` configuration(#2021)

* refactor: modify `IsPinchZoomEnabled` to `DisablePinchZoom` ensure default behavior is consistent

* docs: add `DisablePinchZoom` to changelog

* docs: update the description of `DisablePinchZoom` attributes in the document

---------

Co-authored-by: Lea Anthony <[email protected]>
  • Loading branch information
tuuzed and leaanthony authored Dec 15, 2023
1 parent 5f457db commit 8efaaff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions v2/internal/frontend/desktop/windows/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ func (f *Frontend) setupChromium() {
if err != nil {
log.Fatal(err)
}
err = settings.PutIsPinchZoomEnabled(!opts.DisablePinchZoom)
if err != nil {
log.Fatal(err)
}
}

err = settings.PutIsStatusBarEnabled(false)
Expand Down
2 changes: 2 additions & 0 deletions v2/pkg/options/windows/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ type Options struct {
IsZoomControlEnabled bool
ZoomFactor float64

DisablePinchZoom bool

// Disable all window decorations in Frameless mode, which means no "Aero Shadow" and no "Rounded Corner" will be shown.
// "Rounded Corners" are only available on Windows 11.
DisableFramelessWindowDecorations bool
Expand Down
8 changes: 8 additions & 0 deletions website/docs/reference/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func main() {
WebviewIsTransparent: false,
WindowIsTranslucent: false,
BackdropType: windows.Mica,
DisablePinchZoom: false,
DisableWindowIcon: false,
DisableFramelessWindowDecorations: false,
WebviewUserDataPath: "",
Expand Down Expand Up @@ -577,6 +578,13 @@ The value can be one of the following:
| Mica | Use [Mica](https://learn.microsoft.com/en-us/windows/apps/design/style/mica) effect |
| Tabbed | Use Tabbed. This is a backdrop that is similar to Mica. |

#### DisablePinchZoom

Setting this to `true` will disable pinch zoom gestures.

Name: DisablePinchZoom<br/>
Type: `bool`

#### DisableWindowIcon

Setting this to `true` will remove the icon in the top left corner of the title bar.
Expand Down
4 changes: 3 additions & 1 deletion website/src/pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
### Added

- Added windows options supports `DisablePinchZoom` configuration. Added by @tuuzed in [PR](https://github.com/wailsapp/wails/pull/3115)
- Add Apple Silicon hardware detection to `wails doctor`. Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3129)


## v2.7.1 - 2023-12-10

### Fixed
Expand Down

0 comments on commit 8efaaff

Please sign in to comment.