refactor: move projects into a workspace

This commit is contained in:
Ashley Wulber 2022-12-23 15:14:15 -05:00 committed by Ashley Wulber
parent 2a417a9156
commit a1aa87f5bd
29 changed files with 1105 additions and 28224 deletions

File diff suppressed because it is too large Load diff

View file

@ -10,28 +10,9 @@ libpulse-binding = "2.26.0"
libpulse-glib-binding = "2.25.0"
tokio = { version = "1.20.1", features=["full"] }
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
iced_sctk = { git = "https://github.com/pop-os/iced-sctk" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", version = "0.16" }
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
nix = "0.24.1"
[workspace]
resolved = "2"
[dependencies.iced]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
# path = "../iced"
default-features = false
features = ["image", "svg", "tokio", "wayland"]
[dependencies.iced_native]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
[dependencies.iced_futures]
git = "https://github.com/pop-os/iced.git"
branch = "sctk-cosmic"
# Until the 3.6.3 release, need the implementation of clone on zbus::Error
[dependencies.zbus]
git = "https://gitlab.freedesktop.org/dbus/zbus"

View file

@ -1,8 +1,11 @@
use std::process;
use iced::widget::Space;
use cosmic::applet::CosmicAppletHelper;
use cosmic::iced::wayland::SurfaceIdWrapper;
use cosmic::iced::wayland::popup::{get_popup, destroy_popup};
use cosmic::iced::widget::{self, Row};
use cosmic::iced_native::widget::Space;
use cosmic::widget::{horizontal_rule, icon};
use cosmic::Renderer;
@ -12,15 +15,10 @@ use cosmic::iced::{
window, Alignment, Application, Command, Length, Subscription,
};
use cosmic::iced_style::application::{self, Appearance};
use cosmic::iced_style::svg;
use cosmic::iced_style::{svg, Color};
use cosmic::theme::{self, Svg};
use cosmic::{Element, Theme};
use iced_sctk::application::SurfaceIdWrapper;
use iced_sctk::commands::popup::{destroy_popup, get_popup};
use iced_sctk::widget::Row;
use iced_sctk::Color;
use logind_zbus::manager::ManagerProxy;
use logind_zbus::session::{SessionProxy, SessionType};
use logind_zbus::user::UserProxy;
@ -84,7 +82,7 @@ impl Application for Power {
self.theme
}
fn close_requested(&self, _id: iced_sctk::application::SurfaceIdWrapper) -> Self::Message {
fn close_requested(&self, _id: SurfaceIdWrapper) -> Self::Message {
Message::Ignore
}
@ -196,7 +194,7 @@ impl Application for Power {
// ### UI Helplers
// todo put into libcosmic doing so will fix the row_button's boarder radius
fn row_button(mut content: Vec<Element<Message>>) -> iced_sctk::widget::Button<Message, Renderer> {
fn row_button(mut content: Vec<Element<Message>>) -> widget::Button<Message, Renderer> {
content.insert(0, Space::with_width(Length::Units(24)).into());
content.push(Space::with_width(Length::Units(24)).into());
@ -213,7 +211,7 @@ fn row_button(mut content: Vec<Element<Message>>) -> iced_sctk::widget::Button<M
fn power_buttons<'a>(
name: &'a str,
text: &'a str,
) -> iced_sctk::widget::Button<'a, Message, Renderer> {
) -> widget::Button<'a, Message, Renderer> {
button(
column![text_icon(name, 40), text]
.spacing(5)
@ -226,7 +224,7 @@ fn power_buttons<'a>(
fn text_icon(name: &str, size: u16) -> cosmic::widget::Icon {
icon(name, size).style(Svg::Custom(|theme| svg::Appearance {
fill: Some(theme.palette().text),
color: Some(theme.palette().text),
}))
}