mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
🚧 adjust a bit to fit with new TUI API
This commit is contained in:
parent
02a4b195b3
commit
617e756b16
@ -59,9 +59,7 @@ void follow_process_log_widget(const std::vector<std::string>& vec, Decorator bo
|
||||
screen.ExitLoopClosure()();
|
||||
};
|
||||
|
||||
auto button_option = ButtonOption();
|
||||
button_option.border = false;
|
||||
auto button_back = Button("Back", handle_exit, &button_option);
|
||||
auto button_back = Button("Back", handle_exit, ButtonOption::WithoutBorder());
|
||||
auto container = Container::Horizontal({button_back});
|
||||
|
||||
auto renderer = Renderer(container, [&] {
|
||||
|
@ -931,7 +931,7 @@ void install_desktop() noexcept {
|
||||
}
|
||||
found = ranges::search(desktop_env, cutefish);
|
||||
if (!found.empty()) {
|
||||
pkg_list.insert(pkg_list.cend(), {"cutefish", "fish-ui"});
|
||||
pkg_list.insert(pkg_list.cend(), {"cutefish"});
|
||||
needed_xorg = true;
|
||||
}
|
||||
found = ranges::search(desktop_env, wayfire);
|
||||
@ -952,7 +952,7 @@ void install_desktop() noexcept {
|
||||
// @see https://github.com/VaughnValle/kofuku
|
||||
found = ranges::search(desktop_env, kofuku);
|
||||
if (!found.empty()) {
|
||||
pkg_list.insert(pkg_list.cend(), {"bspwm", "sxhkd", "polybar", "lightdm", "cachyos-picom-config", "rofi", "lightdm", "lightdm-webkit2-greeter", "cachyos-kofuku"});
|
||||
pkg_list.insert(pkg_list.cend(), {"bspwm", "sxhkd", "polybar", "lightdm", "cachyos-picom-config", "rofi", "lightdm-webkit2-greeter", "cachyos-kofuku"});
|
||||
needed_xorg = true;
|
||||
}
|
||||
|
||||
|
@ -56,10 +56,10 @@ Element centered_widget_nocontrols(const std::string_view& title, const Element&
|
||||
});
|
||||
}
|
||||
|
||||
Component controls_widget(const std::array<std::string_view, 2>&& titles, const std::array<std::function<void()>, 2>&& callbacks, ButtonOption* button_option) noexcept {
|
||||
Component controls_widget(const std::array<std::string_view, 2>&& titles, const std::array<std::function<void()>, 2>&& callbacks) noexcept {
|
||||
/* clang-format off */
|
||||
auto button_ok = Button(titles[0].data(), callbacks[0], button_option);
|
||||
auto button_quit = Button(titles[1].data(), callbacks[1], button_option);
|
||||
auto button_ok = Button(titles[0].data(), callbacks[0], ButtonOption::WithoutBorder());
|
||||
auto button_quit = Button(titles[1].data(), callbacks[1], ButtonOption::WithoutBorder());
|
||||
/* clang-format on */
|
||||
|
||||
auto container = Container::Horizontal({
|
||||
@ -134,9 +134,7 @@ std::vector<std::string> from_checklist_vector(const std::vector<std::string>& o
|
||||
void msgbox_widget(const std::string_view& content, Decorator boxsize) noexcept {
|
||||
auto screen = ScreenInteractive::Fullscreen();
|
||||
/* clang-format off */
|
||||
auto button_option = ButtonOption();
|
||||
button_option.border = false;
|
||||
auto button_back = Button("OK", screen.ExitLoopClosure(), &button_option);
|
||||
auto button_back = Button("OK", screen.ExitLoopClosure(), ButtonOption::WithoutBorder());
|
||||
|
||||
auto container = Container::Horizontal({button_back});
|
||||
auto renderer = Renderer(container, [&] {
|
||||
@ -160,8 +158,7 @@ bool inputbox_widget(std::string& value, const std::string_view& content, Decora
|
||||
return multiline_text(utils::make_multiline(content)) | hcenter | boxsize;
|
||||
});
|
||||
|
||||
ButtonOption button_option{.border = false};
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen.ExitLoopClosure()}, &button_option);
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen.ExitLoopClosure()});
|
||||
|
||||
auto controls = Renderer(controls_container, [&] {
|
||||
return controls_container->Render() | hcenter | size(HEIGHT, LESS_THAN, 3) | size(WIDTH, GREATER_THAN, 25);
|
||||
@ -202,8 +199,7 @@ bool yesno_widget(const std::string_view& content, Decorator boxsize) noexcept {
|
||||
success = true;
|
||||
screen.ExitLoopClosure()();
|
||||
};
|
||||
ButtonOption button_option{.border = false};
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen.ExitLoopClosure()}, &button_option);
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen.ExitLoopClosure()});
|
||||
|
||||
auto controls = Renderer(controls_container, [&] {
|
||||
return controls_container->Render() | hcenter | size(HEIGHT, LESS_THAN, 3) | size(WIDTH, GREATER_THAN, 25);
|
||||
@ -233,8 +229,7 @@ bool yesno_widget(ftxui::Component& container, Decorator boxsize) noexcept {
|
||||
success = true;
|
||||
screen.ExitLoopClosure()();
|
||||
};
|
||||
ButtonOption button_option{.border = false};
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen.ExitLoopClosure()}, &button_option);
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen.ExitLoopClosure()});
|
||||
|
||||
auto controls = Renderer(controls_container, [&] {
|
||||
return controls_container->Render() | hcenter | size(HEIGHT, LESS_THAN, 3) | size(WIDTH, GREATER_THAN, 25);
|
||||
@ -261,8 +256,7 @@ void menu_widget(const std::vector<std::string>& entries, const std::function<vo
|
||||
return menu->Render() | center | widget_sizes.content_size;
|
||||
});
|
||||
|
||||
ButtonOption button_option{.border = false};
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen->ExitLoopClosure()}, &button_option);
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen->ExitLoopClosure()});
|
||||
|
||||
auto controls = Renderer(controls_container, [&] {
|
||||
return controls_container->Render() | hcenter | size(HEIGHT, LESS_THAN, 3) | size(WIDTH, GREATER_THAN, 25);
|
||||
@ -300,8 +294,7 @@ void radiolist_widget(const std::vector<std::string>& entries, const std::functi
|
||||
return radiolist->Render() | center | widget_sizes.content_size;
|
||||
});
|
||||
|
||||
ButtonOption button_option{.border = false};
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen->ExitLoopClosure()}, &button_option);
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen->ExitLoopClosure()});
|
||||
|
||||
auto controls = Renderer(controls_container, [&] {
|
||||
return controls_container->Render() | hcenter | size(HEIGHT, LESS_THAN, 3) | size(WIDTH, GREATER_THAN, 25);
|
||||
@ -336,8 +329,7 @@ void checklist_widget(const std::vector<std::string>& opts, const std::function<
|
||||
return checklist->Render() | center | widget_sizes.content_size;
|
||||
});
|
||||
|
||||
ButtonOption button_option{.border = false};
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen->ExitLoopClosure()}, &button_option);
|
||||
auto controls_container = controls_widget({"OK", "Cancel"}, {ok_callback, screen->ExitLoopClosure()});
|
||||
|
||||
auto controls = Renderer(controls_container, [&] {
|
||||
return controls_container->Render() | hcenter | size(HEIGHT, LESS_THAN, 3) | size(WIDTH, GREATER_THAN, 25);
|
||||
|
@ -31,6 +31,7 @@ ftxui_dom_lib = static_library('ftxui_dom',
|
||||
'include/ftxui/dom/node.hpp',
|
||||
'include/ftxui/dom/requirement.hpp',
|
||||
'include/ftxui/dom/take_any_args.hpp',
|
||||
'src/ftxui/dom/automerge.cpp',
|
||||
'src/ftxui/dom/blink.cpp',
|
||||
'src/ftxui/dom/bold.cpp',
|
||||
'src/ftxui/dom/border.cpp',
|
||||
@ -73,17 +74,21 @@ ftxui_dom_lib = static_library('ftxui_dom',
|
||||
|
||||
ftxui_component_lib = static_library('ftxui_component',
|
||||
sources : [
|
||||
'include/ftxui/component/animation.hpp',
|
||||
'include/ftxui/component/captured_mouse.hpp',
|
||||
'include/ftxui/component/component.hpp',
|
||||
'include/ftxui/component/component_base.hpp',
|
||||
'include/ftxui/component/component_options.hpp',
|
||||
'include/ftxui/component/event.hpp',
|
||||
'include/ftxui/component/mouse.hpp',
|
||||
'include/ftxui/component/receiver.hpp',
|
||||
'include/ftxui/component/screen_interactive.hpp',
|
||||
'src/ftxui/component/animation.cpp',
|
||||
'src/ftxui/component/button.cpp',
|
||||
'src/ftxui/component/catch_event.cpp',
|
||||
'src/ftxui/component/checkbox.cpp',
|
||||
'src/ftxui/component/component.cpp',
|
||||
'src/ftxui/component/component_options.cpp',
|
||||
'src/ftxui/component/container.cpp',
|
||||
'src/ftxui/component/dropdown.cpp',
|
||||
'src/ftxui/component/event.cpp',
|
||||
@ -98,7 +103,7 @@ ftxui_component_lib = static_library('ftxui_component',
|
||||
'src/ftxui/component/slider.cpp',
|
||||
'src/ftxui/component/terminal_input_parser.cpp',
|
||||
'src/ftxui/component/terminal_input_parser.hpp',
|
||||
'src/ftxui/component/toggle.cpp'
|
||||
'src/ftxui/component/util.cpp'
|
||||
],
|
||||
include_directories : [ftxui_inc, ftxui_priv_inc],
|
||||
link_with : [ftxui_dom_lib],
|
||||
|
Loading…
Reference in New Issue
Block a user