diff options
-rw-r--r-- | Applications/FileManager/PropertiesDialog.cpp | 18 | ||||
-rw-r--r-- | Applications/FileManager/PropertiesDialog.h | 2 | ||||
-rw-r--r-- | Applications/SystemMonitor/main.cpp | 22 | ||||
-rw-r--r-- | DevTools/HackStudio/main.cpp | 12 | ||||
-rw-r--r-- | Libraries/LibGUI/ColorPicker.cpp | 24 | ||||
-rw-r--r-- | Libraries/LibGUI/TabWidget.h | 4 |
6 files changed, 41 insertions, 41 deletions
diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp index b42e8f9236..97866016b0 100644 --- a/Applications/FileManager/PropertiesDialog.cpp +++ b/Applications/FileManager/PropertiesDialog.cpp @@ -55,14 +55,14 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo auto& tab_widget = main_widget.add<GUI::TabWidget>(); - auto general_tab = tab_widget.add_tab<GUI::Widget>("General"); - general_tab->set_layout<GUI::VerticalBoxLayout>(); - general_tab->layout()->set_margins({ 12, 8, 12, 8 }); - general_tab->layout()->set_spacing(10); + auto& general_tab = tab_widget.add_tab<GUI::Widget>("General"); + general_tab.set_layout<GUI::VerticalBoxLayout>(); + general_tab.layout()->set_margins({ 12, 8, 12, 8 }); + general_tab.layout()->set_spacing(10); - general_tab->layout()->add_spacer(); + general_tab.layout()->add_spacer(); - auto& file_container = general_tab->add<GUI::Widget>(); + auto& file_container = general_tab.add<GUI::Widget>(); file_container.set_layout<GUI::HorizontalBoxLayout>(); file_container.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed); file_container.layout()->set_spacing(20); @@ -129,7 +129,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo make_permission_checkboxes(general_tab, { S_IRGRP, S_IWGRP, S_IXGRP }, "Group:", m_mode); make_permission_checkboxes(general_tab, { S_IROTH, S_IWOTH, S_IXOTH }, "Others:", m_mode); - general_tab->layout()->add_spacer(); + general_tab.layout()->add_spacer(); auto& button_widget = main_widget.add<GUI::Widget>(); button_widget.set_layout<GUI::HorizontalBoxLayout>(); @@ -214,9 +214,9 @@ bool PropertiesDialog::apply_changes() return true; } -void PropertiesDialog::make_permission_checkboxes(NonnullRefPtr<GUI::Widget>& parent, PermissionMasks masks, String label_string, mode_t mode) +void PropertiesDialog::make_permission_checkboxes(GUI::Widget& parent, PermissionMasks masks, String label_string, mode_t mode) { - auto& widget = parent->add<GUI::Widget>(); + auto& widget = parent.add<GUI::Widget>(); widget.set_layout<GUI::HorizontalBoxLayout>(); widget.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed); widget.set_preferred_size(0, 16); diff --git a/Applications/FileManager/PropertiesDialog.h b/Applications/FileManager/PropertiesDialog.h index 69e23a820f..6bb5621936 100644 --- a/Applications/FileManager/PropertiesDialog.h +++ b/Applications/FileManager/PropertiesDialog.h @@ -78,7 +78,7 @@ private: GUI::Button& make_button(String, GUI::Widget& parent); void make_divider(GUI::Widget& parent); void make_property_value_pairs(const Vector<PropertyValuePair>& pairs, GUI::Widget& parent); - void make_permission_checkboxes(NonnullRefPtr<GUI::Widget>& parent, PermissionMasks, String label_string, mode_t mode); + void make_permission_checkboxes(GUI::Widget& parent, PermissionMasks, String label_string, mode_t mode); void permission_changed(mode_t mask, bool set); bool apply_changes(); void update(); diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index da4869d70e..42524dbc42 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -122,9 +122,9 @@ int main(int argc, char** argv) auto& tabwidget = keeper.add<GUI::TabWidget>(); - auto process_container_splitter = tabwidget.add_tab<GUI::VerticalSplitter>("Processes"); + auto& process_container_splitter = tabwidget.add_tab<GUI::VerticalSplitter>("Processes"); - auto& process_table_container = process_container_splitter->add<GUI::Widget>(); + auto& process_table_container = process_container_splitter.add<GUI::Widget>(); tabwidget.add_widget("Graphs", build_graphs_tab()); @@ -228,18 +228,18 @@ int main(int argc, char** argv) app.set_menubar(move(menubar)); - auto& process_tab_widget = process_container_splitter->add<GUI::TabWidget>(); + auto& process_tab_widget = process_container_splitter.add<GUI::TabWidget>(); - auto memory_map_widget = process_tab_widget.add_tab<ProcessMemoryMapWidget>("Memory map"); - auto open_files_widget = process_tab_widget.add_tab<ProcessFileDescriptorMapWidget>("Open files"); - auto unveiled_paths_widget = process_tab_widget.add_tab<ProcessUnveiledPathsWidget>("Unveiled paths"); - auto stacks_widget = process_tab_widget.add_tab<ProcessStacksWidget>("Stacks"); + auto& memory_map_widget = process_tab_widget.add_tab<ProcessMemoryMapWidget>("Memory map"); + auto& open_files_widget = process_tab_widget.add_tab<ProcessFileDescriptorMapWidget>("Open files"); + auto& unveiled_paths_widget = process_tab_widget.add_tab<ProcessUnveiledPathsWidget>("Unveiled paths"); + auto& stacks_widget = process_tab_widget.add_tab<ProcessStacksWidget>("Stacks"); process_table_view.on_process_selected = [&](pid_t pid) { - open_files_widget->set_pid(pid); - stacks_widget->set_pid(pid); - memory_map_widget->set_pid(pid); - unveiled_paths_widget->set_pid(pid); + open_files_widget.set_pid(pid); + stacks_widget.set_pid(pid); + memory_map_widget.set_pid(pid); + unveiled_paths_widget.set_pid(pid); }; window->show(); diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp index 96e25936dd..7f1ec70479 100644 --- a/DevTools/HackStudio/main.cpp +++ b/DevTools/HackStudio/main.cpp @@ -438,7 +438,7 @@ int main(int argc, char** argv) auto reveal_action_tab = [&](auto& widget) { if (s_action_tab_widget->preferred_size().height() < 200) s_action_tab_widget->set_preferred_size(0, 200); - s_action_tab_widget->set_active_widget(widget); + s_action_tab_widget->set_active_widget(&widget); }; auto hide_action_tabs = [&] { @@ -454,8 +454,8 @@ int main(int argc, char** argv) update_actions(); }); - auto find_in_files_widget = s_action_tab_widget->add_tab<FindInFilesWidget>("Find in files"); - auto terminal_wrapper = s_action_tab_widget->add_tab<TerminalWrapper>("Console"); + auto& find_in_files_widget = s_action_tab_widget->add_tab<FindInFilesWidget>("Find in files"); + auto& terminal_wrapper = s_action_tab_widget->add_tab<TerminalWrapper>("Console"); auto& locator = widget.add<Locator>(); @@ -481,16 +481,16 @@ int main(int argc, char** argv) auto edit_menu = GUI::Menu::construct("Edit"); edit_menu->add_action(GUI::Action::create("Find in files...", { Mod_Ctrl | Mod_Shift, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"), [&](auto&) { reveal_action_tab(find_in_files_widget); - find_in_files_widget->focus_textbox_and_select_all(); + find_in_files_widget.focus_textbox_and_select_all(); })); menubar->add_menu(move(edit_menu)); auto stop_action = GUI::Action::create("Stop", Gfx::Bitmap::load_from_file("/res/icons/16x16/stop.png"), [&](auto&) { - terminal_wrapper->kill_running_command(); + terminal_wrapper.kill_running_command(); }); stop_action->set_enabled(false); - terminal_wrapper->on_command_exit = [&] { + terminal_wrapper.on_command_exit = [&] { stop_action->set_enabled(false); }; diff --git a/Libraries/LibGUI/ColorPicker.cpp b/Libraries/LibGUI/ColorPicker.cpp index 1d7fb7a93f..2b4ee5ab2e 100644 --- a/Libraries/LibGUI/ColorPicker.cpp +++ b/Libraries/LibGUI/ColorPicker.cpp @@ -107,21 +107,21 @@ void ColorPicker::build_ui() auto& tab_widget = root_container.add<GUI::TabWidget>(); - auto tab_palette = tab_widget.add_tab<Widget>("Palette"); - tab_palette->set_size_policy(SizePolicy::Fill, SizePolicy::Fill); - tab_palette->set_layout<VerticalBoxLayout>(); - tab_palette->layout()->set_margins({ 4, 4, 4, 4 }); - tab_palette->layout()->set_spacing(4); + auto& tab_palette = tab_widget.add_tab<Widget>("Palette"); + tab_palette.set_size_policy(SizePolicy::Fill, SizePolicy::Fill); + tab_palette.set_layout<VerticalBoxLayout>(); + tab_palette.layout()->set_margins({ 4, 4, 4, 4 }); + tab_palette.layout()->set_spacing(4); - build_ui_palette(*tab_palette); + build_ui_palette(tab_palette); - auto tab_custom_color = tab_widget.add_tab<Widget>("Custom Color"); - tab_custom_color->set_size_policy(SizePolicy::Fill, SizePolicy::Fill); - tab_custom_color->set_layout<VerticalBoxLayout>(); - tab_custom_color->layout()->set_margins({ 4, 4, 4, 4 }); - tab_custom_color->layout()->set_spacing(4); + auto& tab_custom_color = tab_widget.add_tab<Widget>("Custom Color"); + tab_custom_color.set_size_policy(SizePolicy::Fill, SizePolicy::Fill); + tab_custom_color.set_layout<VerticalBoxLayout>(); + tab_custom_color.layout()->set_margins({ 4, 4, 4, 4 }); + tab_custom_color.layout()->set_spacing(4); - build_ui_custom(*tab_custom_color); + build_ui_custom(tab_custom_color); auto& button_container = root_container.add<Widget>(); button_container.set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); diff --git a/Libraries/LibGUI/TabWidget.h b/Libraries/LibGUI/TabWidget.h index e711001d1d..1e9333f155 100644 --- a/Libraries/LibGUI/TabWidget.h +++ b/Libraries/LibGUI/TabWidget.h @@ -55,11 +55,11 @@ public: void add_widget(const StringView&, Widget&); template<class T, class... Args> - inline NonnullRefPtr<T> add_tab(const StringView& title, Args&&... args) + T& add_tab(const StringView& title, Args&&... args) { auto t = T::construct(forward<Args>(args)...); add_widget(title, *t); - return t; + return *t; } protected: |