Skip to content

Commit

Permalink
feat(popup): implement hide_on_click getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Aire-One committed Aug 6, 2022
1 parent c2db842 commit 687e5f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/awful/popup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ function popup:set_hide_on_right_click(value)
)
self:set_hide_on_click(value)
end
function popup:get_hide_on_click()
local button_press_signals = self._signals["button::press"]
return button_press_signals and button_press_signals.strong[self._private.hide_fct] or false
end

--- The popup minimum width.
--
Expand Down
2 changes: 2 additions & 0 deletions tests/test-awful-popup-hide-on-click.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ end
runner.run_steps {
function()
assert(p.visible)
assert(not p.hide_on_click)
return true
end,
click(p.x, p.y),
Expand All @@ -31,6 +32,7 @@ runner.run_steps {
click(p.x, p.y),
function()
assert(not p.visible)
assert(p.hide_on_click)
return true
end,
}

0 comments on commit 687e5f8

Please sign in to comment.