From a7bb7bb2eaaae5a016721788fcaf03c4c7413acd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 1 Jan 2021 15:28:38 +0100 Subject: Implement split highlight on hover for `PaneGrid` --- glow/src/widget/pane_grid.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'glow') diff --git a/glow/src/widget/pane_grid.rs b/glow/src/widget/pane_grid.rs index c26dde48..44f9201c 100644 --- a/glow/src/widget/pane_grid.rs +++ b/glow/src/widget/pane_grid.rs @@ -9,9 +9,9 @@ //! [`pane_grid` example]: https://github.com/hecrj/iced/tree/0.2/examples/pane_grid use crate::Renderer; -pub use iced_native::pane_grid::{ - Axis, Configuration, Direction, DragEvent, Node, Pane, ResizeEvent, Split, - State, +pub use iced_graphics::pane_grid::{ + Axis, Configuration, Direction, DragEvent, Line, Node, Pane, ResizeEvent, + Split, State, StyleSheet, }; /// A collection of panes distributed using either vertical or horizontal splits -- cgit From ec20763aef242bfa52f1d1afb910d36c903343dc Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 16 Feb 2021 00:04:36 +0100 Subject: Use string literal as panic message in `iced_glow` --- glow/src/program.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glow') diff --git a/glow/src/program.rs b/glow/src/program.rs index 489a194f..601f9ce6 100644 --- a/glow/src/program.rs +++ b/glow/src/program.rs @@ -17,7 +17,7 @@ pub unsafe fn create( gl.compile_shader(shader); if !gl.get_shader_compile_status(shader) { - panic!(gl.get_shader_info_log(shader)); + panic!("{}", gl.get_shader_info_log(shader)); } gl.attach_shader(program, shader); @@ -27,7 +27,7 @@ pub unsafe fn create( gl.link_program(program); if !gl.get_program_link_status(program) { - panic!(gl.get_program_info_log(program)); + panic!("{}", gl.get_program_info_log(program)); } for shader in shaders { -- cgit From 9d4996cbab012559c73852145b9968f6b101663a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 23 Feb 2021 03:18:47 +0100 Subject: Export `Tooltip` in `iced_glow` --- glow/src/widget.rs | 3 +++ glow/src/widget/tooltip.rs | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 glow/src/widget/tooltip.rs (limited to 'glow') diff --git a/glow/src/widget.rs b/glow/src/widget.rs index b5c84c56..5481216a 100644 --- a/glow/src/widget.rs +++ b/glow/src/widget.rs @@ -20,6 +20,7 @@ pub mod rule; pub mod scrollable; pub mod slider; pub mod text_input; +pub mod tooltip; #[doc(no_inline)] pub use button::Button; @@ -43,6 +44,8 @@ pub use scrollable::Scrollable; pub use slider::Slider; #[doc(no_inline)] pub use text_input::TextInput; +#[doc(no_inline)] +pub use tooltip::Tooltip; #[cfg(feature = "canvas")] #[cfg_attr(docsrs, doc(cfg(feature = "canvas")))] diff --git a/glow/src/widget/tooltip.rs b/glow/src/widget/tooltip.rs new file mode 100644 index 00000000..89ab3a15 --- /dev/null +++ b/glow/src/widget/tooltip.rs @@ -0,0 +1,6 @@ +//! Display a widget over another. +/// A widget allowing the selection of a single value from a list of options. +pub type Tooltip<'a, Message> = + iced_native::Tooltip<'a, Message, crate::Renderer>; + +pub use iced_native::tooltip::Position; -- cgit From 883c7e71ae699a29c23b8f95b7335d015e5a985d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 25 Mar 2021 11:27:31 +0100 Subject: Introduce `internal_backend` to `iced_wgpu::Settings` --- glow/src/settings.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'glow') diff --git a/glow/src/settings.rs b/glow/src/settings.rs index 524d91a9..8477eb57 100644 --- a/glow/src/settings.rs +++ b/glow/src/settings.rs @@ -29,3 +29,12 @@ impl Default for Settings { } } } + +impl Settings { + /// Creates new [`Settings`] using environment configuration. + /// + /// Currently, this is equivalent to calling [`Settings::default`]. + pub fn from_env() -> Self { + Self::default() + } +} -- cgit From 0864e63bde129b95261590b960efdc46c6d2d4d0 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 31 Mar 2021 20:06:03 +0200 Subject: Bump versions :tada: --- glow/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'glow') diff --git a/glow/Cargo.toml b/glow/Cargo.toml index 3f85e52d..e40b8ba8 100644 --- a/glow/Cargo.toml +++ b/glow/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iced_glow" -version = "0.1.0" +version = "0.2.0" authors = ["Héctor Ramón Jiménez "] edition = "2018" description = "A glow renderer for iced" @@ -24,11 +24,11 @@ bytemuck = "1.4" log = "0.4" [dependencies.iced_native] -version = "0.3" +version = "0.4" path = "../native" [dependencies.iced_graphics] -version = "0.1" +version = "0.2" path = "../graphics" features = ["font-fallback", "font-icons", "opengl"] -- cgit From 88da268724527e1b41c303ebec9056a606a01486 Mon Sep 17 00:00:00 2001 From: Kaiden42 Date: Sat, 19 Sep 2020 20:16:36 +0200 Subject: add missing glow support --- glow/src/widget.rs | 3 +++ glow/src/widget/toggler.rs | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 glow/src/widget/toggler.rs (limited to 'glow') diff --git a/glow/src/widget.rs b/glow/src/widget.rs index 5481216a..a77511e8 100644 --- a/glow/src/widget.rs +++ b/glow/src/widget.rs @@ -20,6 +20,7 @@ pub mod rule; pub mod scrollable; pub mod slider; pub mod text_input; +pub mod toggler; pub mod tooltip; #[doc(no_inline)] @@ -45,6 +46,8 @@ pub use slider::Slider; #[doc(no_inline)] pub use text_input::TextInput; #[doc(no_inline)] +pub use toggler::Toggler; +#[doc(no_inline)] pub use tooltip::Tooltip; #[cfg(feature = "canvas")] diff --git a/glow/src/widget/toggler.rs b/glow/src/widget/toggler.rs new file mode 100644 index 00000000..0bd5b758 --- /dev/null +++ b/glow/src/widget/toggler.rs @@ -0,0 +1,9 @@ +//! Show toggle controls using togglers. +use crate::Renderer; + +pub use iced_graphics::toggler::{Style, StyleSheet}; + +/// A toggler that can be toggled. +/// +/// This is an alias of an `iced_native` checkbox with an `iced_wgpu::Renderer`. +pub type Toggler = iced_native::Toggler; \ No newline at end of file -- cgit From bab71971fb6653c81e74a517c9ace93be63b49fc Mon Sep 17 00:00:00 2001 From: Kaiden42 Date: Sat, 19 Sep 2020 20:20:14 +0200 Subject: fix format --- glow/src/widget/toggler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glow') diff --git a/glow/src/widget/toggler.rs b/glow/src/widget/toggler.rs index 0bd5b758..1cd8711b 100644 --- a/glow/src/widget/toggler.rs +++ b/glow/src/widget/toggler.rs @@ -4,6 +4,6 @@ use crate::Renderer; pub use iced_graphics::toggler::{Style, StyleSheet}; /// A toggler that can be toggled. -/// +/// /// This is an alias of an `iced_native` checkbox with an `iced_wgpu::Renderer`. -pub type Toggler = iced_native::Toggler; \ No newline at end of file +pub type Toggler = iced_native::Toggler; -- cgit From 6469e463cd1f99190c6eba4701d4c1059934d3ee Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Mon, 14 Jun 2021 18:06:28 +0300 Subject: feat: expose draw_cache_multithread --- glow/Cargo.toml | 1 + glow/src/text.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'glow') diff --git a/glow/Cargo.toml b/glow/Cargo.toml index e40b8ba8..f5934f8f 100644 --- a/glow/Cargo.toml +++ b/glow/Cargo.toml @@ -11,6 +11,7 @@ repository = "https://github.com/hecrj/iced" canvas = ["iced_graphics/canvas"] qr_code = ["iced_graphics/qr_code"] default_system_font = ["iced_graphics/font-source"] +glyph_draw_cache_multithread = [] # Not supported yet! image = [] svg = [] diff --git a/glow/src/text.rs b/glow/src/text.rs index 925c7287..7c9574a2 100644 --- a/glow/src/text.rs +++ b/glow/src/text.rs @@ -41,7 +41,9 @@ impl Pipeline { let draw_brush = glow_glyph::GlyphBrushBuilder::using_font(font.clone()) .initial_cache_size((2048, 2048)) - .draw_cache_multithread(false) // TODO: Expose as a configuration flag + .draw_cache_multithread(cfg!( + feature = "glyph_draw_cache_multithread" + )) .build(&gl); let measure_brush = -- cgit From 83d19689c80266874e0a26085f17a94fd3507e1e Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Mon, 14 Jun 2021 21:01:37 +0300 Subject: docs: update all 0.2 github links to 0.3 --- glow/src/widget/pane_grid.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'glow') diff --git a/glow/src/widget/pane_grid.rs b/glow/src/widget/pane_grid.rs index 44f9201c..fc36862c 100644 --- a/glow/src/widget/pane_grid.rs +++ b/glow/src/widget/pane_grid.rs @@ -6,7 +6,7 @@ //! The [`pane_grid` example] showcases how to use a [`PaneGrid`] with resizing, //! drag and drop, and hotkey support. //! -//! [`pane_grid` example]: https://github.com/hecrj/iced/tree/0.2/examples/pane_grid +//! [`pane_grid` example]: https://github.com/hecrj/iced/tree/0.3/examples/pane_grid use crate::Renderer; pub use iced_graphics::pane_grid::{ -- cgit From 217f5be8272f48a5b043d066ed1788cc127e1164 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 22 Jul 2021 18:21:50 +0700 Subject: Add `text_multithreading` to `Settings` in `iced_glow` and `iced_wgpu` --- glow/Cargo.toml | 1 - glow/src/backend.rs | 7 ++++++- glow/src/settings.rs | 5 +++++ glow/src/text.rs | 10 ++++++---- 4 files changed, 17 insertions(+), 6 deletions(-) (limited to 'glow') diff --git a/glow/Cargo.toml b/glow/Cargo.toml index f5934f8f..e40b8ba8 100644 --- a/glow/Cargo.toml +++ b/glow/Cargo.toml @@ -11,7 +11,6 @@ repository = "https://github.com/hecrj/iced" canvas = ["iced_graphics/canvas"] qr_code = ["iced_graphics/qr_code"] default_system_font = ["iced_graphics/font-source"] -glyph_draw_cache_multithread = [] # Not supported yet! image = [] svg = [] diff --git a/glow/src/backend.rs b/glow/src/backend.rs index 92bb993e..1680fc00 100644 --- a/glow/src/backend.rs +++ b/glow/src/backend.rs @@ -24,7 +24,12 @@ pub struct Backend { impl Backend { /// Creates a new [`Backend`]. pub fn new(gl: &glow::Context, settings: Settings) -> Self { - let text_pipeline = text::Pipeline::new(gl, settings.default_font); + let text_pipeline = text::Pipeline::new( + gl, + settings.default_font, + settings.text_multithreading, + ); + let quad_pipeline = quad::Pipeline::new(gl); let triangle_pipeline = triangle::Pipeline::new(gl); diff --git a/glow/src/settings.rs b/glow/src/settings.rs index 8477eb57..cf8e891f 100644 --- a/glow/src/settings.rs +++ b/glow/src/settings.rs @@ -16,6 +16,10 @@ pub struct Settings { /// By default, it will be set to 20. pub default_text_size: u16, + /// If enabled, spread text workload in multiple threads when multiple cores + /// are available. + pub text_multithreading: bool, + /// The antialiasing strategy that will be used for triangle primitives. pub antialiasing: Option, } @@ -25,6 +29,7 @@ impl Default for Settings { Settings { default_font: None, default_text_size: 20, + text_multithreading: false, antialiasing: None, } } diff --git a/glow/src/text.rs b/glow/src/text.rs index 7c9574a2..a4c39dfe 100644 --- a/glow/src/text.rs +++ b/glow/src/text.rs @@ -11,7 +11,11 @@ pub struct Pipeline { } impl Pipeline { - pub fn new(gl: &glow::Context, default_font: Option<&[u8]>) -> Self { + pub fn new( + gl: &glow::Context, + default_font: Option<&[u8]>, + multithreading: bool, + ) -> Self { let default_font = default_font.map(|slice| slice.to_vec()); // TODO: Font customization @@ -41,9 +45,7 @@ impl Pipeline { let draw_brush = glow_glyph::GlyphBrushBuilder::using_font(font.clone()) .initial_cache_size((2048, 2048)) - .draw_cache_multithread(cfg!( - feature = "glyph_draw_cache_multithread" - )) + .draw_cache_multithread(multithreading) .build(&gl); let measure_brush = -- cgit From 357a8a95c9820651110fe4d80d8d33a2678827c0 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 22 Jul 2021 18:27:33 +0700 Subject: Introduce `text_multithreading` to `Settings` --- glow/src/settings.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'glow') diff --git a/glow/src/settings.rs b/glow/src/settings.rs index cf8e891f..f3dddfaf 100644 --- a/glow/src/settings.rs +++ b/glow/src/settings.rs @@ -18,9 +18,13 @@ pub struct Settings { /// If enabled, spread text workload in multiple threads when multiple cores /// are available. + /// + /// By default, it is disabled. pub text_multithreading: bool, /// The antialiasing strategy that will be used for triangle primitives. + /// + /// By default, it is `None`. pub antialiasing: Option, } -- cgit