From 21340d34468f6deb89358fe18e6f492bdb5848fd Mon Sep 17 00:00:00 2001 From: BZ Date: Fri, 26 Jun 2020 11:50:01 +0200 Subject: [PATCH] add option for border color_hover --- README.md | 1 + init.lua | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 9deb77e..fe4de0c 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ Customization: | `button_top_size` | `button_size` | size of top button | | `color_normal` | "#56666f" | border color | | `color_focus` | "#a1bfcf" | border color when client is focused | +| `color_hover` | nil | border color on border hover | | `color_maximize_normal` | "#a9dd9d" | color of maximize button | | `color_maximize_focus` | "#a9dd9d" | color of maximize button when client is focused | | `color_maximize_hover` | "#c3f7b7" | color of maximize button on mouse hover | diff --git a/init.lua b/init.lua index f94655a..a33697c 100644 --- a/init.lua +++ b/init.lua @@ -158,6 +158,7 @@ local function new(config) local color_normal = cfg.color_normal or "#56666f" local color_focus = cfg.color_focus or "#a1bfcf" + local color_hover = cfg.color_hover or nil local button_size = cfg.button_size or dpi(40) local spacing_widget = cfg.spacing_widget or nil @@ -366,6 +367,20 @@ local function new(config) handle_button_press(c, button) end) + + if color_hover then + border_bg:connect_signal("mouse::enter", function() + border_bg.bg = color_hover + end) + border_bg:connect_signal("mouse::leave", function() + if client.focus == c then + border_bg.bg = color_focus + else + border_bg.bg = color_normal + end + end) + end + local border_expander, border_expander_center if layout == "fixed" then