Files
ly/src/enums.zig
hynak a4076b83da [dur] Add support for alignments and negative offsets + Ly logo (#893)
## What are the changes about?
Add support for letting a user use a negative offset (#880), alignment, and logo. Below is example of the logo file, I hope it is what was request :). It has no padding so a user can move the alignment and offset to get it how they want on screen.

This technically is good to go, except I didn't upload the logo file as I'm not sure where to add the animation file to get it to here: $CONFIG_DIRECTORY/ly/example.dur

![logo-preview](/attachments/5a829dbd-7708-4d0a-9841-d024902ede68)

## What existing issue does this resolve?

#880

## Pre-requisites

- [x] I have tested & confirmed the changes work locally

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/893
Reviewed-by: AnErrupTion <anerruption@disroot.org>
Co-authored-by: hynak <hynak@noreply.codeberg.org>
Co-committed-by: hynak <hynak@noreply.codeberg.org>
2026-01-25 23:08:42 +01:00

69 lines
1.3 KiB
Zig

const std = @import("std");
pub const Animation = enum {
none,
doom,
matrix,
colormix,
gameoflife,
dur_file,
};
pub const DisplayServer = enum {
wayland,
shell,
xinitrc,
x11,
custom,
};
pub const Input = enum {
info_line,
session,
login,
password,
/// Moves the current Input forwards by one entry. If `reverse`, then the Input
/// moves backwards. If `wrap` is true, then the entry will wrap back around
pub fn move(self: *Input, reverse: bool, wrap: bool) void {
const maxNum = @typeInfo(Input).@"enum".fields.len - 1;
const selfNum = @intFromEnum(self.*);
if (reverse) {
if (wrap) {
self.* = @enumFromInt(selfNum -% 1);
} else if (selfNum != 0) {
self.* = @enumFromInt(selfNum - 1);
}
} else {
if (wrap) {
self.* = @enumFromInt(selfNum +% 1);
} else if (selfNum != maxNum) {
self.* = @enumFromInt(selfNum + 1);
}
}
}
};
pub const ViMode = enum {
normal,
insert,
};
pub const Bigclock = enum {
none,
en,
fa,
};
pub const DurOffsetAlignment = enum {
topleft,
topcenter,
topright,
centerleft,
center,
centerright,
bottomleft,
bottomcenter,
bottomright,
};