Compare commits
2 Commits
182dec6065
...
0.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b7d032b11 | |||
| 7e20dd73d9 |
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
// This is a [Semantic Version](https://semver.org/).
|
// This is a [Semantic Version](https://semver.org/).
|
||||||
// In a future version of Zig it will be used for package deduplication.
|
// In a future version of Zig it will be used for package deduplication.
|
||||||
.version = "0.1.0",
|
.version = "0.2.0",
|
||||||
|
|
||||||
// Tracks the earliest Zig version that the package considers to be a
|
// Tracks the earliest Zig version that the package considers to be a
|
||||||
// supported use case.
|
// supported use case.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const ErrorNotification = struct {
|
|||||||
fn handle(ctx: *anyopaque, event: App.Event) !void {
|
fn handle(ctx: *anyopaque, event: App.Event) !void {
|
||||||
const this: *@This() = @ptrCast(@alignCast(ctx));
|
const this: *@This() = @ptrCast(@alignCast(ctx));
|
||||||
switch (event) {
|
switch (event) {
|
||||||
.key => |key| if (!key.isAscii()) return error.UnsupportedKey,
|
.key => |key| if (!key.isAscii()) return zterm.Error.TooSmall,
|
||||||
.err => |err| this.msg = err.msg,
|
.err => |err| this.msg = err.msg,
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ pub fn Element(Event: type) type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Resize the corresponding `Element` with the given *size*.
|
/// Resize the corresponding `Element` with the given *size*.
|
||||||
pub fn resize(this: @This(), size: Point) void {
|
pub inline fn resize(this: @This(), size: Point) void {
|
||||||
if (this.vtable.resize) |resize_fn|
|
if (this.vtable.resize) |resize_fn|
|
||||||
resize_fn(this.ptr, size);
|
resize_fn(this.ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reposition the corresponding `Element` with the given *origin*.
|
/// Reposition the corresponding `Element` with the given *origin*.
|
||||||
pub fn reposition(this: @This(), origin: Point) void {
|
pub inline fn reposition(this: @This(), origin: Point) void {
|
||||||
if (this.vtable.reposition) |reposition_fn|
|
if (this.vtable.reposition) |reposition_fn|
|
||||||
reposition_fn(this.ptr, origin);
|
reposition_fn(this.ptr, origin);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user