add button to channels window
This commit is contained in:
parent
cf85b00084
commit
e3588f6836
23
src/app.zig
23
src/app.zig
@ -913,8 +913,31 @@ fn showAddFromDeviceWindow(self: *App) !void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const left_panel = self.ui.newBox(UI.Key.initNil());
|
||||||
|
left_panel.layout_axis = .Y;
|
||||||
|
left_panel.size.y = UI.Size.percent(1, 0);
|
||||||
|
left_panel.size.x = UI.Size.percent(1, 0);
|
||||||
|
self.ui.pushParent(left_panel);
|
||||||
|
defer self.ui.popParent();
|
||||||
|
|
||||||
try self.showChannelInfoPanel(hot_channel);
|
try self.showChannelInfoPanel(hot_channel);
|
||||||
|
|
||||||
|
const add_button = self.ui.button(.text, "Add");
|
||||||
|
if (self.ui.signalFromBox(add_button).clicked()) {
|
||||||
|
for (self.selected_channels.constSlice()) |channel_name| {
|
||||||
|
try self.appendChannelFromDevice(channel_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.shown_window = .channels;
|
||||||
|
for (self.selected_channels.constSlice()) |channel| {
|
||||||
|
self.allocator.free(channel);
|
||||||
|
}
|
||||||
|
self.selected_channels.len = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hot_channel != null) {
|
if (hot_channel != null) {
|
||||||
self.last_hot_channel = hot_channel;
|
self.last_hot_channel = hot_channel;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user