Skip to content

Commit

Permalink
Remove use GTK optional feature
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroxymat committed Apr 12, 2020
1 parent 3ffe5e4 commit 5e16e6b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion druid-shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ categories = ["os::macos-apis", "os::windows-apis", "gui"]
edition = "2018"

[features]
use_gtk = ["gtk", "gtk-sys", "gio", "gdk", "gdk-sys", "glib", "glib-sys", "cairo-rs"]
x11 = ["xcb", "cairo-sys-rs"]

[package.metadata.docs.rs]
Expand Down
4 changes: 2 additions & 2 deletions druid-shell/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ impl Application {
// TODO: do these two go in some kind of PlatformExt trait?
/// Hide the application this window belongs to. (cmd+H)
pub fn hide() {
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
#[cfg(target_os = "macos")]
platform::Application::hide()
}

/// Hide all other applications. (cmd+opt+H)
pub fn hide_others() {
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
#[cfg(target_os = "macos")]
platform::Application::hide_others()
}

Expand Down
4 changes: 2 additions & 2 deletions druid-shell/src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl From<platform::Clipboard> for Clipboard {
}

cfg_if::cfg_if! {
if #[cfg(all(target_os = "macos", not(feature = "use_gtk")))] {
if #[cfg(target_os = "macos")] {
impl ClipboardFormat {
pub const PDF: &'static str = "com.adobe.pdf";
pub const TEXT: &'static str = "public.utf8-plain-text";
Expand All @@ -224,7 +224,7 @@ cfg_if::cfg_if! {
} else {
impl ClipboardFormat {
cfg_if::cfg_if! {
if #[cfg(any(feature = "use_gtk", target_os = "linux"))] {
if #[cfg(target_os = "linux")] {
// trial and error; this is the most supported string type for gtk?
pub const TEXT: &'static str = "UTF8_STRING";
} else {
Expand Down
6 changes: 3 additions & 3 deletions druid-shell/src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
//! Platform specific implementations.
cfg_if::cfg_if! {
if #[cfg(all(target_os = "windows", not(feature = "use_gtk")))] {
if #[cfg(target_os = "windows")] {
mod windows;
pub use windows::*;
} else if #[cfg(all(target_os = "macos", not(feature = "use_gtk")))] {
} else if #[cfg(target_os = "macos")] {
mod mac;
pub use mac::*;
} else if #[cfg(all(feature = "x11", target_os = "linux"))] {
mod x11;
pub use x11::*;
} else if #[cfg(any(feature = "use_gtk", target_os = "linux"))] {
} else if #[cfg(target_os = "linux")] {
mod gtk;
pub use self::gtk::*;
}
Expand Down
1 change: 0 additions & 1 deletion druid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ edition = "2018"
default-target = "x86_64-pc-windows-msvc"

[features]
use_gtk = ["druid-shell/use_gtk"]
x11 = ["druid-shell/x11"]
svg = ["usvg"]

Expand Down
4 changes: 2 additions & 2 deletions druid/src/win_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,12 @@ impl<T: Data> AppState<T> {
}

fn hide_app(&self) {
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
#[cfg(target_os = "macos")]
Application::hide()
}

fn hide_others(&mut self) {
#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
#[cfg(target_os = "macos")]
Application::hide_others()
}
}
Expand Down

0 comments on commit 5e16e6b

Please sign in to comment.