adjust default screen position to be lower

This commit is contained in:
galister
2025-12-13 21:13:11 +09:00
parent 8969a76cd2
commit 6793a163af
2 changed files with 8 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
use std::{collections::HashMap, rc::Rc}; use std::{collections::HashMap, rc::Rc};
use glam::{Affine3A, FloatExt, Mat4, Quat, Vec2, Vec3, vec2, vec3}; use glam::{vec2, vec3, Affine3A, FloatExt, Mat4, Quat, 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::{ALT, CTRL, META, SHIFT, SUPER, XkbKeymap}, subsystem::hid::{XkbKeymap, ALT, CTRL, META, SHIFT, SUPER},
windowing::window::OverlayWindowConfig, windowing::window::OverlayWindowConfig,
}; };
use super::{ use super::{
KEYBOARD_NAME, KeyButtonData, KeyState, KeyboardBackend, KeyboardState, handle_press, handle_press, handle_release,
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;
@@ -285,7 +285,7 @@ pub fn create_keyboard(
transform: Affine3A::from_scale_rotation_translation( transform: Affine3A::from_scale_rotation_translation(
Vec3::ONE * width, Vec3::ONE * width,
Quat::from_rotation_x(-10f32.to_radians()), Quat::from_rotation_x(-10f32.to_radians()),
vec3(0.0, -0.5, -0.5), vec3(0.0, -0.65, -0.5),
), ),
..OverlayWindowState::default() ..OverlayWindowState::default()
}, },

View File

@@ -1,6 +1,6 @@
use std::{f32::consts::PI, sync::Arc}; use std::{f32::consts::PI, sync::Arc};
use glam::{Affine3A, Quat, Vec3, vec3}; use glam::{vec3, Affine3A, Quat, Vec3};
use wlx_capture::frame::Transform; use wlx_capture::frame::Transform;
use wlx_common::windowing::{OverlayWindowState, Positioning}; use wlx_common::windowing::{OverlayWindowState, Positioning};
@@ -50,7 +50,7 @@ fn create_screen_from_backend(
transform: Affine3A::from_scale_rotation_translation( transform: Affine3A::from_scale_rotation_translation(
Vec3::ONE * 1.5 * session.config.desktop_view_scale, Vec3::ONE * 1.5 * session.config.desktop_view_scale,
Quat::from_rotation_z(angle), Quat::from_rotation_z(angle),
vec3(0.0, 0.2, -0.5), vec3(0.0, 0.0, -0.5),
), ),
..OverlayWindowState::default() ..OverlayWindowState::default()
}, },