taskbar: Add a button to open terminal instead of gclient

This commit is contained in:
apio 2023-09-16 11:41:51 +02:00
parent a4b5e68e1b
commit 5a49e97483
Signed by: apio
GPG Key ID: B8A7D06E42258954
3 changed files with 9 additions and 9 deletions

View File

@ -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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB