fix: open launcher editor in existing popup
This commit is contained in:
parent
cc501c7637
commit
339ac4e3e4
1 changed files with 3 additions and 39 deletions
|
|
@ -1265,11 +1265,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
let Some(exec) = dock_item.desktop_info.exec() else {
|
||||
return Task::none();
|
||||
};
|
||||
let Some(existing_popup) = self.popup.take() else {
|
||||
return Task::none();
|
||||
};
|
||||
let Some(rectangle) = self.rectangles.get(&dock_item.id.into()) else {
|
||||
self.popup = Some(existing_popup);
|
||||
let Some(existing_popup) = self.popup.as_mut() else {
|
||||
return Task::none();
|
||||
};
|
||||
|
||||
|
|
@ -1303,40 +1299,8 @@ impl cosmic::Application for CosmicAppList {
|
|||
error: None,
|
||||
});
|
||||
|
||||
let new_id = window::Id::unique();
|
||||
let mut popup_settings = self.core.applet.get_popup_settings(
|
||||
existing_popup.parent,
|
||||
new_id,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
let iced::Rectangle {
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
} = *rectangle;
|
||||
popup_settings.positioner.anchor_rect = iced::Rectangle::<i32> {
|
||||
x: x as i32,
|
||||
y: y as i32,
|
||||
width: width as i32,
|
||||
height: height as i32,
|
||||
};
|
||||
popup_settings.positioner.size_limits = Limits::NONE
|
||||
.min_width(480.)
|
||||
.min_height(1.)
|
||||
.max_width(520.)
|
||||
.max_height(1000.);
|
||||
|
||||
self.popup = Some(Popup {
|
||||
parent: existing_popup.parent,
|
||||
id: new_id,
|
||||
dock_item,
|
||||
popup_type: PopupType::LauncherEditor,
|
||||
});
|
||||
|
||||
return Task::batch([destroy_popup(existing_popup.id), get_popup(popup_settings)]);
|
||||
existing_popup.dock_item = dock_item;
|
||||
existing_popup.popup_type = PopupType::LauncherEditor;
|
||||
}
|
||||
Message::LauncherNameChanged(name) => {
|
||||
if let Some(edit) = self.launcher_edit.as_mut()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue