mirror of https://github.com/fairyglade/ly.git
Change config type for bigclock
This commit is contained in:
parent
2bd0d0d4f3
commit
3a64bbf895
|
|
@ -51,8 +51,10 @@ auth_fails = 10
|
|||
# Background color id
|
||||
bg = 0x0000
|
||||
|
||||
# Enable/disable big clock
|
||||
bigclock = false
|
||||
# Change the state and language of the big clock
|
||||
# none -> Disabled (default)
|
||||
# en -> English
|
||||
bigclock = none
|
||||
|
||||
# Blank main box background
|
||||
# Setting to false will make it transparent
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ const enums = @import("../enums.zig");
|
|||
const Animation = enums.Animation;
|
||||
const Input = enums.Input;
|
||||
const ViMode = enums.ViMode;
|
||||
const Bigclock = enums.Bigclock;
|
||||
|
||||
animation: Animation = .none,
|
||||
animation_timeout_sec: u12 = 0,
|
||||
asterisk: ?u8 = '*',
|
||||
auth_fails: u64 = 10,
|
||||
bg: u16 = 0,
|
||||
bigclock: bool = false,
|
||||
bigclock: Bigclock = .none,
|
||||
blank_box: bool = true,
|
||||
border_fg: u16 = 8,
|
||||
box_title: ?[]const u8 = null,
|
||||
|
|
|
|||
|
|
@ -22,3 +22,8 @@ pub const ViMode = enum {
|
|||
normal,
|
||||
insert,
|
||||
};
|
||||
|
||||
pub const Bigclock = enum {
|
||||
none,
|
||||
en,
|
||||
};
|
||||
|
|
@ -385,7 +385,7 @@ pub fn main() !void {
|
|||
}
|
||||
}
|
||||
|
||||
if (config.bigclock and buffer.box_height + (bigclock.HEIGHT + 2) * 2 < buffer.height) draw_big_clock: {
|
||||
if (config.bigclock != .none and buffer.box_height + (bigclock.HEIGHT + 2) * 2 < buffer.height) draw_big_clock: {
|
||||
const format = "%H:%M";
|
||||
const xo = buffer.width / 2 - @min(buffer.width, (format.len * (bigclock.WIDTH + 1))) / 2;
|
||||
const yo = (buffer.height - buffer.box_height) / 2 - bigclock.HEIGHT - 2;
|
||||
|
|
@ -544,7 +544,7 @@ pub fn main() !void {
|
|||
.matrix => matrix.deinit(),
|
||||
}
|
||||
}
|
||||
} else if (config.bigclock and config.clock == null) {
|
||||
} else if (config.bigclock != .none and config.clock == null) {
|
||||
var tv: interop.system_time.timeval = undefined;
|
||||
_ = interop.system_time.gettimeofday(&tv, null);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue