doc(w.l.overflow): Clean up shared entries
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This commit is contained in:
parent
252800fda1
commit
63ba82516d
|
@ -7,6 +7,7 @@
|
||||||
-- @author Lucas Schwiderski
|
-- @author Lucas Schwiderski
|
||||||
-- @copyright 2021 Lucas Schwiderski
|
-- @copyright 2021 Lucas Schwiderski
|
||||||
-- @layoutmod wibox.layout.overflow
|
-- @layoutmod wibox.layout.overflow
|
||||||
|
-- @supermodule wibox.layout.fixed
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local base = require('wibox.widget.base')
|
local base = require('wibox.widget.base')
|
||||||
|
@ -264,13 +265,6 @@ end
|
||||||
--
|
--
|
||||||
-- @property step
|
-- @property step
|
||||||
-- @tparam number step The step size.
|
-- @tparam number step The step size.
|
||||||
-- @see set_step
|
|
||||||
|
|
||||||
-- Set the step size.
|
|
||||||
--
|
|
||||||
-- @method overflow:set_step
|
|
||||||
-- @tparam number step The step size.
|
|
||||||
-- @see step
|
|
||||||
function overflow:set_step(step)
|
function overflow:set_step(step)
|
||||||
self._private.step = step
|
self._private.step = step
|
||||||
-- We don't need to emit enything here, since changing step only really
|
-- We don't need to emit enything here, since changing step only really
|
||||||
|
@ -281,13 +275,14 @@ end
|
||||||
--- Scroll the layout's content by `amount * step`.
|
--- Scroll the layout's content by `amount * step`.
|
||||||
-- A positive amount scroll down/right, a negative amount scrolls up/left.
|
-- A positive amount scroll down/right, a negative amount scrolls up/left.
|
||||||
--
|
--
|
||||||
|
-- The amount of units scrolled is affected by `step`.
|
||||||
|
--
|
||||||
-- @method overflow:scroll
|
-- @method overflow:scroll
|
||||||
-- @tparam number amount The amount to scroll by.
|
-- @tparam number amount The amount to scroll by.
|
||||||
-- @emits property::overflow::position
|
-- @emits property::overflow::position
|
||||||
-- @emitstparam property::overflow::position number position The new position.
|
-- @emitstparam property::overflow::position number position The new position.
|
||||||
-- @emits widget::layout_changed
|
-- @emits widget::layout_changed
|
||||||
-- @emits widget::redraw_needed
|
-- @emits widget::redraw_needed
|
||||||
-- @see step
|
|
||||||
function overflow:scroll(amount)
|
function overflow:scroll(amount)
|
||||||
if amount == 0 then
|
if amount == 0 then
|
||||||
return
|
return
|
||||||
|
@ -306,16 +301,7 @@ end
|
||||||
-- @property position
|
-- @property position
|
||||||
-- @tparam number position The position.
|
-- @tparam number position The position.
|
||||||
-- @propemits true false
|
-- @propemits true false
|
||||||
-- @see set_position
|
|
||||||
|
|
||||||
-- Set the current scroll position.
|
|
||||||
--
|
|
||||||
-- @method overflow:set_position
|
|
||||||
-- @tparam number position The new position.
|
|
||||||
-- @propemits true false
|
|
||||||
-- @emits widget::layout_changed
|
|
||||||
-- @emits widget::redraw_needed
|
|
||||||
-- @see position
|
|
||||||
function overflow:set_position(pos)
|
function overflow:set_position(pos)
|
||||||
local current = self._private.position
|
local current = self._private.position
|
||||||
local interval = self._private.used_in_dir - self._private.avail_in_dir
|
local interval = self._private.used_in_dir - self._private.avail_in_dir
|
||||||
|
@ -335,12 +321,6 @@ function overflow:set_position(pos)
|
||||||
self:emit_signal("property::position", pos)
|
self:emit_signal("property::position", pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Get the current scroll position.
|
|
||||||
--
|
|
||||||
-- @method overflow:get_position
|
|
||||||
-- @treturn number position The current position.
|
|
||||||
-- @see position
|
|
||||||
function overflow:get_position()
|
function overflow:get_position()
|
||||||
return self._private.position
|
return self._private.position
|
||||||
end
|
end
|
||||||
|
@ -356,16 +336,7 @@ end
|
||||||
-- @property scrollbar_width
|
-- @property scrollbar_width
|
||||||
-- @tparam number scrollbar_width The scrollbar width.
|
-- @tparam number scrollbar_width The scrollbar width.
|
||||||
-- @propemits true false
|
-- @propemits true false
|
||||||
-- @see set_scrollbar_width
|
|
||||||
|
|
||||||
-- Set the scrollbar width.
|
|
||||||
--
|
|
||||||
-- @method overflow:set_scrollbar_width
|
|
||||||
-- @tparam number scrollbar_width The new scrollbar width.
|
|
||||||
-- @propemits true false
|
|
||||||
-- @emits widget::layout_changed
|
|
||||||
-- @emits widget::redraw_needed
|
|
||||||
-- @see scrollbar_width
|
|
||||||
function overflow:set_scrollbar_width(width)
|
function overflow:set_scrollbar_width(width)
|
||||||
if self._private.scrollbar_width == width then
|
if self._private.scrollbar_width == width then
|
||||||
return
|
return
|
||||||
|
@ -389,16 +360,7 @@ end
|
||||||
-- @property scrollbar_position
|
-- @property scrollbar_position
|
||||||
-- @tparam string scrollbar_position The scrollbar position.
|
-- @tparam string scrollbar_position The scrollbar position.
|
||||||
-- @propemits true false
|
-- @propemits true false
|
||||||
-- @see set_scrollbar_position
|
|
||||||
|
|
||||||
-- Set the scrollbar position.
|
|
||||||
--
|
|
||||||
-- @method overflow:set_scrollbar_position
|
|
||||||
-- @tparam string scrollbar_position The new scrollbar position.
|
|
||||||
-- @propemits true false
|
|
||||||
-- @emits widget::layout_changed
|
|
||||||
-- @emits widget::redraw_needed
|
|
||||||
-- @see scrollbar_position
|
|
||||||
function overflow:set_scrollbar_position(position)
|
function overflow:set_scrollbar_position(position)
|
||||||
if self._private.scrollbar_position == position then
|
if self._private.scrollbar_position == position then
|
||||||
return
|
return
|
||||||
|
@ -410,6 +372,10 @@ function overflow:set_scrollbar_position(position)
|
||||||
self:emit_signal("property::scrollbar_position", position)
|
self:emit_signal("property::scrollbar_position", position)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function overflow:get_scrollbar_position()
|
||||||
|
return self._private.scrollbar_position
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- The scrollbar visibility.
|
--- The scrollbar visibility.
|
||||||
-- If this is set to `false`, no scrollbar will be rendered, even if the layout's
|
-- If this is set to `false`, no scrollbar will be rendered, even if the layout's
|
||||||
|
@ -420,16 +386,7 @@ end
|
||||||
-- @property scrollbar_enabled
|
-- @property scrollbar_enabled
|
||||||
-- @tparam boolean scrollbar_enabled The scrollbar visibility.
|
-- @tparam boolean scrollbar_enabled The scrollbar visibility.
|
||||||
-- @propemits true false
|
-- @propemits true false
|
||||||
-- @see set_scrollbar_enabled
|
|
||||||
|
|
||||||
-- Enable or disable the scrollbar visibility.
|
|
||||||
--
|
|
||||||
-- @method overflow:set_scrollbar_enabled
|
|
||||||
-- @tparam boolean scrollbar_enabled The new scrollbar visibility.
|
|
||||||
-- @propemits true false
|
|
||||||
-- @emits widget::layout_changed
|
|
||||||
-- @emits widget::redraw_needed
|
|
||||||
-- @see scrollbar_enabled
|
|
||||||
function overflow:set_scrollbar_enabled(enabled)
|
function overflow:set_scrollbar_enabled(enabled)
|
||||||
if self._private.scrollbar_enabled == enabled then
|
if self._private.scrollbar_enabled == enabled then
|
||||||
return
|
return
|
||||||
|
@ -441,6 +398,10 @@ function overflow:set_scrollbar_enabled(enabled)
|
||||||
self:emit_signal("property::scrollbar_enabled", enabled)
|
self:emit_signal("property::scrollbar_enabled", enabled)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function overflow:get_scrollbar_enabled()
|
||||||
|
return self._private.scrollbar_enabled
|
||||||
|
end
|
||||||
|
|
||||||
-- Wraps a callback function for `mousegrabber` that is capable of
|
-- Wraps a callback function for `mousegrabber` that is capable of
|
||||||
-- updating the scroll position.
|
-- updating the scroll position.
|
||||||
local function build_grabber(container)
|
local function build_grabber(container)
|
||||||
|
@ -483,17 +444,7 @@ end
|
||||||
-- @property scrollbar_widget
|
-- @property scrollbar_widget
|
||||||
-- @tparam widget scrollbar_widget The scrollbar widget.
|
-- @tparam widget scrollbar_widget The scrollbar widget.
|
||||||
-- @propemits true false
|
-- @propemits true false
|
||||||
-- @see set_scrollbar_widget
|
|
||||||
|
|
||||||
-- Set the scrollbar widget.
|
|
||||||
--
|
|
||||||
-- This will also apply the mouse button handler.
|
|
||||||
--
|
|
||||||
-- @method overflow:set_scrollbar_widget
|
|
||||||
-- @tparam widget scrollbar_widget The new scrollbar widget.
|
|
||||||
-- @propemits true false
|
|
||||||
-- @emits widget::layout_changed
|
|
||||||
-- @see scrollbar_widget
|
|
||||||
function overflow:set_scrollbar_widget(widget)
|
function overflow:set_scrollbar_widget(widget)
|
||||||
local w = base.make_widget_from_value(widget)
|
local w = base.make_widget_from_value(widget)
|
||||||
|
|
||||||
|
@ -505,6 +456,10 @@ function overflow:set_scrollbar_widget(widget)
|
||||||
self:emit_signal("property::scrollbar_widget", widget)
|
self:emit_signal("property::scrollbar_widget", widget)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function overflow:get_scrollbar_widget()
|
||||||
|
return self._private.scrollbar_widget
|
||||||
|
end
|
||||||
|
|
||||||
local function new(dir, ...)
|
local function new(dir, ...)
|
||||||
local ret = fixed[dir](...)
|
local ret = fixed[dir](...)
|
||||||
|
|
||||||
|
@ -560,51 +515,6 @@ function overflow.vertical(...)
|
||||||
return new("vertical", ...)
|
return new("vertical", ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Add spacing between each layout widgets.
|
|
||||||
--
|
|
||||||
-- This behaves just like in `wibox.layout.fixed`:
|
|
||||||
--
|
|
||||||
--@DOC_wibox_layout_fixed_spacing_EXAMPLE@
|
|
||||||
--
|
|
||||||
-- @property spacing
|
|
||||||
-- @tparam number spacing Spacing between widgets.
|
|
||||||
-- @propemits true false
|
|
||||||
-- @baseclass wibox.layout.fixed
|
|
||||||
-- @see wibox.layout.fixed
|
|
||||||
|
|
||||||
|
|
||||||
--- The widget used to fill the spacing between the layout elements.
|
|
||||||
-- By default, no widget is used.
|
|
||||||
--
|
|
||||||
-- This behaves just like in `wibox.layout.fixed`:
|
|
||||||
--
|
|
||||||
--@DOC_wibox_layout_fixed_spacing_widget_EXAMPLE@
|
|
||||||
--
|
|
||||||
-- @property spacing_widget
|
|
||||||
-- @tparam widget spacing_widget
|
|
||||||
-- @propemits true false
|
|
||||||
-- @baseclass wibox.layout.fixed
|
|
||||||
-- @see wibox.layout.fixed
|
|
||||||
|
|
||||||
|
|
||||||
--- Set the layout's fill_space property.
|
|
||||||
--
|
|
||||||
-- If this property is `true`, widgets
|
|
||||||
-- take all space in the non-scrolling directing (e.g. `width` for vertical
|
|
||||||
-- scrolling). If `false`, they will only take as much as they need for their
|
|
||||||
-- content.
|
|
||||||
--
|
|
||||||
-- The default is `true`.
|
|
||||||
--
|
|
||||||
--@DOC_wibox_layout_overflow_fill_space_EXAMPLE@
|
|
||||||
--
|
|
||||||
-- @property fill_space
|
|
||||||
-- @tparam boolean fill_space
|
|
||||||
-- @baseclass wibox.layout.fixed
|
|
||||||
-- @propemits true false
|
|
||||||
|
|
||||||
|
|
||||||
--@DOC_fixed_COMMON@
|
--@DOC_fixed_COMMON@
|
||||||
|
|
||||||
--@DOC_widget_COMMON@
|
--@DOC_widget_COMMON@
|
||||||
|
|
Loading…
Reference in New Issue