doc: Update some examples not to hardcode the foreground color.

This commit is contained in:
Emmanuel Lepage Vallee 2021-12-13 10:21:43 -08:00
parent b3cf35d988
commit f5b2f34269
5 changed files with 10 additions and 5 deletions

View File

@ -9,6 +9,7 @@ local naughty = require("naughty")
local wibox = require("wibox")
local beautiful = require("beautiful") --DOC_HIDE
local look = require("_default_look")
local color = require("gears.color")
screen[1]._resize {width = 640, height = 340}
@ -75,7 +76,7 @@ local function create_line(x1, y1, x2, y2)
return x2-x1+6, y2-y1+6
end,
draw = function(_, _, cr)
cr:set_source_rgb(0,0,0)
cr:set_source(color(beautiful.fg_normal))
cr:set_line_width(1)
cr:arc(1.5, 1.5, 1.5, 0, math.pi*2)
cr:arc(x2-x1+1.5, y2-y1+1.5, 1.5, 0, math.pi*2)

View File

@ -10,6 +10,7 @@ local wibox = require("wibox")
local beautiful = require("beautiful") --DOC_HIDE
local assets = require("beautiful.theme_assets")
local look = require("_default_look")
local color = require("gears.color")
screen[1]._resize {width = 640, height = 480}
@ -233,7 +234,7 @@ local function create_line(x1, y1, x2, y2)
return x2-x1+6, y2-y1+6
end,
draw = function(_, _, cr)
cr:set_source_rgb(0,0,0)
cr:set_source(color(beautiful.fg_normal))
cr:set_line_width(1)
cr:arc(1.5, 1.5, 1.5, 0, math.pi*2)
cr:arc(x2-x1+1.5, y2-y1+1.5, 1.5, 0, math.pi*2)

View File

@ -7,6 +7,7 @@ local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful") --DOC_HIDE
local look = require("_default_look")
local color = require("gears.color")
local offset = 0
@ -108,7 +109,7 @@ local function create_line(x1, y1, x2, y2)
return x2-x1+6, y2-y1+6
end,
draw = function(_, _, cr)
cr:set_source_rgb(0,0,0)
cr:set_source(color(beautiful.fg_normal))
cr:set_line_width(1)
cr:arc(1.5, 1.5, 1.5, 0, math.pi*2)
cr:arc(x2-x1+1.5, y2-y1+1.5, 1.5, 0, math.pi*2)

View File

@ -7,6 +7,7 @@ local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful") --DOC_HIDE
local look = require("_default_look")
local color = require("gears.color")
local offset = 60
@ -99,7 +100,7 @@ local function create_line(x1, y1, x2, y2)
return x2-x1+6, y2-y1+6
end,
draw = function(_, _, cr)
cr:set_source_rgb(0,0,0)
cr:set_source(color(beautiful.fg_normal))
cr:set_line_width(1)
cr:arc(1.5, 1.5, 1.5, 0, math.pi*2)
cr:arc(x2-x1+1.5, y2-y1+1.5, 1.5, 0, math.pi*2)

View File

@ -7,6 +7,7 @@ local def = require("naughty.widget._default")
local acommon = require("awful.widget.common")
local aplace = require("awful.placement")
local gears = require("gears")
local color = require("gears.color")
beautiful.notification_bg = beautiful.bg_normal
@ -76,7 +77,7 @@ local function create_line(x1, y1, x2, y2)
return x2-x1+6, y2-y1+6
end,
draw = function(_, _, cr)
cr:set_source_rgb(0,0,0)
cr:set_source(color(beautiful.fg_normal))
cr:set_line_width(1)
cr:arc(1.5, 1.5, 1.5, 0, math.pi*2)
cr:arc(x2-x1+1.5, y2-y1+1.5, 1.5, 0, math.pi*2)