feat: use libcosmic::init

This commit is contained in:
Ashley Wulber 2022-08-16 14:36:31 -04:00
parent a96decd24b
commit 98813824d4
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
37 changed files with 396 additions and 295 deletions

View file

@ -9,6 +9,7 @@ cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bi
futures-util = "0.3.21"
gtk4 = { git = "https://github.com/gtk-rs/gtk4-rs" }
adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita"}
libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = ["widgets"] }
itertools = "0.10.3"
once_cell = "1.9.0"
relm4-macros = { git = "https://github.com/Relm4/Relm4.git", branch = "next" }
@ -16,4 +17,3 @@ slotmap = "1.0.6"
tokio = { version = "1.15.0", features = ["full"] }
zbus = "2.0.1"
libcosmic-applet = { path = "../../libcosmic-applet" }
libcosmic-widgets = { git = "https://github.com/pop-os/libcosmic", branch = "relm4-next" }

View file

@ -14,15 +14,14 @@ use tokio::runtime::Runtime;
static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build tokio runtime"));
fn main() {
let _ = gtk4::init();
adw::init();
let _ = libcosmic::init();
view! {
window = libcosmic_applet::AppletWindow {
set_title: Some("COSMIC Network Applet"),
#[wrap(Some)]
set_child: button = &libcosmic_applet::AppletButton {
set_button_icon_name: "preferences-system-network",
set_button_icon_name: "network-workgroup-symbolic",
#[wrap(Some)]
set_popover_child: main_box = &gtk4::Box {
set_orientation: Orientation::Vertical,

View file

@ -11,7 +11,7 @@ use gtk4::{
prelude::*,
Image, ListBox, ListBoxRow, Separator,
};
use libcosmic_widgets::{relm4::RelmContainerExt, LabeledItem};
use libcosmic::widgets::{relm4::RelmContainerExt, LabeledItem};
use std::{
cell::RefCell,
collections::{BTreeMap, HashMap},