per-window option to disable grabbing
This commit is contained in:
1
wlx-overlay-s/src/assets/edit/disable-grab.svg
Normal file
1
wlx-overlay-s/src/assets/edit/disable-grab.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE --><path fill="white" d="m2.1 2.075l19.8 19.8l-1.425 1.425l-1.1-1.1q-.5.375-1.1.588T17 23h-6.95q-.75 0-1.4-.337T7.575 21.7L1.2 12.375l.6-.575q.475-.475 1.125-.55t1.175.3L7 13.575v-3.75L.675 3.5zM21 18.15l-6-5.975V3q0-.425.288-.712T16 2t.713.288T17 3v9.175h2V5q0-.425.288-.712T20 4t.713.288T21 5zm-8-8l-2-2V2q0-.425.288-.712T12 1t.713.288T13 2zm-4-4l-2-2V4q0-.425.288-.712T8 3t.713.288T9 4z"/></svg>
|
||||||
|
After Width: | Height: | Size: 594 B |
@@ -42,6 +42,7 @@
|
|||||||
<div flex_direction="column" gap="8">
|
<div flex_direction="column" gap="8">
|
||||||
<div flex_direction="row" gap="4">
|
<div flex_direction="row" gap="4">
|
||||||
<TopButton sticky="1" id="top_lock" src="edit/lock_open.svg" tooltip="EDIT_MODE.LOCK_INTERACTION" press="::EditModeToggleLock" />
|
<TopButton sticky="1" id="top_lock" src="edit/lock_open.svg" tooltip="EDIT_MODE.LOCK_INTERACTION" press="::EditModeToggleLock" />
|
||||||
|
<TopButton sticky="1" id="top_grab" src="edit/disable-grab.svg" tooltip="EDIT_MODE.DISABLE_GRAB" press="::EditModeToggleGrab" />
|
||||||
<TopButton sticky="0" id="top_pos" src="edit/anchor.svg" tooltip="EDIT_MODE.POSITIONING" press="::EditModeTab pos" />
|
<TopButton sticky="0" id="top_pos" src="edit/anchor.svg" tooltip="EDIT_MODE.POSITIONING" press="::EditModeTab pos" />
|
||||||
<TopButton sticky="0" id="top_alpha" src="edit/fade.svg" tooltip="EDIT_MODE.OPACITY" press="::EditModeTab alpha" />
|
<TopButton sticky="0" id="top_alpha" src="edit/fade.svg" tooltip="EDIT_MODE.OPACITY" press="::EditModeTab alpha" />
|
||||||
<TopButton sticky="0" id="top_curve" src="edit/curve.svg" tooltip="EDIT_MODE.ADJUST_CURVATURE" press="::EditModeTab curve" />
|
<TopButton sticky="0" id="top_curve" src="edit/curve.svg" tooltip="EDIT_MODE.ADJUST_CURVATURE" press="::EditModeTab curve" />
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"HINT_POINT_WINDOW": "Zeigen Sie auf ein Fenster, um seine Parameter zu ändern.\nWenn Sie fertig sind, verlassen Sie den Bearbeitungsmodus mit der Schaltfläche auf der rechten Seite.",
|
"HINT_POINT_WINDOW": "Zeigen Sie auf ein Fenster, um seine Parameter zu ändern.\nWenn Sie fertig sind, verlassen Sie den Bearbeitungsmodus mit der Schaltfläche auf der rechten Seite.",
|
||||||
"LEAVE": "Bearbeitungsmodus verlassen",
|
"LEAVE": "Bearbeitungsmodus verlassen",
|
||||||
"LOCK_INTERACTION": "Interaktion sperren",
|
"LOCK_INTERACTION": "Interaktion sperren",
|
||||||
|
"DISABLE_GRAB": "Greifen deaktivieren",
|
||||||
"MOVE_PRESS_AND_DRAG": "Verschieben (drücken & ziehen)",
|
"MOVE_PRESS_AND_DRAG": "Verschieben (drücken & ziehen)",
|
||||||
"OPACITY": "Undurchsichtigkeit",
|
"OPACITY": "Undurchsichtigkeit",
|
||||||
"POSITIONING": "Positionierung",
|
"POSITIONING": "Positionierung",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"HINT_POINT_WINDOW": "Point at a window to change its parameters.\nOnce done, leave edit mode using the button on the right.",
|
"HINT_POINT_WINDOW": "Point at a window to change its parameters.\nOnce done, leave edit mode using the button on the right.",
|
||||||
"LEAVE": "Leave edit mode",
|
"LEAVE": "Leave edit mode",
|
||||||
"LOCK_INTERACTION": "Lock interaction",
|
"LOCK_INTERACTION": "Lock interaction",
|
||||||
|
"DISABLE_GRAB": "Disable grab",
|
||||||
"MOVE_PRESS_AND_DRAG": "Move (press & drag)",
|
"MOVE_PRESS_AND_DRAG": "Move (press & drag)",
|
||||||
"OPACITY": "Opacity",
|
"OPACITY": "Opacity",
|
||||||
"POSITIONING": "Positioning",
|
"POSITIONING": "Positioning",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"HINT_POINT_WINDOW": "Pulsa sobre una ventana para cambiar sus parámetros.\nUna vez terminado, sal del modo de edición usando el botón de la derecha.",
|
"HINT_POINT_WINDOW": "Pulsa sobre una ventana para cambiar sus parámetros.\nUna vez terminado, sal del modo de edición usando el botón de la derecha.",
|
||||||
"LEAVE": "Salir del modo edición",
|
"LEAVE": "Salir del modo edición",
|
||||||
"LOCK_INTERACTION": "Bloquear interacción",
|
"LOCK_INTERACTION": "Bloquear interacción",
|
||||||
|
"DISABLE_GRAB": "Desactivar agarre",
|
||||||
"MOVE_PRESS_AND_DRAG": "Mover (presionar y arrastrar)",
|
"MOVE_PRESS_AND_DRAG": "Mover (presionar y arrastrar)",
|
||||||
"OPACITY": "Opacidad",
|
"OPACITY": "Opacidad",
|
||||||
"POSITIONING": "Posicionamiento",
|
"POSITIONING": "Posicionamiento",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"HINT_POINT_WINDOW": "ウィンドウをタップしてそのパラメータを変更します。\n完了したら、右側のボタンで編集モードを終了してください。",
|
"HINT_POINT_WINDOW": "ウィンドウをタップしてそのパラメータを変更します。\n完了したら、右側のボタンで編集モードを終了してください。",
|
||||||
"LEAVE": "編集モードを終了",
|
"LEAVE": "編集モードを終了",
|
||||||
"LOCK_INTERACTION": "インタラクションをロック",
|
"LOCK_INTERACTION": "インタラクションをロック",
|
||||||
|
"DISABLE_GRAB": "グラブを無効化",
|
||||||
"MOVE_PRESS_AND_DRAG": "移動(押してドラッグ)",
|
"MOVE_PRESS_AND_DRAG": "移動(押してドラッグ)",
|
||||||
"OPACITY": "不透明度",
|
"OPACITY": "不透明度",
|
||||||
"POSITIONING": "位置調整",
|
"POSITIONING": "位置調整",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"HINT_POINT_WINDOW": "Wskaż na okno, aby zmienić jego parametry.\nPo zakończeniu wyjdź z trybu edycji za pomocą przycisku po prawej stronie.",
|
"HINT_POINT_WINDOW": "Wskaż na okno, aby zmienić jego parametry.\nPo zakończeniu wyjdź z trybu edycji za pomocą przycisku po prawej stronie.",
|
||||||
"LEAVE": "Wyjdź z trybu edycji",
|
"LEAVE": "Wyjdź z trybu edycji",
|
||||||
"LOCK_INTERACTION": "Zablokuj interakcję",
|
"LOCK_INTERACTION": "Zablokuj interakcję",
|
||||||
|
"DISABLE_GRAB": "Wyłącz chwytanie",
|
||||||
"MOVE_PRESS_AND_DRAG": "Przesuń (naciśnij i przeciągnij)",
|
"MOVE_PRESS_AND_DRAG": "Przesuń (naciśnij i przeciągnij)",
|
||||||
"OPACITY": "Przezroczystość",
|
"OPACITY": "Przezroczystość",
|
||||||
"POSITIONING": "Pozycjonowanie",
|
"POSITIONING": "Pozycjonowanie",
|
||||||
|
|||||||
@@ -251,6 +251,17 @@ fn make_edit_panel(app: &mut AppState) -> anyhow::Result<EditModeWrapPanel> {
|
|||||||
.enqueue(TaskType::Overlay(OverlayTask::Modify(sel, task)));
|
.enqueue(TaskType::Overlay(OverlayTask::Modify(sel, task)));
|
||||||
Ok(EventResult::Consumed)
|
Ok(EventResult::Consumed)
|
||||||
}),
|
}),
|
||||||
|
"::EditModeToggleGrab" => Box::new(move |_common, _data, app, state| {
|
||||||
|
let sel = OverlaySelector::Id(*state.id.borrow());
|
||||||
|
app.tasks.enqueue(TaskType::Overlay(OverlayTask::Modify(
|
||||||
|
sel,
|
||||||
|
Box::new(|_app, owc| {
|
||||||
|
let state = owc.active_state.as_mut().unwrap(); //want panic
|
||||||
|
state.grabbable = !state.grabbable;
|
||||||
|
}),
|
||||||
|
)));
|
||||||
|
Ok(EventResult::Consumed)
|
||||||
|
}),
|
||||||
"::EditModeTab" => {
|
"::EditModeTab" => {
|
||||||
let tab_name = args.next().unwrap().to_owned();
|
let tab_name = args.next().unwrap().to_owned();
|
||||||
Box::new(move |common, _data, _app, state| {
|
Box::new(move |common, _data, _app, state| {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use std::{collections::HashMap, rc::Rc};
|
use std::{collections::HashMap, rc::Rc};
|
||||||
|
|
||||||
use glam::{vec2, vec3, Affine3A, FloatExt, Mat4, Quat, Vec2, Vec3};
|
use glam::{Affine3A, FloatExt, Mat4, Quat, Vec2, Vec3, vec2, vec3};
|
||||||
use wgui::{
|
use wgui::{
|
||||||
animation::{Animation, AnimationEasing},
|
animation::{Animation, AnimationEasing},
|
||||||
assets::AssetPath,
|
assets::AssetPath,
|
||||||
@@ -11,10 +11,10 @@ use wgui::{
|
|||||||
renderer_vk::util,
|
renderer_vk::util,
|
||||||
taffy::{self, prelude::length},
|
taffy::{self, prelude::length},
|
||||||
widget::{
|
widget::{
|
||||||
|
EventResult,
|
||||||
div::WidgetDiv,
|
div::WidgetDiv,
|
||||||
rectangle::{WidgetRectangle, WidgetRectangleParams},
|
rectangle::{WidgetRectangle, WidgetRectangleParams},
|
||||||
util::WLength,
|
util::WLength,
|
||||||
EventResult,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use wlx_common::windowing::{OverlayWindowState, Positioning};
|
use wlx_common::windowing::{OverlayWindowState, Positioning};
|
||||||
@@ -22,14 +22,14 @@ use wlx_common::windowing::{OverlayWindowState, Positioning};
|
|||||||
use crate::{
|
use crate::{
|
||||||
gui::panel::GuiPanel,
|
gui::panel::GuiPanel,
|
||||||
state::AppState,
|
state::AppState,
|
||||||
subsystem::hid::{XkbKeymap, ALT, CTRL, META, SHIFT, SUPER},
|
subsystem::hid::{ALT, CTRL, META, SHIFT, SUPER, XkbKeymap},
|
||||||
windowing::window::OverlayWindowConfig,
|
windowing::window::OverlayWindowConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
handle_press, handle_release,
|
KEYBOARD_NAME, KeyButtonData, KeyState, KeyboardBackend, KeyboardState, handle_press,
|
||||||
|
handle_release,
|
||||||
layout::{self, AltModifier, KeyCapType},
|
layout::{self, AltModifier, KeyCapType},
|
||||||
KeyButtonData, KeyState, KeyboardBackend, KeyboardState, KEYBOARD_NAME,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const BACKGROUND_PADDING: f32 = 16.0;
|
const BACKGROUND_PADDING: f32 = 16.0;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use std::{f32::consts::PI, sync::Arc};
|
use std::{f32::consts::PI, sync::Arc};
|
||||||
|
|
||||||
use glam::{vec3, Affine3A, Quat, Vec3};
|
use glam::{Affine3A, Quat, Vec3, vec3};
|
||||||
use wlx_capture::frame::Transform;
|
use wlx_capture::frame::Transform;
|
||||||
use wlx_common::windowing::{OverlayWindowState, Positioning};
|
use wlx_common::windowing::{OverlayWindowState, Positioning};
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ impl<T> OverlayWindowManager<T> {
|
|||||||
let Some(o) = self.get_by_id(*oid) else {
|
let Some(o) = self.get_by_id(*oid) else {
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
let Some(mut state) = o.config.active_state.clone() else {
|
let Some(state) = o.config.active_state.clone() else {
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
app.session
|
app.session
|
||||||
@@ -489,7 +489,7 @@ impl<T> OverlayWindowManager<T> {
|
|||||||
|
|
||||||
if !global {
|
if !global {
|
||||||
for (i, set) in self.sets.iter_mut().enumerate() {
|
for (i, set) in self.sets.iter_mut().enumerate() {
|
||||||
let Some(mut state) = set.inactive_overlays.arc_rm(&name) else {
|
let Some(state) = set.inactive_overlays.arc_rm(&name) else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
if self.current_set == Some(i) {
|
if self.current_set == Some(i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user