merge workspaces_dev
This commit is contained in:
commit
74f6c2eca6
22 changed files with 1275 additions and 155 deletions
|
|
@ -21,8 +21,8 @@ glib::wrapper! {
|
|||
|
||||
impl CosmicAppListWindow {
|
||||
pub fn new(app: >k4::Application, tx: mpsc::Sender<Event>) -> Self {
|
||||
let self_: Self = Object::new(&[("application", app)])
|
||||
.expect("Failed to create `CosmicAppListWindow`.");
|
||||
let self_: Self =
|
||||
Object::new(&[("application", app)]).expect("Failed to create `CosmicAppListWindow`.");
|
||||
let imp = imp::CosmicAppListWindow::from_instance(&self_);
|
||||
|
||||
cascade! {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,6 @@ impl DockItem {
|
|||
PanelAnchor::Top => PositionType::Bottom,
|
||||
PanelAnchor::Bottom => PositionType::Top,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
pub fn add_popover(&self, obj: &DockObject) {
|
||||
|
|
|
|||
|
|
@ -49,16 +49,19 @@ impl DockObject {
|
|||
|
||||
pub fn get_name(&self) -> Option<String> {
|
||||
let imp = imp::DockObject::from_instance(self);
|
||||
imp.appinfo.borrow().as_ref().map(|app_info| app_info.name().to_string())
|
||||
imp.appinfo
|
||||
.borrow()
|
||||
.as_ref()
|
||||
.map(|app_info| app_info.name().to_string())
|
||||
}
|
||||
|
||||
pub fn get_image(&self) -> gtk4::Image {
|
||||
let imp = imp::DockObject::from_instance(self);
|
||||
if let Some(app_info) = imp.appinfo.borrow().as_ref() {
|
||||
let image = Image::new();
|
||||
let icon = app_info
|
||||
.icon()
|
||||
.unwrap_or_else(|| Icon::for_string("image-missing").expect("Failed to set default icon"));
|
||||
let icon = app_info.icon().unwrap_or_else(|| {
|
||||
Icon::for_string("image-missing").expect("Failed to set default icon")
|
||||
});
|
||||
image.set_from_gicon(&icon);
|
||||
image.set_tooltip_text(None);
|
||||
image
|
||||
|
|
|
|||
|
|
@ -82,8 +82,6 @@ fn main() {
|
|||
// .expect("Failed to close selected window");
|
||||
}
|
||||
Event::Favorite((name, should_favorite)) => {
|
||||
dbg!(&name);
|
||||
dbg!(should_favorite);
|
||||
let saved_app_model = apps_container.model(DockListType::Saved);
|
||||
let active_app_model = apps_container.model(DockListType::Active);
|
||||
if should_favorite {
|
||||
|
|
@ -128,7 +126,7 @@ fn main() {
|
|||
let cached_results = cached_results.as_ref().lock().unwrap();
|
||||
let stack_active = cached_results.iter().fold(
|
||||
BTreeMap::new(),
|
||||
|mut acc: BTreeMap<String, BoxedWindowList>, elem:&Item| {
|
||||
|mut acc: BTreeMap<String, BoxedWindowList>, elem: &Item| {
|
||||
if let Some(v) = acc.get_mut(&elem.description) {
|
||||
v.0.push(elem.clone());
|
||||
} else {
|
||||
|
|
@ -164,11 +162,7 @@ fn main() {
|
|||
// );
|
||||
let active = stack_active.remove(i);
|
||||
dock_obj.set_property("active", active.to_value());
|
||||
saved_app_model.items_changed(
|
||||
saved_i,
|
||||
0,
|
||||
0,
|
||||
);
|
||||
saved_app_model.items_changed(saved_i, 0, 0);
|
||||
} else if cached_results
|
||||
.iter()
|
||||
.any(|s| s.description == cur_app_info.name())
|
||||
|
|
@ -177,11 +171,7 @@ fn main() {
|
|||
"active",
|
||||
BoxedWindowList(Vec::new()).to_value(),
|
||||
);
|
||||
saved_app_model.items_changed(
|
||||
saved_i,
|
||||
0,
|
||||
0,
|
||||
);
|
||||
saved_app_model.items_changed(saved_i, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -236,11 +226,7 @@ fn main() {
|
|||
// println!("found active saved app {} at {}", s.0[0].name, i);
|
||||
let active = stack_active.remove(i);
|
||||
dock_obj.set_property("active", active.to_value());
|
||||
saved_app_model.items_changed(
|
||||
saved_i,
|
||||
0,
|
||||
0,
|
||||
);
|
||||
saved_app_model.items_changed(saved_i, 0, 0);
|
||||
} else if results
|
||||
.iter()
|
||||
.any(|s| s.description == cur_app_info.name())
|
||||
|
|
@ -249,11 +235,7 @@ fn main() {
|
|||
"active",
|
||||
BoxedWindowList(Vec::new()).to_value(),
|
||||
);
|
||||
saved_app_model.items_changed(
|
||||
saved_i,
|
||||
0,
|
||||
0,
|
||||
);
|
||||
saved_app_model.items_changed(saved_i, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue