You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Expose ScrollBarStyle webview option to tauri. (#14089)
* Expose `ScrollBarStyle` webview option to tauri.
This commit exposes the scroll_bar_style option from wry via the tauri
WebviewWindowBuilder API. By itself, the commit does not include changes
to the configuration file or JavaScript APIs: These will be added in a
later commit.
* Fix a compile error on macOS and Linux.
* Add `scroll_bar_style` to WindowConfig.
This commit exposes the `scroll_bar_style` option in tauri.conf.json/
.json5/.toml as `scrollBarStyle` and `scroll-bar-style`.
* Expose `scroll_bar_style` to JavaScript API.
This commit exposes the `scroll_bar_style` in the options object passed
to the JavaScript API `Webview` and `WebviewWindow` constructors.
While testing this, I discovered that on Windows, attempting to create
a webview from the JavaScript API will cause the hosting window to
immediately hang if it attempts to use the same data directory as
another webview without sharing the same environment options. This
commit includes no mitigation for this behaviour, as I will be opening
a separate issue about it at some point in the near future.
* Document WebView2 environment requirements.
This commit adds a message to the documentation for all components of
the `scroll_bar_style` configuration option, telling users that all
webviews that use the same data directory must use the same value for
this option.
* Fix formatting.
* Add change files to .changes directory.
* Remove `tauri-schema-generator` from change file.
* Remove quotes from change tags.
* Add tags to change files.
I did not realise that these were needed, as the pull request that I
used as my reference when building this feature did not have them.
* update conf
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Copy file name to clipboardExpand all lines: crates/tauri-cli/config.schema.json
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -593,6 +593,15 @@
593
593
},
594
594
"maxItems": 16,
595
595
"minItems": 16
596
+
},
597
+
"scrollBarStyle": {
598
+
"description": "Specifies the native scrollbar style to use with the webview.\n CSS styles that modify the scrollbar are applied on top of the native appearance configured here.\n\n Defaults to `default`, which is the browser default.\n\n ## Platform-specific\n\n - **Windows**:\n - `fluentOverlay` requires WebView2 Runtime version 125.0.2535.41 or higher,\n and does nothing on older versions.\n - This option must be given the same value for all webviews that target the same data directory.\n - **Linux / Android / iOS / macOS**: Unsupported. Only supports `Default` and performs no operation.",
599
+
"default": "default",
600
+
"allOf": [
601
+
{
602
+
"$ref": "#/definitions/ScrollBarStyle"
603
+
}
604
+
]
596
605
}
597
606
},
598
607
"additionalProperties": false
@@ -1112,6 +1121,25 @@
1112
1121
}
1113
1122
]
1114
1123
},
1124
+
"ScrollBarStyle": {
1125
+
"description": "The scrollbar style to use in the webview.\n\n ## Platform-specific\n\n - **Windows**: This option must be given the same value for all webviews that target the same data directory.",
1126
+
"oneOf": [
1127
+
{
1128
+
"description": "The scrollbar style to use in the webview.",
1129
+
"type": "string",
1130
+
"enum": [
1131
+
"default"
1132
+
]
1133
+
},
1134
+
{
1135
+
"description": "Fluent UI style overlay scrollbars. **Windows Only**\n\n Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,\n see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/?tabs=dotnetcsharp#10253541",
1136
+
"type": "string",
1137
+
"enum": [
1138
+
"fluentOverlay"
1139
+
]
1140
+
}
1141
+
]
1142
+
},
1115
1143
"SecurityConfig": {
1116
1144
"description": "Security configuration.\n\n See more: <https://v2.tauri.app/reference/config/#securityconfig>",
Copy file name to clipboardExpand all lines: crates/tauri-schema-generator/schemas/config.schema.json
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -593,6 +593,15 @@
593
593
},
594
594
"maxItems": 16,
595
595
"minItems": 16
596
+
},
597
+
"scrollBarStyle": {
598
+
"description": "Specifies the native scrollbar style to use with the webview.\n CSS styles that modify the scrollbar are applied on top of the native appearance configured here.\n\n Defaults to `default`, which is the browser default.\n\n ## Platform-specific\n\n - **Windows**:\n - `fluentOverlay` requires WebView2 Runtime version 125.0.2535.41 or higher,\n and does nothing on older versions.\n - This option must be given the same value for all webviews that target the same data directory.\n - **Linux / Android / iOS / macOS**: Unsupported. Only supports `Default` and performs no operation.",
599
+
"default": "default",
600
+
"allOf": [
601
+
{
602
+
"$ref": "#/definitions/ScrollBarStyle"
603
+
}
604
+
]
596
605
}
597
606
},
598
607
"additionalProperties": false
@@ -1112,6 +1121,25 @@
1112
1121
}
1113
1122
]
1114
1123
},
1124
+
"ScrollBarStyle": {
1125
+
"description": "The scrollbar style to use in the webview.\n\n ## Platform-specific\n\n - **Windows**: This option must be given the same value for all webviews that target the same data directory.",
1126
+
"oneOf": [
1127
+
{
1128
+
"description": "The scrollbar style to use in the webview.",
1129
+
"type": "string",
1130
+
"enum": [
1131
+
"default"
1132
+
]
1133
+
},
1134
+
{
1135
+
"description": "Fluent UI style overlay scrollbars. **Windows Only**\n\n Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,\n see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/?tabs=dotnetcsharp#10253541",
1136
+
"type": "string",
1137
+
"enum": [
1138
+
"fluentOverlay"
1139
+
]
1140
+
}
1141
+
]
1142
+
},
1115
1143
"SecurityConfig": {
1116
1144
"description": "Security configuration.\n\n See more: <https://v2.tauri.app/reference/config/#securityconfig>",
0 commit comments