mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-24 21:04:52 +02:00
xsecurelock: don't use bold for date
This commit is contained in:
parent
53c5ecdfb2
commit
de2c9879bc
1 changed files with 6 additions and 3 deletions
|
@ -69,9 +69,6 @@ def on_overlay_draw(widget, cctx, ctx):
|
||||||
wwidth, wheight = widget.get_parent().get_size()
|
wwidth, wheight = widget.get_parent().get_size()
|
||||||
if ctx.clock:
|
if ctx.clock:
|
||||||
time, date = ctx.clock
|
time, date = ctx.clock
|
||||||
cctx.select_font_face(
|
|
||||||
ctx.font_family, cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_BOLD
|
|
||||||
)
|
|
||||||
|
|
||||||
def draw(what, outline):
|
def draw(what, outline):
|
||||||
cctx.move_to(*text_position)
|
cctx.move_to(*text_position)
|
||||||
|
@ -79,12 +76,18 @@ def on_overlay_draw(widget, cctx, ctx):
|
||||||
cctx.show_text(what)
|
cctx.show_text(what)
|
||||||
|
|
||||||
# Time
|
# Time
|
||||||
|
cctx.select_font_face(
|
||||||
|
ctx.font_family, cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_BOLD
|
||||||
|
)
|
||||||
cctx.set_font_size(ctx.clock_font_size)
|
cctx.set_font_size(ctx.clock_font_size)
|
||||||
_, _, twidth, theight, _, _ = cctx.text_extents(re.sub(r"\d", "8", time))
|
_, _, twidth, theight, _, _ = cctx.text_extents(re.sub(r"\d", "8", time))
|
||||||
text_position = wwidth // 2 - twidth // 2, wheight // 3
|
text_position = wwidth // 2 - twidth // 2, wheight // 3
|
||||||
draw(time, 2)
|
draw(time, 2)
|
||||||
|
|
||||||
# Date
|
# Date
|
||||||
|
cctx.select_font_face(
|
||||||
|
ctx.font_family, cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL
|
||||||
|
)
|
||||||
cctx.set_font_size(ctx.clock_font_size // 3)
|
cctx.set_font_size(ctx.clock_font_size // 3)
|
||||||
_, _, twidth, theight, _, _ = cctx.text_extents(date)
|
_, _, twidth, theight, _, _ = cctx.text_extents(date)
|
||||||
text_position = wwidth // 2 - twidth // 2, wheight // 3 + theight * 1.5
|
text_position = wwidth // 2 - twidth // 2, wheight // 3 + theight * 1.5
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue