Более красивая панель
This commit is contained in:
@@ -381,28 +381,22 @@ fn drawStatsPanel(stats: RenderStats, frame_index: u64) void {
|
|||||||
|
|
||||||
fn drawPropertyEditor(canvas: *Canvas, obj: *Document.Object, prop: *const Property, row_index: usize) void {
|
fn drawPropertyEditor(canvas: *Canvas, obj: *Document.Object, prop: *const Property, row_index: usize) void {
|
||||||
const row_id: usize = row_index * 16;
|
const row_id: usize = row_index * 16;
|
||||||
|
const is_even = row_index % 2 == 0;
|
||||||
var row = dvui.box(
|
var row = dvui.box(
|
||||||
@src(),
|
@src(),
|
||||||
.{ .dir = .vertical },
|
.{ .dir = .vertical },
|
||||||
.{
|
.{
|
||||||
.id_extra = row_id,
|
.id_extra = row_id,
|
||||||
.expand = .horizontal,
|
.expand = .horizontal,
|
||||||
.padding = dvui.Rect{ .y = 2 },
|
.padding = dvui.Rect{ .y = 2, .x = 4 },
|
||||||
|
.corner_radius = dvui.Rect.all(4),
|
||||||
|
.background = is_even,
|
||||||
|
.color_fill = if (is_even) dvui.Color.black.opacity(0.4) else .{},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
{
|
{
|
||||||
const tag = std.meta.activeTag(prop.data);
|
const tag = std.meta.activeTag(prop.data);
|
||||||
|
|
||||||
// Скрываем строку с цветом заливки, если заполнение выключено.
|
|
||||||
if (tag == .fill_rgba) {
|
|
||||||
const filled_prop = obj.getProperty(.filled);
|
|
||||||
const filled = if (filled_prop) |p| p.filled else false;
|
|
||||||
if (!filled) {
|
|
||||||
row.deinit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dvui.labelNoFmt(@src(), propertyLabel(tag), .{}, .{});
|
dvui.labelNoFmt(@src(), propertyLabel(tag), .{}, .{});
|
||||||
|
|
||||||
switch (prop.data) {
|
switch (prop.data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user