mirror of
https://github.com/fairyglade/ly.git
synced 2026-03-25 09:46:06 +00:00
Rename min_refresh_delta option to animation_frame_delay (closes #925)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -27,6 +27,9 @@ allow_empty_password = true
|
|||||||
# dur_file -> .dur file format (https://github.com/cmang/durdraw/tree/master)
|
# dur_file -> .dur file format (https://github.com/cmang/durdraw/tree/master)
|
||||||
animation = none
|
animation = none
|
||||||
|
|
||||||
|
# Delay between each animation frame in milliseconds
|
||||||
|
animation_frame_delay = 5
|
||||||
|
|
||||||
# Stop the animation after some time
|
# Stop the animation after some time
|
||||||
# 0 -> Run forever
|
# 0 -> Run forever
|
||||||
# 1..2e12 -> Stop the animation after this many seconds
|
# 1..2e12 -> Stop the animation after this many seconds
|
||||||
@@ -291,9 +294,6 @@ margin_box_h = 2
|
|||||||
# Main box vertical margin
|
# Main box vertical margin
|
||||||
margin_box_v = 1
|
margin_box_v = 1
|
||||||
|
|
||||||
# Event timeout in milliseconds
|
|
||||||
min_refresh_delta = 5
|
|
||||||
|
|
||||||
# Set numlock on/off at startup
|
# Set numlock on/off at startup
|
||||||
numlock = false
|
numlock = false
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const DurOffsetAlignment = enums.DurOffsetAlignment;
|
|||||||
|
|
||||||
allow_empty_password: bool = true,
|
allow_empty_password: bool = true,
|
||||||
animation: Animation = .none,
|
animation: Animation = .none,
|
||||||
|
animation_frame_delay: u16 = 5,
|
||||||
animation_timeout_sec: u12 = 0,
|
animation_timeout_sec: u12 = 0,
|
||||||
asterisk: ?u32 = '*',
|
asterisk: ?u32 = '*',
|
||||||
auth_fails: u64 = 10,
|
auth_fails: u64 = 10,
|
||||||
@@ -73,7 +74,6 @@ logout_cmd: ?[]const u8 = null,
|
|||||||
ly_log: []const u8 = "/var/log/ly.log",
|
ly_log: []const u8 = "/var/log/ly.log",
|
||||||
margin_box_h: u8 = 2,
|
margin_box_h: u8 = 2,
|
||||||
margin_box_v: u8 = 1,
|
margin_box_v: u8 = 1,
|
||||||
min_refresh_delta: u16 = 5,
|
|
||||||
numlock: bool = false,
|
numlock: bool = false,
|
||||||
path: ?[]const u8 = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
path: ?[]const u8 = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||||
restart_cmd: []const u8 = "/sbin/shutdown -r now",
|
restart_cmd: []const u8 = "/sbin/shutdown -r now",
|
||||||
|
|||||||
@@ -153,6 +153,14 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie
|
|||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (std.mem.eql(u8, field.key, "min_refresh_delta")) {
|
||||||
|
// The option has simply been renamed
|
||||||
|
var mapped_field = field;
|
||||||
|
mapped_field.key = "animation_frame_delay";
|
||||||
|
|
||||||
|
return mapped_field;
|
||||||
|
}
|
||||||
|
|
||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
src/main.zig
12
src/main.zig
@@ -916,7 +916,7 @@ pub fn main() !void {
|
|||||||
|
|
||||||
// Calculate the maximum timeout based on current animations, or the (big) clock. If there's none, we wait for the event indefinitely instead
|
// Calculate the maximum timeout based on current animations, or the (big) clock. If there's none, we wait for the event indefinitely instead
|
||||||
if (state.animate and !state.animation_timed_out) {
|
if (state.animate and !state.animation_timed_out) {
|
||||||
timeout = config.min_refresh_delta;
|
timeout = config.animation_frame_delay;
|
||||||
|
|
||||||
// Check how long we've been running so we can turn off the animation
|
// Check how long we've been running so we can turn off the animation
|
||||||
const time = try interop.getTimeOfDay();
|
const time = try interop.getTimeOfDay();
|
||||||
@@ -1132,7 +1132,7 @@ fn authenticate(ptr: *anyopaque) !bool {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
state.info_line.label.draw();
|
state.info_line.label.draw();
|
||||||
_ = TerminalBuffer.presentBufferStatic();
|
TerminalBuffer.presentBufferStatic();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1154,7 +1154,7 @@ fn authenticate(ptr: *anyopaque) !bool {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
state.info_line.label.draw();
|
state.info_line.label.draw();
|
||||||
_ = TerminalBuffer.presentBufferStatic();
|
TerminalBuffer.presentBufferStatic();
|
||||||
|
|
||||||
if (state.config.save) save_last_settings: {
|
if (state.config.save) save_last_settings: {
|
||||||
// It isn't worth cluttering the code with precise error
|
// It isn't worth cluttering the code with precise error
|
||||||
@@ -1301,7 +1301,7 @@ fn authenticate(ptr: *anyopaque) !bool {
|
|||||||
|
|
||||||
// Restore the cursor
|
// Restore the cursor
|
||||||
TerminalBuffer.setCursorStatic(0, 0);
|
TerminalBuffer.setCursorStatic(0, 0);
|
||||||
_ = TerminalBuffer.presentBufferStatic();
|
TerminalBuffer.presentBufferStatic();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1439,7 +1439,7 @@ fn drawUi(state: *UiState) !bool {
|
|||||||
state.auth_fails = 0;
|
state.auth_fails = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = TerminalBuffer.presentBufferStatic();
|
TerminalBuffer.presentBufferStatic();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1482,7 +1482,7 @@ fn drawUi(state: *UiState) !bool {
|
|||||||
state.login.label.draw();
|
state.login.label.draw();
|
||||||
state.password.draw();
|
state.password.draw();
|
||||||
|
|
||||||
_ = TerminalBuffer.presentBufferStatic();
|
TerminalBuffer.presentBufferStatic();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user