mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb+LibWebView+WebContent: Add a setting to control autoscrolling
This commit is contained in:
Notes:
github-actions[bot]
2026-04-13 17:51:31 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/79893b9cef9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8881
@@ -365,6 +365,21 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="card-title">Browsing Behavior</h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-group">
|
||||
<div class="inline-container">
|
||||
<label for="enable-autoscroll">Enable autoscrolling</label>
|
||||
<input id="enable-autoscroll" type="checkbox" switch />
|
||||
</div>
|
||||
<p class="description">
|
||||
Scroll pages by pressing the middle mouse button and moving the mouse.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-panel" id="tab-search">
|
||||
@@ -620,6 +635,7 @@
|
||||
};
|
||||
</script>
|
||||
|
||||
<script src="resource://ladybird/about-pages/settings/browsing-behavior.js" type="module"></script>
|
||||
<script src="resource://ladybird/about-pages/settings/default-zoom-level.js" type="module"></script>
|
||||
<script src="resource://ladybird/about-pages/settings/languages.js" type="module"></script>
|
||||
<script src="resource://ladybird/about-pages/settings/network.js" type="module"></script>
|
||||
|
||||
20
Base/res/ladybird/about-pages/settings/browsing-behavior.js
Normal file
20
Base/res/ladybird/about-pages/settings/browsing-behavior.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const enableAutoscroll = document.querySelector("#enable-autoscroll");
|
||||
|
||||
let BROWSING_BEHAVIOR = {};
|
||||
|
||||
const loadSettings = settings => {
|
||||
BROWSING_BEHAVIOR = settings.browsingBehavior || {};
|
||||
|
||||
enableAutoscroll.checked = !!BROWSING_BEHAVIOR.enableAutoscroll;
|
||||
};
|
||||
|
||||
enableAutoscroll.addEventListener("change", () => {
|
||||
BROWSING_BEHAVIOR.enableAutoscroll = enableAutoscroll.checked;
|
||||
ladybird.sendMessage("setBrowsingBehavior", BROWSING_BEHAVIOR);
|
||||
});
|
||||
|
||||
document.addEventListener("WebUIMessage", event => {
|
||||
if (event.detail.name === "loadSettings") {
|
||||
loadSettings(event.detail.data);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user