mirror of
https://github.com/fairyglade/ly.git
synced 2026-05-06 15:20:36 +00:00
Split UI code into ly-ui library
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
const std = @import("std");
|
||||
|
||||
const SavedUsers = @This();
|
||||
|
||||
const User = struct {
|
||||
username: []const u8,
|
||||
session_index: usize,
|
||||
first_run: bool,
|
||||
allocated_username: bool,
|
||||
};
|
||||
|
||||
user_list: std.ArrayList(User),
|
||||
last_username_index: ?usize,
|
||||
|
||||
pub fn init() SavedUsers {
|
||||
return .{
|
||||
.user_list = .empty,
|
||||
.last_username_index = null,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn deinit(self: *SavedUsers, allocator: std.mem.Allocator) void {
|
||||
for (self.user_list.items) |user| {
|
||||
if (user.allocated_username) allocator.free(user.username);
|
||||
}
|
||||
|
||||
self.user_list.deinit(allocator);
|
||||
}
|
||||
@@ -5,16 +5,17 @@
|
||||
const std = @import("std");
|
||||
var temporary_allocator = std.heap.page_allocator;
|
||||
|
||||
const ini = @import("zigini");
|
||||
const ly_core = @import("ly-core");
|
||||
const IniParser = ly_core.IniParser;
|
||||
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
const ly_ui = @import("ly-ui");
|
||||
const TerminalBuffer = ly_ui.TerminalBuffer;
|
||||
const Color = TerminalBuffer.Color;
|
||||
const Styling = TerminalBuffer.Styling;
|
||||
const ly_core = ly_ui.ly_core;
|
||||
const IniParser = ly_core.IniParser;
|
||||
const SavedUsers = ly_core.SavedUsers;
|
||||
const ini = ly_core.ini;
|
||||
|
||||
const Config = @import("Config.zig");
|
||||
const OldSave = @import("OldSave.zig");
|
||||
const SavedUsers = @import("SavedUsers.zig");
|
||||
|
||||
const color_properties = [_][]const u8{
|
||||
"bg",
|
||||
|
||||
Reference in New Issue
Block a user