From 68035e57fe9dd320eca4f9548297284ef0b8d6ab Mon Sep 17 00:00:00 2001 From: Ilya M Date: Sat, 1 Jul 2023 17:34:43 +0200 Subject: [PATCH] Support custom header buttons layouts (#30) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support custom header buttons layouts * Support custom header buttons layouts: review tweaks * Safe unwrap layout config function Co-authored-by: Bartłomiej Maryńczak --------- Co-authored-by: Ilya Malyavin Co-authored-by: Bartłomiej Maryńczak --- src/buttons.rs | 208 +++++++++++++++++++++++++++++++++++++------------ src/config.rs | 32 ++++++++ src/lib.rs | 115 +++++++++++++++------------ 3 files changed, 257 insertions(+), 98 deletions(-) diff --git a/src/buttons.rs b/src/buttons.rs index d124ba8..3e024c2 100644 --- a/src/buttons.rs +++ b/src/buttons.rs @@ -1,3 +1,4 @@ +use log::warn; use tiny_skia::{FillRule, PathBuilder, PixmapMut, Rect, Stroke, Transform}; use smithay_client_toolkit::shell::xdg::window::{WindowManagerCapabilities, WindowState}; @@ -11,42 +12,59 @@ const BUTTON_SPACING: f32 = 13.; #[derive(Debug)] pub(crate) struct Buttons { - pub close: Button, - pub maximize: Option