Add a display server and graphical user interface #38
@ -31,18 +31,18 @@ Result<int> luna_main(int argc, char** argv)
|
||||
ui::HorizontalLayout layout(ui::AdjustHeight::Yes, ui::AdjustWidth::No);
|
||||
window->set_main_widget(layout);
|
||||
|
||||
ui::Button start_button({ 0, 0, 50, 50 });
|
||||
layout.add_widget(start_button);
|
||||
ui::Button term_button({ 0, 0, 50, 50 });
|
||||
layout.add_widget(term_button);
|
||||
|
||||
ui::Container start_container({ 0, 0, 50, 50 }, ui::VerticalAlignment::Center, ui::HorizontalAlignment::Center);
|
||||
start_button.set_widget(start_container);
|
||||
start_button.set_action([] {
|
||||
StringView args[] = { "/usr/bin/gclient" };
|
||||
os::Process::spawn("/usr/bin/gclient", Slice<StringView> { args, 1 }, false);
|
||||
ui::Container term_container({ 0, 0, 50, 50 }, ui::VerticalAlignment::Center, ui::HorizontalAlignment::Center);
|
||||
term_button.set_widget(term_container);
|
||||
term_button.set_action([] {
|
||||
StringView args[] = { "/usr/bin/terminal" };
|
||||
os::Process::spawn("/usr/bin/terminal", Slice<StringView> { args, 1 }, false);
|
||||
});
|
||||
|
||||
auto start_image = TRY(ui::ImageWidget::load("/usr/share/icons/32x32/start-icon.tga"));
|
||||
start_container.set_widget(*start_image);
|
||||
auto term_image = TRY(ui::ImageWidget::load("/usr/share/icons/32x32/app-terminal.tga"));
|
||||
term_container.set_widget(*term_image);
|
||||
|
||||
ui::Button about_button({ 0, 0, 50, 50 });
|
||||
layout.add_widget(about_button);
|
||||
|
BIN
base/usr/share/icons/32x32/app-terminal.tga
Normal file
BIN
base/usr/share/icons/32x32/app-terminal.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
Loading…
Reference in New Issue
Block a user