Skip to content

Commit 8c55782

Browse files
committed
fixed ColorEditFlags off by one
removed internal TabBarFlags consts adding missing HoveredFlags fields removed invalid PopupFlags fields added missing PopupFlags.any_popup const
1 parent a199efd commit 8c55782

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

libs/zgui/src/gui.zig

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,10 @@ pub const HoveredFlags = packed struct(c_int) {
737737
allow_when_overlapped: bool = false,
738738
allow_when_disabled: bool = false,
739739
no_nav_override: bool = false,
740-
_padding: u21 = 0,
740+
delay_normal: bool = false,
741+
delay_short: bool = false,
742+
no_shared_delay: bool = false,
743+
_padding: u18 = 0,
741744

742745
pub const rect_only = HoveredFlags{
743746
.allow_when_blocked_by_popup = true,
@@ -2504,6 +2507,7 @@ extern fn zguiInputScalarN(
25042507
//
25052508
//--------------------------------------------------------------------------------------------------
25062509
pub const ColorEditFlags = packed struct(c_int) {
2510+
_reserved0: bool = false,
25072511
no_alpha: bool = false,
25082512
no_picker: bool = false,
25092513
no_options: bool = false,
@@ -2515,11 +2519,11 @@ pub const ColorEditFlags = packed struct(c_int) {
25152519
no_drag_drop: bool = false,
25162520
no_border: bool = false,
25172521

2518-
_reserved0: bool = false,
25192522
_reserved1: bool = false,
25202523
_reserved2: bool = false,
25212524
_reserved3: bool = false,
25222525
_reserved4: bool = false,
2526+
_reserved5: bool = false,
25232527

25242528
alpha_bar: bool = false,
25252529
alpha_preview: bool = false,
@@ -2535,7 +2539,7 @@ pub const ColorEditFlags = packed struct(c_int) {
25352539
input_rgb: bool = false,
25362540
input_hsv: bool = false,
25372541

2538-
_padding: u4 = 0,
2542+
_padding: u3 = 0,
25392543

25402544
pub const default_options = ColorEditFlags{
25412545
.uint8 = true,
@@ -3237,14 +3241,17 @@ pub const PopupFlags = packed struct(c_int) {
32373241
mouse_button_left: bool = false,
32383242
mouse_button_right: bool = false,
32393243
mouse_button_middle: bool = false,
3240-
mouse_button_mask_: bool = false,
3241-
mouse_button_default_: bool = false,
3244+
3245+
_reserved0: bool = false,
3246+
_reserved1: bool = false,
3247+
32423248
no_open_over_existing_popup: bool = false,
32433249
no_open_over_items: bool = false,
32443250
any_popup_id: bool = false,
32453251
any_popup_level: bool = false,
3246-
any_popup: bool = false,
3247-
_padding: u22 = 0,
3252+
_padding: u23 = 0,
3253+
3254+
pub const any_popup = PopupFlags{ .any_popup_id = true, .any_popup_level = true };
32483255
};
32493256
pub fn beginPopupModal(name: [:0]const u8, args: Begin) bool {
32503257
return zguiBeginPopupModal(name, args.popen, args.flags);
@@ -3280,12 +3287,6 @@ pub const TabBarFlags = packed struct(c_int) {
32803287
fitting_policy_resize_down: bool = false,
32813288
fitting_policy_scroll: bool = false,
32823289
_padding: u24 = 0,
3283-
3284-
pub const fitting_policy_mask = TabBarFlags{
3285-
.fitting_policy_resize_down = true,
3286-
.fitting_policy_scroll = true,
3287-
};
3288-
pub const fitting_policy_default = TabBarFlags{ .fitting_policy_resize_down = true };
32893290
};
32903291
pub const TabItemFlags = packed struct(c_int) {
32913292
unsaved_document: bool = false,

samples/gui_test_wgpu/src/gui_test_wgpu.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,13 @@ fn update(demo: *DemoState) !void {
416416
if (zgui.collapsingHeader("Widgets: Color Editor/Picker", .{})) {
417417
const static = struct {
418418
var col3: [3]f32 = .{ 0, 0, 0 };
419-
var col4: [4]f32 = .{ 0, 0, 0, 0 };
419+
var col4: [4]f32 = .{ 0, 1, 0, 0 };
420420
var col3p: [3]f32 = .{ 0, 0, 0 };
421421
var col4p: [4]f32 = .{ 0, 0, 0, 0 };
422422
};
423423
_ = zgui.colorEdit3("Color edit 3", .{ .col = &static.col3 });
424424
_ = zgui.colorEdit4("Color edit 4", .{ .col = &static.col4 });
425+
_ = zgui.colorEdit4("Color edit 4 float", .{ .col = &static.col4, .flags = .{ .float = true } });
425426
_ = zgui.colorPicker3("Color picker 3", .{ .col = &static.col3p });
426427
_ = zgui.colorPicker4("Color picker 4", .{ .col = &static.col4p });
427428
_ = zgui.colorButton("color_button_id", .{ .col = .{ 0, 1, 0, 1 } });

0 commit comments

Comments
 (0)