tooltip: Add alignment options.
It's a list of preferred alignments because sometime the best one wont fit in the screen.
This commit is contained in:
parent
7d6f52c4dc
commit
3380fd85fc
|
@ -124,6 +124,7 @@ local function apply_outside_mode(self)
|
||||||
local _, position = a_placement.next_to(w, {
|
local _, position = a_placement.next_to(w, {
|
||||||
geometry = self._private.widget_geometry,
|
geometry = self._private.widget_geometry,
|
||||||
preferred_positions = self.preferred_positions,
|
preferred_positions = self.preferred_positions,
|
||||||
|
preferred_anchors = self.preferred_alignments,
|
||||||
honor_workarea = true,
|
honor_workarea = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -326,6 +327,18 @@ function tooltip:set_preferred_positions(value)
|
||||||
set_geometry(self)
|
set_geometry(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function tooltip:get_preferred_alignments()
|
||||||
|
return self._private.preferred_alignments or
|
||||||
|
{"front", "back", "middle"}
|
||||||
|
end
|
||||||
|
|
||||||
|
function tooltip:set_preferred_alignments(value)
|
||||||
|
self._private.preferred_alignments = value
|
||||||
|
|
||||||
|
set_geometry(self)
|
||||||
|
end
|
||||||
|
|
||||||
--- Change displayed text.
|
--- Change displayed text.
|
||||||
--
|
--
|
||||||
-- @property text
|
-- @property text
|
||||||
|
|
Loading…
Reference in New Issue