This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Creates Zig API mappings from "accesskit.h" | |
//! These should be pasted at the end of AccessKit.zig | |
//! Build with `zig build-exe main.zig -I. -lc` | |
const std = @import("std"); | |
const builtin = @import("builtin"); | |
const c = @cImport({ | |
@cDefine("__APPLE__", {}); | |
@cDefine("__linux__", {}); | |
if (builtin.os.tag == .windows) | |
@cDefine("_WIN32", {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (self.menuItem.activeRect()) |r| { | |
self.drop = FloatingMenuWidget.init(@src(), .{ .from = r, .avoid = .none }, .{ .min_size_content = .cast(r.size()) }); | |
var drop = &self.drop.?; | |
self.drop_first_frame = dvui.firstFrame(drop.data().id); | |
const s = drop.scale_val; | |
// move drop up to align first item | |
drop.init_options.from.x -= drop.options.borderGet().x * s; | |
drop.init_options.from.x -= drop.options.paddingGet().x * s; |