feat: use box for mqtt zoom #90
This commit is contained in:
+2
-1
@@ -576,9 +576,10 @@ const initPageZoom = () => {
|
|||||||
command_topic: `${root}/set`,
|
command_topic: `${root}/set`,
|
||||||
state_topic: `${root}/state`,
|
state_topic: `${root}/state`,
|
||||||
value_template: "{{ value | int }}",
|
value_template: "{{ value | int }}",
|
||||||
mode: "slider",
|
mode: "box",
|
||||||
min: 25,
|
min: 25,
|
||||||
max: 400,
|
max: 400,
|
||||||
|
step: 5,
|
||||||
unit_of_measurement: "%",
|
unit_of_measurement: "%",
|
||||||
icon: "mdi:magnify-plus",
|
icon: "mdi:magnify-plus",
|
||||||
device: INTEGRATION.device,
|
device: INTEGRATION.device,
|
||||||
|
|||||||
+4
-2
@@ -378,7 +378,8 @@ const toggleStatus = (force = null) => {
|
|||||||
*/
|
*/
|
||||||
const zoomMinus = () => {
|
const zoomMinus = () => {
|
||||||
const view = WEBVIEW.views[WEBVIEW.viewActive];
|
const view = WEBVIEW.views[WEBVIEW.viewActive];
|
||||||
view.webContents.setZoomFactor(Math.max(0.25, view.webContents.getZoomFactor() - 0.1));
|
const zoom = view.webContents.getZoomFactor() - 0.1;
|
||||||
|
view.webContents.setZoomFactor(Math.max(0.25, Math.round(zoom * 10) / 10));
|
||||||
update();
|
update();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -387,7 +388,8 @@ const zoomMinus = () => {
|
|||||||
*/
|
*/
|
||||||
const zoomPlus = () => {
|
const zoomPlus = () => {
|
||||||
const view = WEBVIEW.views[WEBVIEW.viewActive];
|
const view = WEBVIEW.views[WEBVIEW.viewActive];
|
||||||
view.webContents.setZoomFactor(Math.min(4.0, view.webContents.getZoomFactor() + 0.1));
|
const zoom = view.webContents.getZoomFactor() + 0.1;
|
||||||
|
view.webContents.setZoomFactor(Math.min(4.0, Math.round(zoom * 10) / 10));
|
||||||
update();
|
update();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user