move add_display::View -> add_window::View & display_options::View -> window_options::VIew, remove displays logic and replace it with window ones

[skip ci]
This commit is contained in:
Aleksander
2025-12-25 14:57:10 +01:00
parent 7cde2f8c42
commit ccf72b16c5
27 changed files with 293 additions and 770 deletions
+4
View File
@@ -14,6 +14,7 @@ use wgui::{
taffy::Display,
widget::label::WidgetLabel,
};
use wlx_common::dash_interface::BoxDashInterface;
use crate::{
frontend::{FrontendTask, FrontendTasks},
@@ -60,6 +61,7 @@ pub struct PopupContentFuncData<'a> {
pub layout: &'a mut Layout,
pub settings: &'a dyn SettingsIO,
pub handle: PopupHandle,
pub interface: &'a mut BoxDashInterface,
pub id_content: WidgetID,
}
@@ -125,6 +127,7 @@ impl PopupManager {
globals: WguiGlobals,
settings: &dyn SettingsIO,
layout: &mut Layout,
interface: &mut BoxDashInterface,
frontend_tasks: FrontendTasks,
params: MountPopupParams,
) -> anyhow::Result<()> {
@@ -181,6 +184,7 @@ impl PopupManager {
handle: popup_handle.clone(),
id_content,
settings,
interface,
})?;
Ok(())
-19
View File
@@ -1,6 +1,4 @@
use std::{path::PathBuf, str::FromStr};
use wayvr_ipc::packet_server;
use wgui::{
assets::{AssetPath, AssetPathOwned},
globals::WguiGlobals,
@@ -13,7 +11,6 @@ use wgui::{
sprite::{WidgetSprite, WidgetSpriteParams},
},
};
use wlx_common::dash_interface::BoxDashInterface;
use crate::util::desktop_finder;
@@ -33,22 +30,6 @@ pub fn get_desktop_file_icon_path(desktop_file: &desktop_finder::DesktopFile) ->
AssetPathOwned::BuiltIn(PathBuf::from_str("dashboard/terminal.svg").unwrap())
}
pub fn get_all_windows(interface: &mut BoxDashInterface) -> anyhow::Result<Vec<packet_server::WvrWindow>> {
let mut windows = Vec::<packet_server::WvrWindow>::new();
for display in interface.display_list()? {
let Ok(window_list) = interface.display_window_list(display.handle) else {
continue;
};
for window in window_list {
windows.push(window)
}
}
Ok(windows)
}
pub fn mount_simple_label(
globals: &WguiGlobals,
layout: &mut Layout,