chore(lint) fix too long lines
This commit is contained in:
parent
e7efab68f6
commit
9952cb0ea6
21
init.lua
21
init.lua
|
@ -247,7 +247,9 @@ local function get_dominant_color(client)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns a color that is analogous to the last color returned
|
-- Returns a color that is analogous to the last color returned
|
||||||
-- To make sure that the "randomly" generated colors look cohesive, only the first color is truly random, the rest are generated by offseting the hue by +33 degrees
|
-- To make sure that the "randomly" generated colors look cohesive, only the
|
||||||
|
-- first color is truly random, the rest are generated by offseting the hue by
|
||||||
|
-- +33 degrees
|
||||||
local next_color = colors.rand_hex()
|
local next_color = colors.rand_hex()
|
||||||
local function get_next_color()
|
local function get_next_color()
|
||||||
local prev_color = next_color
|
local prev_color = next_color
|
||||||
|
@ -284,7 +286,8 @@ local function create_button_image(name, is_focused, event, is_on)
|
||||||
if not is_focused and event ~= "hover" then
|
if not is_focused and event ~= "hover" then
|
||||||
button_color = colors.hsv2hex(H, 0, 50)
|
button_color = colors.hsv2hex(H, 0, 50)
|
||||||
end
|
end
|
||||||
-- Then the color is lightened if the button is being hovered over, or darkened if it is being pressed, otherwise it is left as is
|
-- Then the color is lightened if the button is being hovered over, or
|
||||||
|
-- darkened if it is being pressed, otherwise it is left as is
|
||||||
button_color = (event == "hover") and colors.lighten(button_color, 25)
|
button_color = (event == "hover") and colors.lighten(button_color, 25)
|
||||||
or (event == "press") and colors.darken(
|
or (event == "press") and colors.darken(
|
||||||
button_color,
|
button_color,
|
||||||
|
@ -312,7 +315,13 @@ local function create_titlebar_button(c, name, button_callback, property)
|
||||||
if _private.tooltips_enabled then
|
if _private.tooltips_enabled then
|
||||||
local tooltip = atooltip {
|
local tooltip = atooltip {
|
||||||
timer_function = function()
|
timer_function = function()
|
||||||
return _private.tooltip_messages[name .. (property and (c[property] and "_active" or "_inactive") or "")]
|
local prop = name
|
||||||
|
.. (
|
||||||
|
property
|
||||||
|
and (c[property] and "_active" or "_inactive")
|
||||||
|
or ""
|
||||||
|
)
|
||||||
|
return _private.tooltip_messages[prop]
|
||||||
end,
|
end,
|
||||||
delay_show = 0.5,
|
delay_show = 0.5,
|
||||||
margins_leftright = 12,
|
margins_leftright = 12,
|
||||||
|
@ -409,7 +418,9 @@ local function get_titlebar_mouse_bindings(c)
|
||||||
clicks = clicks + 1
|
clicks = clicks + 1
|
||||||
if clicks == 2 then
|
if clicks == 2 then
|
||||||
local nx, ny = _G.mouse.coords().x, _G.mouse.coords().y
|
local nx, ny = _G.mouse.coords().x, _G.mouse.coords().y
|
||||||
-- The second click is only counted as a double click if it is within the neighborhood of the first click's position, and occurs within the set time window
|
-- The second click is only counted as a double click if it is
|
||||||
|
-- within the neighborhood of the first click's position, and
|
||||||
|
-- occurs within the set time window
|
||||||
if abs(cx - nx) <= tolerance and abs(cy - ny) <= tolerance then
|
if abs(cx - nx) <= tolerance and abs(cy - ny) <= tolerance then
|
||||||
if shade_enabled then
|
if shade_enabled then
|
||||||
_private.shade_roll_down(c)
|
_private.shade_roll_down(c)
|
||||||
|
@ -436,7 +447,7 @@ local function get_titlebar_mouse_bindings(c)
|
||||||
end
|
end
|
||||||
-- TODO: Add client control options as menu entries for options that haven't had their buttons added
|
-- TODO: Add client control options as menu entries for options that haven't had their buttons added
|
||||||
add_item("Redo Window Decorations", function()
|
add_item("Redo Window Decorations", function()
|
||||||
c._nice_base_color = get_dominant_color(c)
|
c._nice_base_color = nice.get_dominant_color(c)
|
||||||
set_color_rule(c, c._nice_base_color)
|
set_color_rule(c, c._nice_base_color)
|
||||||
_private.add_window_decorations(c)
|
_private.add_window_decorations(c)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue