mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:02:45 +00:00 
			
		
		
		
	Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)
This commit is contained in:
		
							parent
							
								
									86bdfa1edf
								
							
						
					
					
						commit
						a2baab38fd
					
				
					 141 changed files with 518 additions and 518 deletions
				
			
		|  | @ -1 +1 @@ | ||||||
| {"name":"Form1","widgets":[{"enabled":true,"forecolor":"#000000ff","ruler_visible":false,"autofill":false,"x":155,"tooltip":null,"height":121,"width":126,"y":10,"class":"GTextEditor","text":"Hi","backcolor":"#c0c0c0ff","visible":true},{"tooltip":null,"backcolor":"#c0c0c0ff","forecolor":"#000000ff","text":"Okydoky","class":"GButton","autofill":false,"enabled":true,"visible":true,"x":10,"height":21,"y":70,"width":81},{"tooltip":null,"backcolor":"#c0c0c0ff","forecolor":"#000000ff","class":"GGroupBox","autofill":true,"enabled":true,"visible":true,"title":"groupie","x":10,"height":71,"y":100,"width":141},{"tooltip":null,"forecolor":"#000000ff","y":10,"max":100,"autofill":false,"x":10,"min":0,"class":"GProgressBar","backcolor":"#c0c0c0ff","height":21,"enabled":true,"visible":true,"width":136,"value":50},{"tooltip":null,"backcolor":"#c0c0c0ff","forecolor":"#000000ff","text":"Looks like success!","class":"GLabel","autofill":true,"enabled":true,"visible":true,"x":10,"height":26,"y":35,"width":136},{"enabled":true,"forecolor":"#000000ff","checked":false,"autofill":false,"x":160,"tooltip":null,"height":26,"width":91,"y":140,"class":"GCheckBox","text":"checkbox_1","backcolor":"#c0c0c0ff","visible":true},{"enabled":true,"forecolor":"#000000ff","checked":false,"autofill":false,"x":160,"tooltip":null,"height":26,"width":61,"y":160,"class":"GRadioButton","text":"radio_1","backcolor":"#c0c0c0ff","visible":true},{"tooltip":null,"forecolor":"#000000ff","y":125,"max":100,"autofill":false,"x":25,"min":0,"class":"GSlider","backcolor":"#c0c0c0ff","height":26,"enabled":true,"visible":true,"width":116,"value":"60"}]} | {"name":"Form1","widgets":[{"enabled":true,"forecolor":"#000000ff","ruler_visible":false,"autofill":false,"x":155,"tooltip":null,"height":121,"width":126,"y":10,"class":"GTextEditor","text":"Hi","backcolor":"#c0c0c0ff","visible":true},{"tooltip":null,"backcolor":"#c0c0c0ff","forecolor":"#000000ff","text":"Okydoky","class":"GButton","autofill":false,"enabled":true,"visible":true,"x":10,"height":21,"y":70,"width":81},{"tooltip":null,"backcolor":"#c0c0c0ff","forecolor":"#000000ff","class":"GGroupBox","autofill":true,"enabled":true,"visible":true,"title":"groupie","x":10,"height":71,"y":100,"width":141},{"tooltip":null,"forecolor":"#000000ff","y":10,"max":100,"autofill":false,"x":10,"min":0,"class":"GProgressbar","backcolor":"#c0c0c0ff","height":21,"enabled":true,"visible":true,"width":136,"value":50},{"tooltip":null,"backcolor":"#c0c0c0ff","forecolor":"#000000ff","text":"Looks like success!","class":"GLabel","autofill":true,"enabled":true,"visible":true,"x":10,"height":26,"y":35,"width":136},{"enabled":true,"forecolor":"#000000ff","checked":false,"autofill":false,"x":160,"tooltip":null,"height":26,"width":91,"y":140,"class":"GCheckBox","text":"checkbox_1","backcolor":"#c0c0c0ff","visible":true},{"enabled":true,"forecolor":"#000000ff","checked":false,"autofill":false,"x":160,"tooltip":null,"height":26,"width":61,"y":160,"class":"GRadioButton","text":"radio_1","backcolor":"#c0c0c0ff","visible":true},{"tooltip":null,"forecolor":"#000000ff","y":125,"max":100,"autofill":false,"x":25,"min":0,"class":"GSlider","backcolor":"#c0c0c0ff","height":26,"enabled":true,"visible":true,"width":116,"value":"60"}]} | ||||||
|  |  | ||||||
|  | @ -131,7 +131,7 @@ BookmarksBarWidget::BookmarksBarWidget(const String& bookmarks_file, bool enable | ||||||
|         set_visible(false); |         set_visible(false); | ||||||
| 
 | 
 | ||||||
|     m_additional = GUI::Button::construct(); |     m_additional = GUI::Button::construct(); | ||||||
|     m_additional->set_button_style(Gfx::ButtonStyle::CoolBar); |     m_additional->set_button_style(Gfx::ButtonStyle::Coolbar); | ||||||
|     m_additional->set_text(">"); |     m_additional->set_text(">"); | ||||||
|     m_additional->set_fixed_size(14, 20); |     m_additional->set_fixed_size(14, 20); | ||||||
|     m_additional->set_focus_policy(GUI::FocusPolicy::TabFocus); |     m_additional->set_focus_policy(GUI::FocusPolicy::TabFocus); | ||||||
|  | @ -208,7 +208,7 @@ void BookmarksBarWidget::model_did_update(unsigned) | ||||||
|         auto& button = add<GUI::Button>(); |         auto& button = add<GUI::Button>(); | ||||||
|         m_bookmarks.append(button); |         m_bookmarks.append(button); | ||||||
| 
 | 
 | ||||||
|         button.set_button_style(Gfx::ButtonStyle::CoolBar); |         button.set_button_style(Gfx::ButtonStyle::Coolbar); | ||||||
|         button.set_text(title); |         button.set_text(title); | ||||||
|         button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png")); |         button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png")); | ||||||
|         button.set_fixed_size(font().width(title) + 32, 20); |         button.set_fixed_size(font().width(title) + 32, 20); | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ | ||||||
| #include <LibGUI/ImageWidget.h> | #include <LibGUI/ImageWidget.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/ProgressBar.h> | #include <LibGUI/Progressbar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibProtocol/Client.h> | #include <LibProtocol/Client.h> | ||||||
| #include <LibWeb/Loader/ResourceLoader.h> | #include <LibWeb/Loader/ResourceLoader.h> | ||||||
|  | @ -91,8 +91,8 @@ DownloadWidget::DownloadWidget(const URL& url) | ||||||
|     source_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); |     source_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); | ||||||
|     source_label.set_fixed_height(16); |     source_label.set_fixed_height(16); | ||||||
| 
 | 
 | ||||||
|     m_progress_bar = add<GUI::ProgressBar>(); |     m_progressbar = add<GUI::Progressbar>(); | ||||||
|     m_progress_bar->set_fixed_height(20); |     m_progressbar->set_fixed_height(20); | ||||||
| 
 | 
 | ||||||
|     m_progress_label = add<GUI::Label>(); |     m_progress_label = add<GUI::Label>(); | ||||||
|     m_progress_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); |     m_progress_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); | ||||||
|  | @ -127,15 +127,15 @@ DownloadWidget::~DownloadWidget() | ||||||
| 
 | 
 | ||||||
| void DownloadWidget::did_progress(Optional<u32> total_size, u32 downloaded_size) | void DownloadWidget::did_progress(Optional<u32> total_size, u32 downloaded_size) | ||||||
| { | { | ||||||
|     m_progress_bar->set_min(0); |     m_progressbar->set_min(0); | ||||||
|     if (total_size.has_value()) { |     if (total_size.has_value()) { | ||||||
|         int percent = roundf(((float)downloaded_size / (float)total_size.value()) * 100.0f); |         int percent = roundf(((float)downloaded_size / (float)total_size.value()) * 100.0f); | ||||||
|         window()->set_progress(percent); |         window()->set_progress(percent); | ||||||
|         m_progress_bar->set_max(total_size.value()); |         m_progressbar->set_max(total_size.value()); | ||||||
|     } else { |     } else { | ||||||
|         m_progress_bar->set_max(0); |         m_progressbar->set_max(0); | ||||||
|     } |     } | ||||||
|     m_progress_bar->set_value(downloaded_size); |     m_progressbar->set_value(downloaded_size); | ||||||
| 
 | 
 | ||||||
|     { |     { | ||||||
|         StringBuilder builder; |         StringBuilder builder; | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| #include <AK/URL.h> | #include <AK/URL.h> | ||||||
| #include <LibCore/ElapsedTimer.h> | #include <LibCore/ElapsedTimer.h> | ||||||
| #include <LibCore/FileStream.h> | #include <LibCore/FileStream.h> | ||||||
| #include <LibGUI/ProgressBar.h> | #include <LibGUI/Progressbar.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibProtocol/Download.h> | #include <LibProtocol/Download.h> | ||||||
| 
 | 
 | ||||||
|  | @ -50,7 +50,7 @@ private: | ||||||
|     URL m_url; |     URL m_url; | ||||||
|     String m_destination_path; |     String m_destination_path; | ||||||
|     RefPtr<Protocol::Download> m_download; |     RefPtr<Protocol::Download> m_download; | ||||||
|     RefPtr<GUI::ProgressBar> m_progress_bar; |     RefPtr<GUI::Progressbar> m_progressbar; | ||||||
|     RefPtr<GUI::Label> m_progress_label; |     RefPtr<GUI::Label> m_progress_label; | ||||||
|     RefPtr<GUI::Button> m_cancel_button; |     RefPtr<GUI::Button> m_cancel_button; | ||||||
|     RefPtr<GUI::Button> m_close_button; |     RefPtr<GUI::Button> m_close_button; | ||||||
|  |  | ||||||
|  | @ -39,12 +39,12 @@ | ||||||
| #include <LibGUI/Button.h> | #include <LibGUI/Button.h> | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/TabWidget.h> | #include <LibGUI/TabWidget.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibJS/Interpreter.h> | #include <LibJS/Interpreter.h> | ||||||
| #include <LibWeb/Dump.h> | #include <LibWeb/Dump.h> | ||||||
|  | @ -99,8 +99,8 @@ Tab::Tab(Type type) | ||||||
| { | { | ||||||
|     load_from_gml(tab_gml); |     load_from_gml(tab_gml); | ||||||
| 
 | 
 | ||||||
|     m_toolbar_container = *find_descendant_of_type_named<GUI::ToolBarContainer>("toolbar_container"); |     m_toolbar_container = *find_descendant_of_type_named<GUI::ToolbarContainer>("toolbar_container"); | ||||||
|     auto& toolbar = *find_descendant_of_type_named<GUI::ToolBar>("toolbar"); |     auto& toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar"); | ||||||
| 
 | 
 | ||||||
|     auto& webview_container = *find_descendant_of_type_named<GUI::Widget>("webview_container"); |     auto& webview_container = *find_descendant_of_type_named<GUI::Widget>("webview_container"); | ||||||
| 
 | 
 | ||||||
|  | @ -136,7 +136,7 @@ Tab::Tab(Type type) | ||||||
|     })); |     })); | ||||||
| 
 | 
 | ||||||
|     m_bookmark_button = toolbar.add<GUI::Button>(); |     m_bookmark_button = toolbar.add<GUI::Button>(); | ||||||
|     m_bookmark_button->set_button_style(Gfx::ButtonStyle::CoolBar); |     m_bookmark_button->set_button_style(Gfx::ButtonStyle::Coolbar); | ||||||
|     m_bookmark_button->set_focus_policy(GUI::FocusPolicy::TabFocus); |     m_bookmark_button->set_focus_policy(GUI::FocusPolicy::TabFocus); | ||||||
|     m_bookmark_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/bookmark-contour.png")); |     m_bookmark_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/bookmark-contour.png")); | ||||||
|     m_bookmark_button->set_fixed_size(22, 22); |     m_bookmark_button->set_fixed_size(22, 22); | ||||||
|  | @ -280,7 +280,7 @@ Tab::Tab(Type type) | ||||||
|         }, |         }, | ||||||
|         this); |         this); | ||||||
| 
 | 
 | ||||||
|     m_statusbar = *find_descendant_of_type_named<GUI::StatusBar>("statusbar"); |     m_statusbar = *find_descendant_of_type_named<GUI::Statusbar>("statusbar"); | ||||||
| 
 | 
 | ||||||
|     hooks().on_link_hover = [this](auto& url) { |     hooks().on_link_hover = [this](auto& url) { | ||||||
|         if (url.is_valid()) |         if (url.is_valid()) | ||||||
|  | @ -293,7 +293,7 @@ Tab::Tab(Type type) | ||||||
|         load(url); |         load(url); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_menubar = GUI::MenuBar::construct(); |     m_menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = m_menubar->add_menu("&File"); |     auto& app_menu = m_menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(WindowActions::the().create_new_tab_action()); |     app_menu.add_action(WindowActions::the().create_new_tab_action()); | ||||||
|  |  | ||||||
|  | @ -2,10 +2,10 @@ | ||||||
|     layout: @GUI::VerticalBoxLayout { |     layout: @GUI::VerticalBoxLayout { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ToolBarContainer { |     @GUI::ToolbarContainer { | ||||||
|         name: "toolbar_container" |         name: "toolbar_container" | ||||||
| 
 | 
 | ||||||
|         @GUI::ToolBar { |         @GUI::Toolbar { | ||||||
|             name: "toolbar" |             name: "toolbar" | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -16,7 +16,7 @@ | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::StatusBar { |     @GUI::Statusbar { | ||||||
|         name: "statusbar" |         name: "statusbar" | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -103,9 +103,9 @@ private: | ||||||
|     RefPtr<GUI::Button> m_bookmark_button; |     RefPtr<GUI::Button> m_bookmark_button; | ||||||
|     RefPtr<GUI::Window> m_dom_inspector_window; |     RefPtr<GUI::Window> m_dom_inspector_window; | ||||||
|     RefPtr<GUI::Window> m_console_window; |     RefPtr<GUI::Window> m_console_window; | ||||||
|     RefPtr<GUI::StatusBar> m_statusbar; |     RefPtr<GUI::Statusbar> m_statusbar; | ||||||
|     RefPtr<GUI::MenuBar> m_menubar; |     RefPtr<GUI::Menubar> m_menubar; | ||||||
|     RefPtr<GUI::ToolBarContainer> m_toolbar_container; |     RefPtr<GUI::ToolbarContainer> m_toolbar_container; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::Menu> m_link_context_menu; |     RefPtr<GUI::Menu> m_link_context_menu; | ||||||
|     RefPtr<GUI::Action> m_link_context_menu_default_action; |     RefPtr<GUI::Action> m_link_context_menu_default_action; | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
|  | @ -69,7 +69,7 @@ int main(int argc, char** argv) | ||||||
|     window->show(); |     window->show(); | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { |     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { | ||||||
|  |  | ||||||
|  | @ -3,10 +3,10 @@ | ||||||
|     layout: @GUI::VerticalBoxLayout { |     layout: @GUI::VerticalBoxLayout { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ToolBarContainer { |     @GUI::ToolbarContainer { | ||||||
|         name: "toolbar_container" |         name: "toolbar_container" | ||||||
| 
 | 
 | ||||||
|         @GUI::ToolBar { |         @GUI::Toolbar { | ||||||
|             name: "toolbar" |             name: "toolbar" | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -34,9 +34,9 @@ | ||||||
| #include <LibGUI/Calendar.h> | #include <LibGUI/Calendar.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| 
 | 
 | ||||||
|  | @ -71,7 +71,7 @@ int main(int argc, char** argv) | ||||||
|     auto& main_widget = window->set_main_widget<GUI::Widget>(); |     auto& main_widget = window->set_main_widget<GUI::Widget>(); | ||||||
|     main_widget.load_from_gml(calendar_window_gml); |     main_widget.load_from_gml(calendar_window_gml); | ||||||
| 
 | 
 | ||||||
|     auto toolbar = main_widget.find_descendant_of_type_named<GUI::ToolBar>("toolbar"); |     auto toolbar = main_widget.find_descendant_of_type_named<GUI::Toolbar>("toolbar"); | ||||||
|     auto calendar = main_widget.find_descendant_of_type_named<GUI::Calendar>("calendar"); |     auto calendar = main_widget.find_descendant_of_type_named<GUI::Calendar>("calendar"); | ||||||
| 
 | 
 | ||||||
|     auto prev_date_action = GUI::Action::create({}, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"), [&](const GUI::Action&) { |     auto prev_date_action = GUI::Action::create({}, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"), [&](const GUI::Action&) { | ||||||
|  | @ -146,7 +146,7 @@ int main(int argc, char** argv) | ||||||
|         view_month_action->set_checked(true); |         view_month_action->set_checked(true); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(GUI::Action::create("&Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, Gfx::Bitmap::load_from_file("/res/icons/16x16/add-event.png"), |     app_menu.add_action(GUI::Action::create("&Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, Gfx::Bitmap::load_from_file("/res/icons/16x16/add-event.png"), | ||||||
|         [&](const GUI::Action&) { |         [&](const GUI::Action&) { | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ | ||||||
|         @GUI::Button { |         @GUI::Button { | ||||||
|             name: "wallpaper_open_button" |             name: "wallpaper_open_button" | ||||||
|             tooltip: "Select wallpaper from file system." |             tooltip: "Select wallpaper from file system." | ||||||
|             button_style: "CoolBar" |             button_style: "Coolbar" | ||||||
|             fixed_width: 22 |             fixed_width: 22 | ||||||
|             fixed_height: 22 |             fixed_height: 22 | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/TabWidget.h> | #include <LibGUI/TabWidget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
|  | @ -66,7 +66,7 @@ int main(int argc, char** argv) | ||||||
|     window->set_main_widget(tab_widget.ptr()); |     window->set_main_widget(tab_widget.ptr()); | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](const GUI::Action&) { |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](const GUI::Action&) { | ||||||
|  |  | ||||||
|  | @ -4,12 +4,12 @@ | ||||||
|         spacing: 2 |         spacing: 2 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ToolBarContainer { |     @GUI::ToolbarContainer { | ||||||
|         name: "toolbar_container" |         name: "toolbar_container" | ||||||
|         @GUI::ToolBar { |         @GUI::Toolbar { | ||||||
|             name: "main_toolbar" |             name: "main_toolbar" | ||||||
|         } |         } | ||||||
|         @GUI::ToolBar { |         @GUI::Toolbar { | ||||||
|             name: "location_toolbar" |             name: "location_toolbar" | ||||||
|             visible: false |             visible: false | ||||||
| 
 | 
 | ||||||
|  | @ -23,7 +23,7 @@ | ||||||
|                 fixed_height: 22 |                 fixed_height: 22 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         @GUI::ToolBar { |         @GUI::Toolbar { | ||||||
|             name: "breadcrumb_toolbar" |             name: "breadcrumb_toolbar" | ||||||
| 
 | 
 | ||||||
|             @GUI::Label { |             @GUI::Label { | ||||||
|  | @ -31,8 +31,8 @@ | ||||||
|                 autosize: true |                 autosize: true | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             @GUI::BreadcrumbBar { |             @GUI::Breadcrumbbar { | ||||||
|                 name: "breadcrumb_bar" |                 name: "breadcrumbbar" | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -47,10 +47,10 @@ | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::StatusBar { |     @GUI::Statusbar { | ||||||
|         name: "statusbar" |         name: "statusbar" | ||||||
| 
 | 
 | ||||||
|         @GUI::ProgressBar { |         @GUI::Progressbar { | ||||||
|             name: "progressbar" |             name: "progressbar" | ||||||
|             text: "Generating thumbnails: " |             text: "Generating thumbnails: " | ||||||
|             visible: false |             visible: false | ||||||
|  |  | ||||||
|  | @ -36,9 +36,9 @@ | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ProgressBar { |     @GUI::Progressbar { | ||||||
|         fixed_height: 22 |         fixed_height: 22 | ||||||
|         name: "current_file_progress_bar" |         name: "current_file_progressbar" | ||||||
|         min: 0 |         min: 0 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -62,9 +62,9 @@ | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ProgressBar { |     @GUI::Progressbar { | ||||||
|         fixed_height: 22 |         fixed_height: 22 | ||||||
|         name: "overall_progress_bar" |         name: "overall_progressbar" | ||||||
|         min: 0 |         min: 0 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/Button.h> | #include <LibGUI/Button.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/ProgressBar.h> | #include <LibGUI/Progressbar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| 
 | 
 | ||||||
| namespace FileManager { | namespace FileManager { | ||||||
|  | @ -99,17 +99,17 @@ void FileOperationProgressWidget::did_error() | ||||||
| void FileOperationProgressWidget::did_progress([[maybe_unused]] off_t bytes_done, [[maybe_unused]] off_t total_byte_count, size_t files_done, size_t total_file_count, off_t current_file_done, off_t current_file_size, const StringView& current_file_name) | void FileOperationProgressWidget::did_progress([[maybe_unused]] off_t bytes_done, [[maybe_unused]] off_t total_byte_count, size_t files_done, size_t total_file_count, off_t current_file_done, off_t current_file_size, const StringView& current_file_name) | ||||||
| { | { | ||||||
|     auto& current_file_label = *find_descendant_of_type_named<GUI::Label>("current_file_label"); |     auto& current_file_label = *find_descendant_of_type_named<GUI::Label>("current_file_label"); | ||||||
|     auto& current_file_progress_bar = *find_descendant_of_type_named<GUI::ProgressBar>("current_file_progress_bar"); |     auto& current_file_progressbar = *find_descendant_of_type_named<GUI::Progressbar>("current_file_progressbar"); | ||||||
|     auto& overall_progress_label = *find_descendant_of_type_named<GUI::Label>("overall_progress_label"); |     auto& overall_progress_label = *find_descendant_of_type_named<GUI::Label>("overall_progress_label"); | ||||||
|     auto& overall_progress_bar = *find_descendant_of_type_named<GUI::ProgressBar>("overall_progress_bar"); |     auto& overall_progressbar = *find_descendant_of_type_named<GUI::Progressbar>("overall_progressbar"); | ||||||
| 
 | 
 | ||||||
|     current_file_label.set_text(current_file_name); |     current_file_label.set_text(current_file_name); | ||||||
|     current_file_progress_bar.set_max(current_file_size); |     current_file_progressbar.set_max(current_file_size); | ||||||
|     current_file_progress_bar.set_value(current_file_done); |     current_file_progressbar.set_value(current_file_done); | ||||||
| 
 | 
 | ||||||
|     overall_progress_label.set_text(String::formatted("{} of {}", files_done, total_file_count)); |     overall_progress_label.set_text(String::formatted("{} of {}", files_done, total_file_count)); | ||||||
|     overall_progress_bar.set_max(total_file_count); |     overall_progressbar.set_max(total_file_count); | ||||||
|     overall_progress_bar.set_value(files_done); |     overall_progressbar.set_value(files_done); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void FileOperationProgressWidget::close_pipe() | void FileOperationProgressWidget::close_pipe() | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ | ||||||
| #include <LibGUI/ActionGroup.h> | #include <LibGUI/ActionGroup.h> | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
| #include <LibGUI/BreadcrumbBar.h> | #include <LibGUI/Breadcrumbbar.h> | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/Desktop.h> | #include <LibGUI/Desktop.h> | ||||||
| #include <LibGUI/FileIconProvider.h> | #include <LibGUI/FileIconProvider.h> | ||||||
|  | @ -50,15 +50,15 @@ | ||||||
| #include <LibGUI/InputBox.h> | #include <LibGUI/InputBox.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ProgressBar.h> | #include <LibGUI/Progressbar.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/TreeView.h> | #include <LibGUI/TreeView.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  | @ -411,16 +411,16 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | ||||||
| 
 | 
 | ||||||
|     widget.load_from_gml(file_manager_window_gml); |     widget.load_from_gml(file_manager_window_gml); | ||||||
| 
 | 
 | ||||||
|     auto& toolbar_container = *widget.find_descendant_of_type_named<GUI::ToolBarContainer>("toolbar_container"); |     auto& toolbar_container = *widget.find_descendant_of_type_named<GUI::ToolbarContainer>("toolbar_container"); | ||||||
|     auto& main_toolbar = *widget.find_descendant_of_type_named<GUI::ToolBar>("main_toolbar"); |     auto& main_toolbar = *widget.find_descendant_of_type_named<GUI::Toolbar>("main_toolbar"); | ||||||
|     auto& location_toolbar = *widget.find_descendant_of_type_named<GUI::ToolBar>("location_toolbar"); |     auto& location_toolbar = *widget.find_descendant_of_type_named<GUI::Toolbar>("location_toolbar"); | ||||||
|     location_toolbar.layout()->set_margins({ 6, 3, 6, 3 }); |     location_toolbar.layout()->set_margins({ 6, 3, 6, 3 }); | ||||||
| 
 | 
 | ||||||
|     auto& location_textbox = *widget.find_descendant_of_type_named<GUI::TextBox>("location_textbox"); |     auto& location_textbox = *widget.find_descendant_of_type_named<GUI::TextBox>("location_textbox"); | ||||||
| 
 | 
 | ||||||
|     auto& breadcrumb_toolbar = *widget.find_descendant_of_type_named<GUI::ToolBar>("breadcrumb_toolbar"); |     auto& breadcrumb_toolbar = *widget.find_descendant_of_type_named<GUI::Toolbar>("breadcrumb_toolbar"); | ||||||
|     breadcrumb_toolbar.layout()->set_margins({ 6, 0, 6, 0 }); |     breadcrumb_toolbar.layout()->set_margins({ 6, 0, 6, 0 }); | ||||||
|     auto& breadcrumb_bar = *widget.find_descendant_of_type_named<GUI::BreadcrumbBar>("breadcrumb_bar"); |     auto& breadcrumbbar = *widget.find_descendant_of_type_named<GUI::Breadcrumbbar>("breadcrumbbar"); | ||||||
| 
 | 
 | ||||||
|     auto& splitter = *widget.find_descendant_of_type_named<GUI::HorizontalSplitter>("splitter"); |     auto& splitter = *widget.find_descendant_of_type_named<GUI::HorizontalSplitter>("splitter"); | ||||||
|     auto& tree_view = *widget.find_descendant_of_type_named<GUI::TreeView>("tree_view"); |     auto& tree_view = *widget.find_descendant_of_type_named<GUI::TreeView>("tree_view"); | ||||||
|  | @ -446,10 +446,10 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | ||||||
|     // Open the root directory. FIXME: This is awkward.
 |     // Open the root directory. FIXME: This is awkward.
 | ||||||
|     tree_view.toggle_index(directories_model->index(0, 0, {})); |     tree_view.toggle_index(directories_model->index(0, 0, {})); | ||||||
| 
 | 
 | ||||||
|     auto& statusbar = *widget.find_descendant_of_type_named<GUI::StatusBar>("statusbar"); |     auto& statusbar = *widget.find_descendant_of_type_named<GUI::Statusbar>("statusbar"); | ||||||
| 
 | 
 | ||||||
|     auto& progressbar = *widget.find_descendant_of_type_named<GUI::ProgressBar>("progressbar"); |     auto& progressbar = *widget.find_descendant_of_type_named<GUI::Progressbar>("progressbar"); | ||||||
|     progressbar.set_format(GUI::ProgressBar::Format::ValueSlashMax); |     progressbar.set_format(GUI::Progressbar::Format::ValueSlashMax); | ||||||
|     progressbar.set_frame_shape(Gfx::FrameShape::Panel); |     progressbar.set_frame_shape(Gfx::FrameShape::Panel); | ||||||
|     progressbar.set_frame_shadow(Gfx::FrameShadow::Sunken); |     progressbar.set_frame_shadow(Gfx::FrameShadow::Sunken); | ||||||
|     progressbar.set_frame_thickness(1); |     progressbar.set_frame_thickness(1); | ||||||
|  | @ -537,11 +537,11 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | ||||||
| 
 | 
 | ||||||
|     layout_statusbar_action = GUI::Action::create_checkable("&Status Bar", [&](auto& action) { |     layout_statusbar_action = GUI::Action::create_checkable("&Status Bar", [&](auto& action) { | ||||||
|         action.is_checked() ? statusbar.set_visible(true) : statusbar.set_visible(false); |         action.is_checked() ? statusbar.set_visible(true) : statusbar.set_visible(false); | ||||||
|         config->write_bool_entry("Layout", "ShowStatusBar", action.is_checked()); |         config->write_bool_entry("Layout", "ShowStatusbar", action.is_checked()); | ||||||
|         config->sync(); |         config->sync(); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     auto show_statusbar = config->read_bool_entry("Layout", "ShowStatusBar", true); |     auto show_statusbar = config->read_bool_entry("Layout", "ShowStatusbar", true); | ||||||
|     layout_statusbar_action->set_checked(show_statusbar); |     layout_statusbar_action->set_checked(show_statusbar); | ||||||
|     statusbar.set_visible(show_statusbar); |     statusbar.set_visible(show_statusbar); | ||||||
| 
 | 
 | ||||||
|  | @ -751,7 +751,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | ||||||
|         refresh_tree_view(); |         refresh_tree_view(); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(mkdir_action); |     app_menu.add_action(mkdir_action); | ||||||
|  | @ -845,20 +845,20 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | ||||||
|         { |         { | ||||||
|             LexicalPath lexical_path(new_path); |             LexicalPath lexical_path(new_path); | ||||||
| 
 | 
 | ||||||
|             auto segment_index_of_new_path_in_breadcrumb_bar = [&]() -> Optional<size_t> { |             auto segment_index_of_new_path_in_breadcrumbbar = [&]() -> Optional<size_t> { | ||||||
|                 for (size_t i = 0; i < breadcrumb_bar.segment_count(); ++i) { |                 for (size_t i = 0; i < breadcrumbbar.segment_count(); ++i) { | ||||||
|                     if (breadcrumb_bar.segment_data(i) == new_path) |                     if (breadcrumbbar.segment_data(i) == new_path) | ||||||
|                         return i; |                         return i; | ||||||
|                 } |                 } | ||||||
|                 return {}; |                 return {}; | ||||||
|             }(); |             }(); | ||||||
| 
 | 
 | ||||||
|             if (segment_index_of_new_path_in_breadcrumb_bar.has_value()) { |             if (segment_index_of_new_path_in_breadcrumbbar.has_value()) { | ||||||
|                 breadcrumb_bar.set_selected_segment(segment_index_of_new_path_in_breadcrumb_bar.value()); |                 breadcrumbbar.set_selected_segment(segment_index_of_new_path_in_breadcrumbbar.value()); | ||||||
|             } else { |             } else { | ||||||
|                 breadcrumb_bar.clear_segments(); |                 breadcrumbbar.clear_segments(); | ||||||
| 
 | 
 | ||||||
|                 breadcrumb_bar.append_segment("/", GUI::FileIconProvider::icon_for_path("/").bitmap_for_size(16), "/", "/"); |                 breadcrumbbar.append_segment("/", GUI::FileIconProvider::icon_for_path("/").bitmap_for_size(16), "/", "/"); | ||||||
|                 StringBuilder builder; |                 StringBuilder builder; | ||||||
| 
 | 
 | ||||||
|                 for (auto& part : lexical_path.parts()) { |                 for (auto& part : lexical_path.parts()) { | ||||||
|  | @ -866,13 +866,13 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | ||||||
|                     builder.append('/'); |                     builder.append('/'); | ||||||
|                     builder.append(part); |                     builder.append(part); | ||||||
| 
 | 
 | ||||||
|                     breadcrumb_bar.append_segment(part, GUI::FileIconProvider::icon_for_path(builder.string_view()).bitmap_for_size(16), builder.string_view(), builder.string_view()); |                     breadcrumbbar.append_segment(part, GUI::FileIconProvider::icon_for_path(builder.string_view()).bitmap_for_size(16), builder.string_view(), builder.string_view()); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 breadcrumb_bar.set_selected_segment(breadcrumb_bar.segment_count() - 1); |                 breadcrumbbar.set_selected_segment(breadcrumbbar.segment_count() - 1); | ||||||
| 
 | 
 | ||||||
|                 breadcrumb_bar.on_segment_click = [&](size_t segment_index) { |                 breadcrumbbar.on_segment_click = [&](size_t segment_index) { | ||||||
|                     directory_view.open(breadcrumb_bar.segment_data(segment_index)); |                     directory_view.open(breadcrumbbar.segment_data(segment_index)); | ||||||
|                 }; |                 }; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | @ -1045,18 +1045,18 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio | ||||||
|             refresh_tree_view(); |             refresh_tree_view(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     breadcrumb_bar.on_segment_drop = [&](size_t segment_index, const GUI::DropEvent& event) { |     breadcrumbbar.on_segment_drop = [&](size_t segment_index, const GUI::DropEvent& event) { | ||||||
|         if (!event.mime_data().has_urls()) |         if (!event.mime_data().has_urls()) | ||||||
|             return; |             return; | ||||||
|         copy_urls_to_directory(event.mime_data().urls(), breadcrumb_bar.segment_data(segment_index)); |         copy_urls_to_directory(event.mime_data().urls(), breadcrumbbar.segment_data(segment_index)); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     breadcrumb_bar.on_segment_drag_enter = [&](size_t, GUI::DragEvent& event) { |     breadcrumbbar.on_segment_drag_enter = [&](size_t, GUI::DragEvent& event) { | ||||||
|         if (event.mime_types().contains_slow("text/uri-list")) |         if (event.mime_types().contains_slow("text/uri-list")) | ||||||
|             event.accept(); |             event.accept(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     breadcrumb_bar.on_doubleclick = [&](const GUI::MouseEvent&) { |     breadcrumbbar.on_doubleclick = [&](const GUI::MouseEvent&) { | ||||||
|         go_to_location_action->activate(); |         go_to_location_action->activate(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -43,13 +43,13 @@ | ||||||
| #include <LibGUI/GroupBox.h> | #include <LibGUI/GroupBox.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/SpinBox.h> | #include <LibGUI/SpinBox.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/BitmapFont.h> | #include <LibGfx/BitmapFont.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
|  | @ -99,8 +99,8 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::BitmapFont>&& | ||||||
| { | { | ||||||
|     load_from_gml(font_editor_window_gml); |     load_from_gml(font_editor_window_gml); | ||||||
| 
 | 
 | ||||||
|     auto& toolbar = *find_descendant_of_type_named<GUI::ToolBar>("toolbar"); |     auto& toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar"); | ||||||
|     auto& status_bar = *find_descendant_of_type_named<GUI::StatusBar>("status_bar"); |     auto& statusbar = *find_descendant_of_type_named<GUI::Statusbar>("statusbar"); | ||||||
|     auto& glyph_map_container = *find_descendant_of_type_named<GUI::Widget>("glyph_map_container"); |     auto& glyph_map_container = *find_descendant_of_type_named<GUI::Widget>("glyph_map_container"); | ||||||
|     m_glyph_editor_container = *find_descendant_of_type_named<GUI::Widget>("glyph_editor_container"); |     m_glyph_editor_container = *find_descendant_of_type_named<GUI::Widget>("glyph_editor_container"); | ||||||
|     m_left_column_container = *find_descendant_of_type_named<GUI::Widget>("left_column_container"); |     m_left_column_container = *find_descendant_of_type_named<GUI::Widget>("left_column_container"); | ||||||
|  | @ -256,7 +256,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::BitmapFont>&& | ||||||
|         } |         } | ||||||
|         builder.append(") "); |         builder.append(") "); | ||||||
|         builder.appendff("[{}x{}]", m_edited_font->glyph_width(glyph), m_edited_font->glyph_height()); |         builder.appendff("[{}x{}]", m_edited_font->glyph_width(glyph), m_edited_font->glyph_height()); | ||||||
|         status_bar.set_text(builder.to_string()); |         statusbar.set_text(builder.to_string()); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_name_textbox->on_change = [&] { |     m_name_textbox->on_change = [&] { | ||||||
|  | @ -378,7 +378,7 @@ void FontEditorWidget::initialize(const String& path, RefPtr<Gfx::BitmapFont>&& | ||||||
|         on_initialize(); |         on_initialize(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void FontEditorWidget::initialize_menubar(GUI::MenuBar& menubar) | void FontEditorWidget::initialize_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& app_menu = menubar.add_menu("&File"); |     auto& app_menu = menubar.add_menu("&File"); | ||||||
|     app_menu.add_action(*m_new_action); |     app_menu.add_action(*m_new_action); | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ public: | ||||||
|     const String& path() { return m_path; } |     const String& path() { return m_path; } | ||||||
|     const Gfx::BitmapFont& edited_font() { return *m_edited_font; } |     const Gfx::BitmapFont& edited_font() { return *m_edited_font; } | ||||||
|     void initialize(const String& path, RefPtr<Gfx::BitmapFont>&&); |     void initialize(const String& path, RefPtr<Gfx::BitmapFont>&&); | ||||||
|     void initialize_menubar(GUI::MenuBar&); |     void initialize_menubar(GUI::Menubar&); | ||||||
| 
 | 
 | ||||||
|     bool is_showing_font_metadata() { return m_font_metadata; } |     bool is_showing_font_metadata() { return m_font_metadata; } | ||||||
|     void set_show_font_metadata(bool b); |     void set_show_font_metadata(bool b); | ||||||
|  |  | ||||||
|  | @ -3,10 +3,10 @@ | ||||||
|     layout: @GUI::VerticalBoxLayout { |     layout: @GUI::VerticalBoxLayout { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ToolBarContainer { |     @GUI::ToolbarContainer { | ||||||
|         name: "toolbar_container" |         name: "toolbar_container" | ||||||
| 
 | 
 | ||||||
|         @GUI::ToolBar { |         @GUI::Toolbar { | ||||||
|             name: "toolbar" |             name: "toolbar" | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -205,7 +205,7 @@ | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::StatusBar { |     @GUI::Statusbar { | ||||||
|         name: "status_bar" |         name: "statusbar" | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ | ||||||
| #include <LibDesktop/Launcher.h> | #include <LibDesktop/Launcher.h> | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/BitmapFont.h> | #include <LibGfx/BitmapFont.h> | ||||||
|  | @ -98,7 +98,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto& font_editor = window->set_main_widget<FontEditorWidget>(path, move(edited_font)); |     auto& font_editor = window->set_main_widget<FontEditorWidget>(path, move(edited_font)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     font_editor.initialize_menubar(menubar); |     font_editor.initialize_menubar(menubar); | ||||||
|     window->set_menubar(move(menubar)); |     window->set_menubar(move(menubar)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -36,13 +36,13 @@ | ||||||
| #include <LibGUI/FilteringProxyModel.h> | #include <LibGUI/FilteringProxyModel.h> | ||||||
| #include <LibGUI/ListView.h> | #include <LibGUI/ListView.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
| #include <LibGUI/TabWidget.h> | #include <LibGUI/TabWidget.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/TreeView.h> | #include <LibGUI/TreeView.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibMarkdown/Document.h> | #include <LibMarkdown/Document.h> | ||||||
|  | @ -107,8 +107,8 @@ int main(int argc, char* argv[]) | ||||||
|     widget.set_fill_with_background_color(true); |     widget.set_fill_with_background_color(true); | ||||||
|     widget.layout()->set_spacing(2); |     widget.layout()->set_spacing(2); | ||||||
| 
 | 
 | ||||||
|     auto& toolbar_container = widget.add<GUI::ToolBarContainer>(); |     auto& toolbar_container = widget.add<GUI::ToolbarContainer>(); | ||||||
|     auto& toolbar = toolbar_container.add<GUI::ToolBar>(); |     auto& toolbar = toolbar_container.add<GUI::Toolbar>(); | ||||||
| 
 | 
 | ||||||
|     auto& splitter = widget.add<GUI::HorizontalSplitter>(); |     auto& splitter = widget.add<GUI::HorizontalSplitter>(); | ||||||
| 
 | 
 | ||||||
|  | @ -272,7 +272,7 @@ int main(int argc, char* argv[]) | ||||||
|     toolbar.add_action(*go_forward_action); |     toolbar.add_action(*go_forward_action); | ||||||
|     toolbar.add_action(*go_home_action); |     toolbar.add_action(*go_home_action); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_about_action("Help", app_icon, window)); |     app_menu.add_action(GUI::CommonActions::make_about_action("Help", app_icon, window)); | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/FontDatabase.h> | #include <LibGfx/FontDatabase.h> | ||||||
|  |  | ||||||
|  | @ -35,12 +35,12 @@ | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/InputBox.h> | #include <LibGUI/InputBox.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <string.h> | #include <string.h> | ||||||
| 
 | 
 | ||||||
|  | @ -67,7 +67,7 @@ HexEditorWidget::HexEditorWidget() | ||||||
|             update_title(); |             update_title(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_statusbar = add<GUI::StatusBar>(5); |     m_statusbar = add<GUI::Statusbar>(5); | ||||||
| 
 | 
 | ||||||
|     m_new_action = GUI::Action::create("New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"), [this](const GUI::Action&) { |     m_new_action = GUI::Action::create("New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"), [this](const GUI::Action&) { | ||||||
|         if (m_document_dirty) { |         if (m_document_dirty) { | ||||||
|  | @ -135,7 +135,7 @@ HexEditorWidget::~HexEditorWidget() | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HexEditorWidget::initialize_menubar(GUI::MenuBar& menubar) | void HexEditorWidget::initialize_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& app_menu = menubar.add_menu("File"); |     auto& app_menu = menubar.add_menu("File"); | ||||||
|     app_menu.add_action(*m_new_action); |     app_menu.add_action(*m_new_action); | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ class HexEditorWidget final : public GUI::Widget { | ||||||
| public: | public: | ||||||
|     virtual ~HexEditorWidget() override; |     virtual ~HexEditorWidget() override; | ||||||
|     void open_file(const String& path); |     void open_file(const String& path); | ||||||
|     void initialize_menubar(GUI::MenuBar&); |     void initialize_menubar(GUI::Menubar&); | ||||||
|     bool request_close(); |     bool request_close(); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|  | @ -69,7 +69,7 @@ private: | ||||||
| 
 | 
 | ||||||
|     GUI::ActionGroup m_bytes_per_row_actions; |     GUI::ActionGroup m_bytes_per_row_actions; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::StatusBar> m_statusbar; |     RefPtr<GUI::Statusbar> m_statusbar; | ||||||
| 
 | 
 | ||||||
|     bool m_document_dirty { false }; |     bool m_document_dirty { false }; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #include "HexEditorWidget.h" | #include "HexEditorWidget.h" | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -59,7 +59,7 @@ int main(int argc, char** argv) | ||||||
|         return GUI::Window::CloseRequestDecision::StayOpen; |         return GUI::Window::CloseRequestDecision::StayOpen; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     hex_editor_widget.initialize_menubar(menubar); |     hex_editor_widget.initialize_menubar(menubar); | ||||||
|     window->set_menubar(menubar); |     window->set_menubar(menubar); | ||||||
|     window->show(); |     window->show(); | ||||||
|  |  | ||||||
|  | @ -33,12 +33,12 @@ | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
| #include <LibGUI/InputBox.h> | #include <LibGUI/InputBox.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
| #include <LibGUI/StackWidget.h> | #include <LibGUI/StackWidget.h> | ||||||
| #include <LibGUI/TableView.h> | #include <LibGUI/TableView.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| 
 | 
 | ||||||
| static IRCAppWindow* s_the; | static IRCAppWindow* s_the; | ||||||
| 
 | 
 | ||||||
|  | @ -257,7 +257,7 @@ void IRCAppWindow::setup_actions() | ||||||
| 
 | 
 | ||||||
| void IRCAppWindow::setup_menus() | void IRCAppWindow::setup_menus() | ||||||
| { | { | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { |     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { | ||||||
|         dbgln("Terminal: Quit menu activated!"); |         dbgln("Terminal: Quit menu activated!"); | ||||||
|  | @ -307,8 +307,8 @@ void IRCAppWindow::setup_widgets() | ||||||
|     widget.set_layout<GUI::VerticalBoxLayout>(); |     widget.set_layout<GUI::VerticalBoxLayout>(); | ||||||
|     widget.layout()->set_spacing(0); |     widget.layout()->set_spacing(0); | ||||||
| 
 | 
 | ||||||
|     auto& toolbar_container = widget.add<GUI::ToolBarContainer>(); |     auto& toolbar_container = widget.add<GUI::ToolbarContainer>(); | ||||||
|     auto& toolbar = toolbar_container.add<GUI::ToolBar>(); |     auto& toolbar = toolbar_container.add<GUI::Toolbar>(); | ||||||
|     toolbar.set_has_frame(false); |     toolbar.set_has_frame(false); | ||||||
|     toolbar.add_action(*m_change_nick_action); |     toolbar.add_action(*m_change_nick_action); | ||||||
|     toolbar.add_separator(); |     toolbar.add_separator(); | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| 
 | 
 | ||||||
| int main(int argc, char** argv) | int main(int argc, char** argv) | ||||||
|  | @ -104,7 +104,7 @@ int main(int argc, char** argv) | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|     // Menu
 |     // Menu
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(open_action); |     app_menu.add_action(open_action); | ||||||
|  |  | ||||||
|  | @ -37,7 +37,7 @@ | ||||||
| #include <LibGUI/ComboBox.h> | #include <LibGUI/ComboBox.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/WindowServerConnection.h> | #include <LibGUI/WindowServerConnection.h> | ||||||
| #include <LibKeyboard/CharacterMap.h> | #include <LibKeyboard/CharacterMap.h> | ||||||
|  | @ -186,7 +186,7 @@ int main(int argc, char** argv) | ||||||
|             app->quit(); |             app->quit(); | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(quit_action); |     app_menu.add_action(quit_action); | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| 
 | 
 | ||||||
| int main(int argc, char** argv) | int main(int argc, char** argv) | ||||||
|  | @ -56,7 +56,7 @@ int main(int argc, char** argv) | ||||||
|     window->set_minimizable(false); |     window->set_minimizable(false); | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { | ||||||
|         app->quit(); |         app->quit(); | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ | ||||||
| #include "RollWidget.h" | #include "RollWidget.h" | ||||||
| #include "TrackManager.h" | #include "TrackManager.h" | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGfx/Font.h> | #include <LibGfx/Font.h> | ||||||
| #include <LibGfx/FontDatabase.h> | #include <LibGfx/FontDatabase.h> | ||||||
| #include <math.h> | #include <math.h> | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
|  | @ -104,7 +104,7 @@ int main(int argc, char** argv) | ||||||
|     }); |     }); | ||||||
|     audio_thread->start(); |     audio_thread->start(); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, [&](const GUI::Action&) { |     app_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, [&](const GUI::Action&) { | ||||||
|  |  | ||||||
|  | @ -44,7 +44,7 @@ | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
|  | @ -114,7 +114,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     window->show(); |     window->show(); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& file_menu = menubar->add_menu("&File"); |     auto& file_menu = menubar->add_menu("&File"); | ||||||
| 
 | 
 | ||||||
|     auto open_image_file = [&](auto& path) { |     auto open_image_file = [&](auto& path) { | ||||||
|  |  | ||||||
|  | @ -37,10 +37,10 @@ | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
|  | @ -97,8 +97,8 @@ int main(int argc, char** argv) | ||||||
|     root_widget.set_layout<GUI::VerticalBoxLayout>(); |     root_widget.set_layout<GUI::VerticalBoxLayout>(); | ||||||
|     root_widget.layout()->set_spacing(2); |     root_widget.layout()->set_spacing(2); | ||||||
| 
 | 
 | ||||||
|     auto& toolbar_container = root_widget.add<GUI::ToolBarContainer>(); |     auto& toolbar_container = root_widget.add<GUI::ToolbarContainer>(); | ||||||
|     auto& main_toolbar = toolbar_container.add<GUI::ToolBar>(); |     auto& main_toolbar = toolbar_container.add<GUI::Toolbar>(); | ||||||
| 
 | 
 | ||||||
|     auto& widget = root_widget.add<QSWidget>(); |     auto& widget = root_widget.add<QSWidget>(); | ||||||
|     widget.on_scale_change = [&](int scale, Gfx::IntRect rect) { |     widget.on_scale_change = [&](int scale, Gfx::IntRect rect) { | ||||||
|  | @ -270,7 +270,7 @@ int main(int argc, char** argv) | ||||||
|     main_toolbar.add_action(zoom_reset_action); |     main_toolbar.add_action(zoom_reset_action); | ||||||
|     main_toolbar.add_action(zoom_out_action); |     main_toolbar.add_action(zoom_out_action); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(open_action); |     app_menu.add_action(open_action); | ||||||
|  |  | ||||||
|  | @ -38,8 +38,8 @@ | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Slider.h> | #include <LibGUI/Slider.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| 
 | 
 | ||||||
|  | @ -75,8 +75,8 @@ SoundPlayerWidgetAdvancedView::SoundPlayerWidgetAdvancedView(GUI::Window& window | ||||||
|         this->manager().seek(value); |         this->manager().seek(value); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     auto& toolbar_container = m_player_view->add<GUI::ToolBarContainer>(); |     auto& toolbar_container = m_player_view->add<GUI::ToolbarContainer>(); | ||||||
|     auto& menubar = toolbar_container.add<GUI::ToolBar>(); |     auto& menubar = toolbar_container.add<GUI::Toolbar>(); | ||||||
| 
 | 
 | ||||||
|     m_play_button = menubar.add<GUI::Button>(); |     m_play_button = menubar.add<GUI::Button>(); | ||||||
|     m_play_button->set_icon(is_paused() ? (!has_loaded_file() ? *m_play_icon : *m_pause_icon) : *m_pause_icon); |     m_play_button->set_icon(is_paused() ? (!has_loaded_file() ? *m_play_icon : *m_pause_icon) : *m_pause_icon); | ||||||
|  |  | ||||||
|  | @ -33,7 +33,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/CharacterBitmap.h> | #include <LibGfx/CharacterBitmap.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
|  | @ -78,7 +78,7 @@ int main(int argc, char** argv) | ||||||
|     window->set_title("Sound Player"); |     window->set_title("Sound Player"); | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -3,10 +3,10 @@ | ||||||
|         spacing: 0 |         spacing: 0 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ToolBarContainer { |     @GUI::ToolbarContainer { | ||||||
|         @GUI::BreadcrumbBar { |         @GUI::Breadcrumbbar { | ||||||
|             fixed_height: 25 |             fixed_height: 25 | ||||||
|             name: "breadcrumb_bar" |             name: "breadcrumbbar" | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -14,7 +14,7 @@ | ||||||
|         name: "tree_map" |         name: "tree_map" | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::StatusBar { |     @GUI::Statusbar { | ||||||
|         name: "status_bar" |         name: "statusbar" | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -35,13 +35,13 @@ | ||||||
| #include <LibDesktop/Launcher.h> | #include <LibDesktop/Launcher.h> | ||||||
| #include <LibGUI/AboutDialog.h> | #include <LibGUI/AboutDialog.h> | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/BreadcrumbBar.h> | #include <LibGUI/Breadcrumbbar.h> | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <sys/stat.h> | #include <sys/stat.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| 
 | 
 | ||||||
|  | @ -209,7 +209,7 @@ static void populate_filesize_tree(TreeNode& root, Vector<MountInfo>& mounts, Ha | ||||||
|     update_totals(root); |     update_totals(root); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void analyze(RefPtr<Tree> tree, SpaceAnalyzer::TreeMapWidget& treemapwidget, GUI::StatusBar& statusbar) | static void analyze(RefPtr<Tree> tree, SpaceAnalyzer::TreeMapWidget& treemapwidget, GUI::Statusbar& statusbar) | ||||||
| { | { | ||||||
|     // Build an in-memory tree mirroring the filesystem and for each node
 |     // Build an in-memory tree mirroring the filesystem and for each node
 | ||||||
|     // calculate the sum of the file size for all its descendants.
 |     // calculate the sum of the file size for all its descendants.
 | ||||||
|  | @ -285,12 +285,12 @@ int main(int argc, char* argv[]) | ||||||
|     // Load widgets.
 |     // Load widgets.
 | ||||||
|     auto& mainwidget = window->set_main_widget<GUI::Widget>(); |     auto& mainwidget = window->set_main_widget<GUI::Widget>(); | ||||||
|     mainwidget.load_from_gml(space_analyzer_gml); |     mainwidget.load_from_gml(space_analyzer_gml); | ||||||
|     auto& breadcrumbbar = *mainwidget.find_descendant_of_type_named<GUI::BreadcrumbBar>("breadcrumb_bar"); |     auto& breadcrumbbar = *mainwidget.find_descendant_of_type_named<GUI::Breadcrumbbar>("breadcrumbbar"); | ||||||
|     auto& treemapwidget = *mainwidget.find_descendant_of_type_named<SpaceAnalyzer::TreeMapWidget>("tree_map"); |     auto& treemapwidget = *mainwidget.find_descendant_of_type_named<SpaceAnalyzer::TreeMapWidget>("tree_map"); | ||||||
|     auto& statusbar = *mainwidget.find_descendant_of_type_named<GUI::StatusBar>("status_bar"); |     auto& statusbar = *mainwidget.find_descendant_of_type_named<GUI::Statusbar>("statusbar"); | ||||||
| 
 | 
 | ||||||
|     // Configure the menubar.
 |     // Configure the menubar.
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::Action::create("Analyze", [&](auto&) { |     app_menu.add_action(GUI::Action::create("Analyze", [&](auto&) { | ||||||
|         analyze(tree, treemapwidget, statusbar); |         analyze(tree, treemapwidget, statusbar); | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/ModelEditingDelegate.h> | #include <LibGUI/ModelEditingDelegate.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/TableView.h> | #include <LibGUI/TableView.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -110,7 +110,7 @@ int main(int argc, char* argv[]) | ||||||
|     if (filename) |     if (filename) | ||||||
|         spreadsheet_widget.load(filename); |         spreadsheet_widget.load(filename); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
| 
 | 
 | ||||||
|     app_menu.add_action(GUI::Action::create("Add New Sheet", Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"), [&](auto&) { |     app_menu.add_action(GUI::Action::create("Add New Sheet", Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"), [&](auto&) { | ||||||
|  |  | ||||||
|  | @ -49,15 +49,15 @@ | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/LazyWidget.h> | #include <LibGUI/LazyWidget.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/SeparatorWidget.h> | #include <LibGUI/SeparatorWidget.h> | ||||||
| #include <LibGUI/SortingProxyModel.h> | #include <LibGUI/SortingProxyModel.h> | ||||||
| #include <LibGUI/StackWidget.h> | #include <LibGUI/StackWidget.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/TabWidget.h> | #include <LibGUI/TabWidget.h> | ||||||
| #include <LibGUI/TableView.h> | #include <LibGUI/TableView.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/FontDatabase.h> | #include <LibGfx/FontDatabase.h> | ||||||
|  | @ -76,7 +76,7 @@ static NonnullRefPtr<GUI::Widget> build_devices_tab(); | ||||||
| static NonnullRefPtr<GUI::Widget> build_graphs_tab(); | static NonnullRefPtr<GUI::Widget> build_graphs_tab(); | ||||||
| static NonnullRefPtr<GUI::Widget> build_processors_tab(); | static NonnullRefPtr<GUI::Widget> build_processors_tab(); | ||||||
| 
 | 
 | ||||||
| static RefPtr<GUI::StatusBar> statusbar; | static RefPtr<GUI::Statusbar> statusbar; | ||||||
| 
 | 
 | ||||||
| class UnavailableProcessWidget final : public GUI::Frame { | class UnavailableProcessWidget final : public GUI::Frame { | ||||||
|     C_OBJECT(UnavailableProcessWidget) |     C_OBJECT(UnavailableProcessWidget) | ||||||
|  | @ -192,7 +192,7 @@ int main(int argc, char** argv) | ||||||
|     tabwidget_container.layout()->set_margins({ 4, 0, 4, 4 }); |     tabwidget_container.layout()->set_margins({ 4, 0, 4, 4 }); | ||||||
|     auto& tabwidget = tabwidget_container.add<GUI::TabWidget>(); |     auto& tabwidget = tabwidget_container.add<GUI::TabWidget>(); | ||||||
| 
 | 
 | ||||||
|     statusbar = main_widget.add<GUI::StatusBar>(3); |     statusbar = main_widget.add<GUI::Statusbar>(3); | ||||||
| 
 | 
 | ||||||
|     auto process_model = ProcessModel::create(); |     auto process_model = ProcessModel::create(); | ||||||
|     process_model->on_state_update = [&](int process_count, int thread_count) { |     process_model->on_state_update = [&](int process_count, int thread_count) { | ||||||
|  | @ -340,7 +340,7 @@ int main(int argc, char** argv) | ||||||
|         }, |         }, | ||||||
|         &process_table_view); |         &process_table_view); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { |     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { | ||||||
|         GUI::Application::the()->quit(); |         GUI::Application::the()->quit(); | ||||||
|  | @ -408,9 +408,9 @@ int main(int argc, char** argv) | ||||||
|     return app->exec(); |     return app->exec(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| class ProgressBarPaintingDelegate final : public GUI::TableCellPaintingDelegate { | class ProgressbarPaintingDelegate final : public GUI::TableCellPaintingDelegate { | ||||||
| public: | public: | ||||||
|     virtual ~ProgressBarPaintingDelegate() override { } |     virtual ~ProgressbarPaintingDelegate() override { } | ||||||
| 
 | 
 | ||||||
|     virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Palette& palette, const GUI::ModelIndex& index) override |     virtual void paint(GUI::Painter& painter, const Gfx::IntRect& a_rect, const Palette& palette, const GUI::ModelIndex& index) override | ||||||
|     { |     { | ||||||
|  | @ -421,7 +421,7 @@ public: | ||||||
|         String text; |         String text; | ||||||
|         if (data.is_string()) |         if (data.is_string()) | ||||||
|             text = data.as_string(); |             text = data.as_string(); | ||||||
|         Gfx::StylePainter::paint_progress_bar(painter, rect, palette, 0, 100, percentage, text); |         Gfx::StylePainter::paint_progressbar(painter, rect, palette, 0, 100, percentage, text); | ||||||
|         painter.draw_rect(rect, Color::Black); |         painter.draw_rect(rect, Color::Black); | ||||||
|     } |     } | ||||||
| }; | }; | ||||||
|  | @ -580,7 +580,7 @@ NonnullRefPtr<GUI::Widget> build_file_systems_tab() | ||||||
|         df_fields.empend("block_size", "Block size", Gfx::TextAlignment::CenterRight); |         df_fields.empend("block_size", "Block size", Gfx::TextAlignment::CenterRight); | ||||||
|         fs_table_view.set_model(GUI::SortingProxyModel::create(GUI::JsonArrayModel::create("/proc/df", move(df_fields)))); |         fs_table_view.set_model(GUI::SortingProxyModel::create(GUI::JsonArrayModel::create("/proc/df", move(df_fields)))); | ||||||
| 
 | 
 | ||||||
|         fs_table_view.set_column_painting_delegate(3, make<ProgressBarPaintingDelegate>()); |         fs_table_view.set_column_painting_delegate(3, make<ProgressbarPaintingDelegate>()); | ||||||
| 
 | 
 | ||||||
|         fs_table_view.model()->update(); |         fs_table_view.model()->update(); | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|  | @ -41,7 +41,7 @@ | ||||||
| #include <LibGUI/GroupBox.h> | #include <LibGUI/GroupBox.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/OpacitySlider.h> | #include <LibGUI/OpacitySlider.h> | ||||||
| #include <LibGUI/RadioButton.h> | #include <LibGUI/RadioButton.h> | ||||||
| #include <LibGUI/SpinBox.h> | #include <LibGUI/SpinBox.h> | ||||||
|  | @ -426,7 +426,7 @@ int main(int argc, char** argv) | ||||||
|     terminal.context_menu().add_separator(); |     terminal.context_menu().add_separator(); | ||||||
|     terminal.context_menu().add_action(open_settings_action); |     terminal.context_menu().add_action(open_settings_action); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"), [&](auto&) { |     app_menu.add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"), [&](auto&) { | ||||||
|  |  | ||||||
|  | @ -47,15 +47,15 @@ | ||||||
| #include <LibGUI/GroupBox.h> | #include <LibGUI/GroupBox.h> | ||||||
| #include <LibGUI/INISyntaxHighlighter.h> | #include <LibGUI/INISyntaxHighlighter.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/RegularEditingEngine.h> | #include <LibGUI/RegularEditingEngine.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/VimEditingEngine.h> | #include <LibGUI/VimEditingEngine.h> | ||||||
| #include <LibGfx/Font.h> | #include <LibGfx/Font.h> | ||||||
| #include <LibJS/SyntaxHighlighter.h> | #include <LibJS/SyntaxHighlighter.h> | ||||||
|  | @ -69,8 +69,8 @@ TextEditorWidget::TextEditorWidget() | ||||||
| 
 | 
 | ||||||
|     m_config = Core::ConfigFile::get_for_app("TextEditor"); |     m_config = Core::ConfigFile::get_for_app("TextEditor"); | ||||||
| 
 | 
 | ||||||
|     m_toolbar = *find_descendant_of_type_named<GUI::ToolBar>("toolbar"); |     m_toolbar = *find_descendant_of_type_named<GUI::Toolbar>("toolbar"); | ||||||
|     m_toolbar_container = *find_descendant_of_type_named<GUI::ToolBarContainer>("toolbar_container"); |     m_toolbar_container = *find_descendant_of_type_named<GUI::ToolbarContainer>("toolbar_container"); | ||||||
| 
 | 
 | ||||||
|     m_editor = *find_descendant_of_type_named<GUI::TextEditor>("editor"); |     m_editor = *find_descendant_of_type_named<GUI::TextEditor>("editor"); | ||||||
|     m_editor->set_ruler_visible(true); |     m_editor->set_ruler_visible(true); | ||||||
|  | @ -272,7 +272,7 @@ TextEditorWidget::TextEditorWidget() | ||||||
|     m_editor->add_custom_context_menu_action(*m_find_next_action); |     m_editor->add_custom_context_menu_action(*m_find_next_action); | ||||||
|     m_editor->add_custom_context_menu_action(*m_find_previous_action); |     m_editor->add_custom_context_menu_action(*m_find_previous_action); | ||||||
| 
 | 
 | ||||||
|     m_statusbar = *find_descendant_of_type_named<GUI::StatusBar>("statusbar"); |     m_statusbar = *find_descendant_of_type_named<GUI::Statusbar>("statusbar"); | ||||||
| 
 | 
 | ||||||
|     m_editor->on_cursor_change = [this] { update_statusbar(); }; |     m_editor->on_cursor_change = [this] { update_statusbar(); }; | ||||||
|     m_editor->on_selection_change = [this] { update_statusbar(); }; |     m_editor->on_selection_change = [this] { update_statusbar(); }; | ||||||
|  | @ -359,7 +359,7 @@ TextEditorWidget::~TextEditorWidget() | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void TextEditorWidget::initialize_menubar(GUI::MenuBar& menubar) | void TextEditorWidget::initialize_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& app_menu = menubar.add_menu("&File"); |     auto& app_menu = menubar.add_menu("&File"); | ||||||
|     app_menu.add_action(*m_new_action); |     app_menu.add_action(*m_new_action); | ||||||
|  | @ -423,10 +423,10 @@ void TextEditorWidget::initialize_menubar(GUI::MenuBar& menubar) | ||||||
| 
 | 
 | ||||||
|     m_layout_statusbar_action = GUI::Action::create_checkable("&Status Bar", [&](auto& action) { |     m_layout_statusbar_action = GUI::Action::create_checkable("&Status Bar", [&](auto& action) { | ||||||
|         action.is_checked() ? m_statusbar->set_visible(true) : m_statusbar->set_visible(false); |         action.is_checked() ? m_statusbar->set_visible(true) : m_statusbar->set_visible(false); | ||||||
|         m_config->write_bool_entry("Layout", "ShowStatusBar", action.is_checked()); |         m_config->write_bool_entry("Layout", "ShowStatusbar", action.is_checked()); | ||||||
|         m_config->sync(); |         m_config->sync(); | ||||||
|     }); |     }); | ||||||
|     auto show_statusbar = m_config->read_bool_entry("Layout", "ShowStatusBar", true); |     auto show_statusbar = m_config->read_bool_entry("Layout", "ShowStatusbar", true); | ||||||
|     m_layout_statusbar_action->set_checked(show_statusbar); |     m_layout_statusbar_action->set_checked(show_statusbar); | ||||||
|     m_statusbar->set_visible(show_statusbar); |     m_statusbar->set_visible(show_statusbar); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -55,7 +55,7 @@ public: | ||||||
|     void set_auto_detect_preview_mode(bool value) { m_auto_detect_preview_mode = value; } |     void set_auto_detect_preview_mode(bool value) { m_auto_detect_preview_mode = value; } | ||||||
| 
 | 
 | ||||||
|     void update_title(); |     void update_title(); | ||||||
|     void initialize_menubar(GUI::MenuBar&); |     void initialize_menubar(GUI::Menubar&); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     TextEditorWidget(); |     TextEditorWidget(); | ||||||
|  | @ -92,9 +92,9 @@ private: | ||||||
|     RefPtr<GUI::Action> m_markdown_preview_action; |     RefPtr<GUI::Action> m_markdown_preview_action; | ||||||
|     RefPtr<GUI::Action> m_html_preview_action; |     RefPtr<GUI::Action> m_html_preview_action; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::ToolBar> m_toolbar; |     RefPtr<GUI::Toolbar> m_toolbar; | ||||||
|     RefPtr<GUI::ToolBarContainer> m_toolbar_container; |     RefPtr<GUI::ToolbarContainer> m_toolbar_container; | ||||||
|     RefPtr<GUI::StatusBar> m_statusbar; |     RefPtr<GUI::Statusbar> m_statusbar; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::TextBox> m_find_textbox; |     RefPtr<GUI::TextBox> m_find_textbox; | ||||||
|     RefPtr<GUI::TextBox> m_replace_textbox; |     RefPtr<GUI::TextBox> m_replace_textbox; | ||||||
|  |  | ||||||
|  | @ -6,10 +6,10 @@ | ||||||
|         spacing: 2 |         spacing: 2 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ToolBarContainer { |     @GUI::ToolbarContainer { | ||||||
|         name: "toolbar_container" |         name: "toolbar_container" | ||||||
| 
 | 
 | ||||||
|         @GUI::ToolBar { |         @GUI::Toolbar { | ||||||
|             name: "toolbar" |             name: "toolbar" | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -105,7 +105,7 @@ | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::StatusBar { |     @GUI::Statusbar { | ||||||
|         name: "statusbar" |         name: "statusbar" | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #include "TextEditorWidget.h" | #include "TextEditorWidget.h" | ||||||
| #include <LibCore/ArgsParser.h> | #include <LibCore/ArgsParser.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -85,7 +85,7 @@ int main(int argc, char** argv) | ||||||
|         return 1; |         return 1; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     text_widget.initialize_menubar(menubar); |     text_widget.initialize_menubar(menubar); | ||||||
|     window->set_menubar(menubar); |     window->set_menubar(menubar); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/CheckBox.h> | #include <LibGUI/CheckBox.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/RadioButton.h> | #include <LibGUI/RadioButton.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <LibGfx/WindowTheme.h> | #include <LibGfx/WindowTheme.h> | ||||||
|  | @ -65,7 +65,7 @@ private: | ||||||
|         m_checkbox->set_text("Check box"); |         m_checkbox->set_text("Check box"); | ||||||
|         m_radio = add<GUI::RadioButton>(); |         m_radio = add<GUI::RadioButton>(); | ||||||
|         m_radio->set_text("Radio button"); |         m_radio->set_text("Radio button"); | ||||||
|         m_statusbar = add<GUI::StatusBar>(); |         m_statusbar = add<GUI::Statusbar>(); | ||||||
|         m_statusbar->set_text("Status bar"); |         m_statusbar->set_text("Status bar"); | ||||||
|         m_editor = add<GUI::TextEditor>(); |         m_editor = add<GUI::TextEditor>(); | ||||||
|         m_editor->set_text("Text editor\nwith multiple\nlines."); |         m_editor->set_text("Text editor\nwith multiple\nlines."); | ||||||
|  | @ -84,7 +84,7 @@ private: | ||||||
|     RefPtr<GUI::Button> m_button; |     RefPtr<GUI::Button> m_button; | ||||||
|     RefPtr<GUI::CheckBox> m_checkbox; |     RefPtr<GUI::CheckBox> m_checkbox; | ||||||
|     RefPtr<GUI::RadioButton> m_radio; |     RefPtr<GUI::RadioButton> m_radio; | ||||||
|     RefPtr<GUI::StatusBar> m_statusbar; |     RefPtr<GUI::Statusbar> m_statusbar; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| PreviewWidget::PreviewWidget(const Gfx::Palette& preview_palette) | PreviewWidget::PreviewWidget(const Gfx::Palette& preview_palette) | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  | @ -233,7 +233,7 @@ int main(int argc, char** argv) | ||||||
|     root_widget.set_layout<GUI::VerticalBoxLayout>(); |     root_widget.set_layout<GUI::VerticalBoxLayout>(); | ||||||
|     root_widget.layout()->set_spacing(0); |     root_widget.layout()->set_spacing(0); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); | ||||||
|     auto& help_menu = menubar->add_menu("Help"); |     auto& help_menu = menubar->add_menu("Help"); | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  | @ -263,7 +263,7 @@ int main(int argc, char** argv) | ||||||
|     auto app_icon = GUI::Icon::default_icon("app-cube"); |     auto app_icon = GUI::Icon::default_icon("app-cube"); | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     auto show_window_frame_action = GUI::Action::create_checkable("Show window frame", [&](auto& action) { |     auto show_window_frame_action = GUI::Action::create_checkable("Show window frame", [&](auto& action) { | ||||||
|         cube.set_show_window_frame(action.is_checked()); |         cube.set_show_window_frame(action.is_checked()); | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -99,7 +99,7 @@ int main(int argc, char* argv[]) | ||||||
| 
 | 
 | ||||||
|     auto& eyes = window->set_main_widget<EyesWidget>(num_eyes, full_rows, extra_columns); |     auto& eyes = window->set_main_widget<EyesWidget>(num_eyes, full_rows, extra_columns); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ | ||||||
| #include <LibGUI/Frame.h> | #include <LibGUI/Frame.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
|  | @ -198,7 +198,7 @@ int main(int argc, char** argv) | ||||||
|     auto& main_widget = window->set_main_widget<MainFrame>(); |     auto& main_widget = window->set_main_widget<MainFrame>(); | ||||||
|     main_widget.set_fill_with_background_color(true); |     main_widget.set_fill_with_background_color(true); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -58,7 +58,7 @@ DemoWizardDialog::DemoWizardDialog(GUI::Window* parent_window) | ||||||
|         "Installation in progress...", |         "Installation in progress...", | ||||||
|         "Please wait. Do not turn off your computer."); |         "Please wait. Do not turn off your computer."); | ||||||
|     m_page_2->body_widget().load_from_gml(demo_wizard_page_2_gml); |     m_page_2->body_widget().load_from_gml(demo_wizard_page_2_gml); | ||||||
|     m_page_2_progress_bar = m_page_2->body_widget().find_descendant_of_type_named<GUI::ProgressBar>("page_2_progress_bar"); |     m_page_2_progressbar = m_page_2->body_widget().find_descendant_of_type_named<GUI::Progressbar>("page_2_progressbar"); | ||||||
|     m_page_2_timer = Core::Timer::construct(this); |     m_page_2_timer = Core::Timer::construct(this); | ||||||
|     m_page_2->on_page_enter = [&]() { |     m_page_2->on_page_enter = [&]() { | ||||||
|         m_page_2_progress_value = 0; |         m_page_2_progress_value = 0; | ||||||
|  | @ -71,7 +71,7 @@ DemoWizardDialog::DemoWizardDialog(GUI::Window* parent_window) | ||||||
|     m_page_2_timer->on_timeout = [&]() { |     m_page_2_timer->on_timeout = [&]() { | ||||||
|         if (m_page_2_progress_value < 100) |         if (m_page_2_progress_value < 100) | ||||||
|             m_page_2_progress_value++; |             m_page_2_progress_value++; | ||||||
|         m_page_2_progress_bar->set_value(m_page_2_progress_value); |         m_page_2_progressbar->set_value(m_page_2_progress_value); | ||||||
| 
 | 
 | ||||||
|         // Go to final page on progress completion
 |         // Go to final page on progress completion
 | ||||||
|         if (m_page_2_progress_value == 100) { |         if (m_page_2_progress_value == 100) { | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/ProgressBar.h> | #include <LibGUI/Progressbar.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGUI/Wizards/CoverWizardPage.h> | #include <LibGUI/Wizards/CoverWizardPage.h> | ||||||
|  | @ -47,7 +47,7 @@ private: | ||||||
|     RefPtr<GUI::TextBox> m_page_1_location_text_box; |     RefPtr<GUI::TextBox> m_page_1_location_text_box; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::WizardPage> m_page_2; |     RefPtr<GUI::WizardPage> m_page_2; | ||||||
|     RefPtr<GUI::ProgressBar> m_page_2_progress_bar; |     RefPtr<GUI::Progressbar> m_page_2_progressbar; | ||||||
|     int m_page_2_progress_value { 0 }; |     int m_page_2_progress_value { 0 }; | ||||||
|     RefPtr<Core::Timer> m_page_2_timer; |     RefPtr<Core::Timer> m_page_2_timer; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -9,8 +9,8 @@ | ||||||
|         fixed_height: 32 |         fixed_height: 32 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @GUI::ProgressBar { |     @GUI::Progressbar { | ||||||
|         name: "page_2_progress_bar" |         name: "page_2_progressbar" | ||||||
|         fixed_height: 28 |         fixed_height: 28 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -126,15 +126,15 @@ | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "enabled_coolbar_button" |                     name: "enabled_coolbar_button" | ||||||
|                     text: "CoolBar button" |                     text: "Coolbar button" | ||||||
|                     button_style: "CoolBar" |                     button_style: "Coolbar" | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Button { |                 @GUI::Button { | ||||||
|                     name: "disabled_coolbar_button" |                     name: "disabled_coolbar_button" | ||||||
|                     text: "Disabled" |                     text: "Disabled" | ||||||
|                     enabled: "false" |                     enabled: "false" | ||||||
|                     button_style: "CoolBar" |                     button_style: "Coolbar" | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 @GUI::Widget { |                 @GUI::Widget { | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ | ||||||
|         @GUI::Widget { |         @GUI::Widget { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::ScrollBar { |         @GUI::Scrollbar { | ||||||
|             name: "enabled_scrollbar" |             name: "enabled_scrollbar" | ||||||
|             fixed_height: 16 |             fixed_height: 16 | ||||||
|             fixed_width: -1 |             fixed_width: -1 | ||||||
|  | @ -60,7 +60,7 @@ | ||||||
|         @GUI::Widget { |         @GUI::Widget { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::ScrollBar { |         @GUI::Scrollbar { | ||||||
|             name: "disabled_scrollbar" |             name: "disabled_scrollbar" | ||||||
|             fixed_height: 16 |             fixed_height: 16 | ||||||
|             fixed_width: -1 |             fixed_width: -1 | ||||||
|  | @ -75,7 +75,7 @@ | ||||||
|             margins: [8, 8, 8, 8] |             margins: [8, 8, 8, 8] | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::VerticalProgressBar { |         @GUI::VerticalProgressbar { | ||||||
|             name: "vertical_progressbar_left" |             name: "vertical_progressbar_left" | ||||||
|             fixed_width: 36 |             fixed_width: 36 | ||||||
|         } |         } | ||||||
|  | @ -103,7 +103,7 @@ | ||||||
|         @GUI::VerticalSeparator { |         @GUI::VerticalSeparator { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::VerticalProgressBar { |         @GUI::VerticalProgressbar { | ||||||
|             name: "vertical_progressbar_right" |             name: "vertical_progressbar_right" | ||||||
|             fixed_width: 36 |             fixed_width: 36 | ||||||
|         } |         } | ||||||
|  | @ -160,7 +160,7 @@ | ||||||
|         @GUI::HorizontalSeparator { |         @GUI::HorizontalSeparator { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         @GUI::HorizontalProgressBar { |         @GUI::HorizontalProgressbar { | ||||||
|             name: "horizontal_progressbar" |             name: "horizontal_progressbar" | ||||||
|             fixed_height: 20 |             fixed_height: 20 | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -191,10 +191,10 @@ GalleryWidget::GalleryWidget() | ||||||
|     auto& sliders_tab = tab_widget.add_tab<GUI::Widget>("Sliders"); |     auto& sliders_tab = tab_widget.add_tab<GUI::Widget>("Sliders"); | ||||||
|     sliders_tab.load_from_gml(sliders_tab_gml); |     sliders_tab.load_from_gml(sliders_tab_gml); | ||||||
| 
 | 
 | ||||||
|     m_vertical_progressbar_left = sliders_tab.find_descendant_of_type_named<GUI::VerticalProgressBar>("vertical_progressbar_left"); |     m_vertical_progressbar_left = sliders_tab.find_descendant_of_type_named<GUI::VerticalProgressbar>("vertical_progressbar_left"); | ||||||
|     m_vertical_progressbar_left->set_value(0); |     m_vertical_progressbar_left->set_value(0); | ||||||
| 
 | 
 | ||||||
|     m_vertical_progressbar_right = sliders_tab.find_descendant_of_type_named<GUI::VerticalProgressBar>("vertical_progressbar_right"); |     m_vertical_progressbar_right = sliders_tab.find_descendant_of_type_named<GUI::VerticalProgressbar>("vertical_progressbar_right"); | ||||||
|     m_vertical_progressbar_right->set_value(100); |     m_vertical_progressbar_right->set_value(100); | ||||||
| 
 | 
 | ||||||
|     m_vertical_slider_left = sliders_tab.find_descendant_of_type_named<GUI::VerticalSlider>("vertical_slider_left"); |     m_vertical_slider_left = sliders_tab.find_descendant_of_type_named<GUI::VerticalSlider>("vertical_slider_left"); | ||||||
|  | @ -208,7 +208,7 @@ GalleryWidget::GalleryWidget() | ||||||
|         m_vertical_progressbar_right->set_value((100 / m_vertical_slider_right->max()) * (m_vertical_slider_right->max() - value)); |         m_vertical_progressbar_right->set_value((100 / m_vertical_slider_right->max()) * (m_vertical_slider_right->max() - value)); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_horizontal_progressbar = sliders_tab.find_descendant_of_type_named<GUI::HorizontalProgressBar>("horizontal_progressbar"); |     m_horizontal_progressbar = sliders_tab.find_descendant_of_type_named<GUI::HorizontalProgressbar>("horizontal_progressbar"); | ||||||
|     m_horizontal_progressbar->set_value(0); |     m_horizontal_progressbar->set_value(0); | ||||||
| 
 | 
 | ||||||
|     m_horizontal_slider_left = sliders_tab.find_descendant_of_type_named<GUI::HorizontalSlider>("horizontal_slider_left"); |     m_horizontal_slider_left = sliders_tab.find_descendant_of_type_named<GUI::HorizontalSlider>("horizontal_slider_left"); | ||||||
|  | @ -225,10 +225,10 @@ GalleryWidget::GalleryWidget() | ||||||
|         m_horizontal_slider_left->set_value((value * 100) / m_horizontal_slider_right->max()); |         m_horizontal_slider_left->set_value((value * 100) / m_horizontal_slider_right->max()); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_enabled_scrollbar = sliders_tab.find_descendant_of_type_named<GUI::ScrollBar>("enabled_scrollbar"); |     m_enabled_scrollbar = sliders_tab.find_descendant_of_type_named<GUI::Scrollbar>("enabled_scrollbar"); | ||||||
|     m_enabled_scrollbar->set_orientation(Orientation::Horizontal); |     m_enabled_scrollbar->set_orientation(Orientation::Horizontal); | ||||||
| 
 | 
 | ||||||
|     m_disabled_scrollbar = sliders_tab.find_descendant_of_type_named<GUI::ScrollBar>("disabled_scrollbar"); |     m_disabled_scrollbar = sliders_tab.find_descendant_of_type_named<GUI::Scrollbar>("disabled_scrollbar"); | ||||||
|     m_disabled_scrollbar->set_orientation(Orientation::Horizontal); |     m_disabled_scrollbar->set_orientation(Orientation::Horizontal); | ||||||
| 
 | 
 | ||||||
|     m_opacity_imagewidget = sliders_tab.find_descendant_of_type_named<GUI::ImageWidget>("opacity_imagewidget"); |     m_opacity_imagewidget = sliders_tab.find_descendant_of_type_named<GUI::ImageWidget>("opacity_imagewidget"); | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/ImageWidget.h> | #include <LibGUI/ImageWidget.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/OpacitySlider.h> | #include <LibGUI/OpacitySlider.h> | ||||||
| #include <LibGUI/ProgressBar.h> | #include <LibGUI/Progressbar.h> | ||||||
| #include <LibGUI/Slider.h> | #include <LibGUI/Slider.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
|  | @ -61,12 +61,12 @@ private: | ||||||
|     RefPtr<GUI::HorizontalSlider> m_horizontal_slider_left; |     RefPtr<GUI::HorizontalSlider> m_horizontal_slider_left; | ||||||
|     RefPtr<GUI::HorizontalSlider> m_horizontal_slider_right; |     RefPtr<GUI::HorizontalSlider> m_horizontal_slider_right; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::VerticalProgressBar> m_vertical_progressbar_left; |     RefPtr<GUI::VerticalProgressbar> m_vertical_progressbar_left; | ||||||
|     RefPtr<GUI::VerticalProgressBar> m_vertical_progressbar_right; |     RefPtr<GUI::VerticalProgressbar> m_vertical_progressbar_right; | ||||||
|     RefPtr<GUI::HorizontalProgressBar> m_horizontal_progressbar; |     RefPtr<GUI::HorizontalProgressbar> m_horizontal_progressbar; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::ScrollBar> m_enabled_scrollbar; |     RefPtr<GUI::Scrollbar> m_enabled_scrollbar; | ||||||
|     RefPtr<GUI::ScrollBar> m_disabled_scrollbar; |     RefPtr<GUI::Scrollbar> m_disabled_scrollbar; | ||||||
| 
 | 
 | ||||||
|     RefPtr<GUI::TextEditor> m_text_editor; |     RefPtr<GUI::TextEditor> m_text_editor; | ||||||
|     RefPtr<GUI::TextEditor> m_wizard_output; |     RefPtr<GUI::TextEditor> m_wizard_output; | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| 
 | 
 | ||||||
|  | @ -75,7 +75,7 @@ int main(int argc, char** argv) | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
|     window->set_main_widget<GalleryWidget>(); |     window->set_main_widget<GalleryWidget>(); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); | ||||||
|  |  | ||||||
|  | @ -72,8 +72,8 @@ void DebugInfoWidget::init_toolbar() | ||||||
| DebugInfoWidget::DebugInfoWidget() | DebugInfoWidget::DebugInfoWidget() | ||||||
| { | { | ||||||
|     set_layout<GUI::VerticalBoxLayout>(); |     set_layout<GUI::VerticalBoxLayout>(); | ||||||
|     auto& toolbar_container = add<GUI::ToolBarContainer>(); |     auto& toolbar_container = add<GUI::ToolbarContainer>(); | ||||||
|     m_toolbar = toolbar_container.add<GUI::ToolBar>(); |     m_toolbar = toolbar_container.add<GUI::Toolbar>(); | ||||||
|     init_toolbar(); |     init_toolbar(); | ||||||
|     auto& bottom_box = add<GUI::Widget>(); |     auto& bottom_box = add<GUI::Widget>(); | ||||||
|     bottom_box.set_layout<GUI::HorizontalBoxLayout>(); |     bottom_box.set_layout<GUI::HorizontalBoxLayout>(); | ||||||
|  |  | ||||||
|  | @ -33,8 +33,8 @@ | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/TableView.h> | #include <LibGUI/TableView.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/TreeView.h> | #include <LibGUI/TreeView.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <sys/arch/i386/regs.h> | #include <sys/arch/i386/regs.h> | ||||||
|  | @ -61,7 +61,7 @@ private: | ||||||
|     RefPtr<GUI::TableView> m_registers_view; |     RefPtr<GUI::TableView> m_registers_view; | ||||||
|     RefPtr<GUI::ListView> m_backtrace_view; |     RefPtr<GUI::ListView> m_backtrace_view; | ||||||
|     RefPtr<GUI::Menu> m_variable_context_menu; |     RefPtr<GUI::Menu> m_variable_context_menu; | ||||||
|     RefPtr<GUI::ToolBar> m_toolbar; |     RefPtr<GUI::Toolbar> m_toolbar; | ||||||
|     RefPtr<GUI::Action> m_continue_action; |     RefPtr<GUI::Action> m_continue_action; | ||||||
|     RefPtr<GUI::Action> m_singlestep_action; |     RefPtr<GUI::Action> m_singlestep_action; | ||||||
|     RefPtr<GUI::Action> m_step_in_action; |     RefPtr<GUI::Action> m_step_in_action; | ||||||
|  |  | ||||||
|  | @ -42,7 +42,7 @@ | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibJS/SyntaxHighlighter.h> | #include <LibJS/SyntaxHighlighter.h> | ||||||
| #include <LibMarkdown/Document.h> | #include <LibMarkdown/Document.h> | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| #include <LibDiff/Hunks.h> | #include <LibDiff/Hunks.h> | ||||||
| #include <LibGUI/AbstractView.h> | #include <LibGUI/AbstractView.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGfx/Color.h> | #include <LibGfx/Color.h> | ||||||
| #include <LibGfx/Font.h> | #include <LibGfx/Font.h> | ||||||
| #include <LibGfx/FontDatabase.h> | #include <LibGfx/FontDatabase.h> | ||||||
|  |  | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
| #include "GitFilesView.h" | #include "GitFilesView.h" | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
| namespace HackStudio { | namespace HackStudio { | ||||||
|  |  | ||||||
|  | @ -66,7 +66,7 @@ | ||||||
| #include <LibGUI/ItemListModel.h> | #include <LibGUI/ItemListModel.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/RegularEditingEngine.h> | #include <LibGUI/RegularEditingEngine.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
|  | @ -75,8 +75,8 @@ | ||||||
| #include <LibGUI/TableView.h> | #include <LibGUI/TableView.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/TextEditor.h> | #include <LibGUI/TextEditor.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGUI/ToolBarContainer.h> | #include <LibGUI/ToolbarContainer.h> | ||||||
| #include <LibGUI/TreeView.h> | #include <LibGUI/TreeView.h> | ||||||
| #include <LibGUI/VimEditingEngine.h> | #include <LibGUI/VimEditingEngine.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
|  | @ -103,7 +103,7 @@ HackStudioWidget::HackStudioWidget(const String& path_to_project) | ||||||
| 
 | 
 | ||||||
|     open_project(path_to_project); |     open_project(path_to_project); | ||||||
| 
 | 
 | ||||||
|     auto& toolbar_container = add<GUI::ToolBarContainer>(); |     auto& toolbar_container = add<GUI::ToolbarContainer>(); | ||||||
| 
 | 
 | ||||||
|     auto& outer_splitter = add<GUI::HorizontalSplitter>(); |     auto& outer_splitter = add<GUI::HorizontalSplitter>(); | ||||||
| 
 | 
 | ||||||
|  | @ -785,7 +785,7 @@ void HackStudioWidget::create_form_editor(GUI::Widget& parent) | ||||||
| { | { | ||||||
|     m_form_inner_container = parent.add<GUI::Widget>(); |     m_form_inner_container = parent.add<GUI::Widget>(); | ||||||
|     m_form_inner_container->set_layout<GUI::HorizontalBoxLayout>(); |     m_form_inner_container->set_layout<GUI::HorizontalBoxLayout>(); | ||||||
|     auto& form_widgets_toolbar = m_form_inner_container->add<GUI::ToolBar>(Orientation::Vertical, 26); |     auto& form_widgets_toolbar = m_form_inner_container->add<GUI::Toolbar>(Orientation::Vertical, 26); | ||||||
|     form_widgets_toolbar.set_fixed_width(38); |     form_widgets_toolbar.set_fixed_width(38); | ||||||
| 
 | 
 | ||||||
|     GUI::ActionGroup tool_actions; |     GUI::ActionGroup tool_actions; | ||||||
|  | @ -868,7 +868,7 @@ void HackStudioWidget::create_form_editor(GUI::Widget& parent) | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::create_toolbar(GUI::Widget& parent) | void HackStudioWidget::create_toolbar(GUI::Widget& parent) | ||||||
| { | { | ||||||
|     auto& toolbar = parent.add<GUI::ToolBar>(); |     auto& toolbar = parent.add<GUI::Toolbar>(); | ||||||
|     toolbar.add_action(*m_new_file_action); |     toolbar.add_action(*m_new_file_action); | ||||||
|     toolbar.add_action(*m_new_directory_action); |     toolbar.add_action(*m_new_directory_action); | ||||||
|     toolbar.add_action(*m_save_action); |     toolbar.add_action(*m_save_action); | ||||||
|  | @ -950,7 +950,7 @@ void HackStudioWidget::create_project_tab(GUI::Widget& parent) | ||||||
|     }; |     }; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::create_app_menubar(GUI::MenuBar& menubar) | void HackStudioWidget::create_app_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& file_menu = menubar.add_menu("&File"); |     auto& file_menu = menubar.add_menu("&File"); | ||||||
|     file_menu.add_action(*m_new_project_action); |     file_menu.add_action(*m_new_project_action); | ||||||
|  | @ -962,7 +962,7 @@ void HackStudioWidget::create_app_menubar(GUI::MenuBar& menubar) | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::create_project_menubar(GUI::MenuBar& menubar) | void HackStudioWidget::create_project_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& project_menu = menubar.add_menu("&Project"); |     auto& project_menu = menubar.add_menu("&Project"); | ||||||
|     project_menu.add_action(*m_new_file_action); |     project_menu.add_action(*m_new_file_action); | ||||||
|  | @ -971,7 +971,7 @@ void HackStudioWidget::create_project_menubar(GUI::MenuBar& menubar) | ||||||
|     project_menu.add_action(*create_set_autocomplete_mode_action()); |     project_menu.add_action(*create_set_autocomplete_mode_action()); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::create_edit_menubar(GUI::MenuBar& menubar) | void HackStudioWidget::create_edit_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& edit_menu = menubar.add_menu("&Edit"); |     auto& edit_menu = menubar.add_menu("&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"), [this](auto&) { |     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"), [this](auto&) { | ||||||
|  | @ -991,7 +991,7 @@ void HackStudioWidget::create_edit_menubar(GUI::MenuBar& menubar) | ||||||
|     edit_menu.add_action(vim_emulation_setting_action); |     edit_menu.add_action(vim_emulation_setting_action); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::create_build_menubar(GUI::MenuBar& menubar) | void HackStudioWidget::create_build_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& build_menu = menubar.add_menu("&Build"); |     auto& build_menu = menubar.add_menu("&Build"); | ||||||
|     build_menu.add_action(*m_build_action); |     build_menu.add_action(*m_build_action); | ||||||
|  | @ -1002,7 +1002,7 @@ void HackStudioWidget::create_build_menubar(GUI::MenuBar& menubar) | ||||||
|     build_menu.add_action(*m_debug_action); |     build_menu.add_action(*m_debug_action); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::create_view_menubar(GUI::MenuBar& menubar) | void HackStudioWidget::create_view_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto hide_action_tabs_action = GUI::Action::create("&Hide Action Tabs", { Mod_Ctrl | Mod_Shift, Key_X }, [this](auto&) { |     auto hide_action_tabs_action = GUI::Action::create("&Hide Action Tabs", { Mod_Ctrl | Mod_Shift, Key_X }, [this](auto&) { | ||||||
|         hide_action_tabs(); |         hide_action_tabs(); | ||||||
|  | @ -1048,7 +1048,7 @@ void HackStudioWidget::create_view_menubar(GUI::MenuBar& menubar) | ||||||
|     view_menu.add_action(*m_remove_current_terminal_action); |     view_menu.add_action(*m_remove_current_terminal_action); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::create_help_menubar(GUI::MenuBar& menubar) | void HackStudioWidget::create_help_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     auto& help_menu = menubar.add_menu("Help"); |     auto& help_menu = menubar.add_menu("Help"); | ||||||
|     help_menu.add_action(GUI::CommonActions::make_about_action("Hack Studio", GUI::Icon::default_icon("app-hack-studio"), window())); |     help_menu.add_action(GUI::CommonActions::make_about_action("Hack Studio", GUI::Icon::default_icon("app-hack-studio"), window())); | ||||||
|  | @ -1073,7 +1073,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_set_autocomplete_mode_action | ||||||
|     return action; |     return action; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void HackStudioWidget::initialize_menubar(GUI::MenuBar& menubar) | void HackStudioWidget::initialize_menubar(GUI::Menubar& menubar) | ||||||
| { | { | ||||||
|     create_app_menubar(menubar); |     create_app_menubar(menubar); | ||||||
|     create_project_menubar(menubar); |     create_project_menubar(menubar); | ||||||
|  |  | ||||||
|  | @ -41,7 +41,7 @@ | ||||||
| #include "ProjectFile.h" | #include "ProjectFile.h" | ||||||
| #include "TerminalWrapper.h" | #include "TerminalWrapper.h" | ||||||
| #include <LibGUI/ActionGroup.h> | #include <LibGUI/ActionGroup.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibThread/Thread.h> | #include <LibThread/Thread.h> | ||||||
|  | @ -62,7 +62,7 @@ public: | ||||||
|     void set_current_editor_wrapper(RefPtr<EditorWrapper>); |     void set_current_editor_wrapper(RefPtr<EditorWrapper>); | ||||||
| 
 | 
 | ||||||
|     String currently_open_file() const { return m_currently_open_file; } |     String currently_open_file() const { return m_currently_open_file; } | ||||||
|     void initialize_menubar(GUI::MenuBar&); |     void initialize_menubar(GUI::Menubar&); | ||||||
| 
 | 
 | ||||||
|     Locator& locator() |     Locator& locator() | ||||||
|     { |     { | ||||||
|  | @ -117,12 +117,12 @@ private: | ||||||
|     void create_form_editor(GUI::Widget& parent); |     void create_form_editor(GUI::Widget& parent); | ||||||
|     void create_toolbar(GUI::Widget& parent); |     void create_toolbar(GUI::Widget& parent); | ||||||
|     void create_action_tab(GUI::Widget& parent); |     void create_action_tab(GUI::Widget& parent); | ||||||
|     void create_app_menubar(GUI::MenuBar&); |     void create_app_menubar(GUI::Menubar&); | ||||||
|     void create_project_menubar(GUI::MenuBar&); |     void create_project_menubar(GUI::Menubar&); | ||||||
|     void create_edit_menubar(GUI::MenuBar&); |     void create_edit_menubar(GUI::Menubar&); | ||||||
|     void create_build_menubar(GUI::MenuBar&); |     void create_build_menubar(GUI::Menubar&); | ||||||
|     void create_view_menubar(GUI::MenuBar&); |     void create_view_menubar(GUI::Menubar&); | ||||||
|     void create_help_menubar(GUI::MenuBar&); |     void create_help_menubar(GUI::Menubar&); | ||||||
|     void create_project_tab(GUI::Widget& parent); |     void create_project_tab(GUI::Widget& parent); | ||||||
|     void configure_project_tree_view(); |     void configure_project_tree_view(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,7 +34,7 @@ | ||||||
| #include <LibCore/EventLoop.h> | #include <LibCore/EventLoop.h> | ||||||
| #include <LibCore/File.h> | #include <LibCore/File.h> | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Notification.h> | #include <LibGUI/Notification.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
|  | @ -97,7 +97,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     s_window->set_title(String::formatted("{} - Hack Studio", s_hack_studio_widget->project().name())); |     s_window->set_title(String::formatted("{} - Hack Studio", s_hack_studio_widget->project().name())); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     s_hack_studio_widget->initialize_menubar(menubar); |     s_hack_studio_widget->initialize_menubar(menubar); | ||||||
|     s_window->set_menubar(menubar); |     s_window->set_menubar(menubar); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,7 +34,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/ModelEditingDelegate.h> | #include <LibGUI/ModelEditingDelegate.h> | ||||||
| #include <LibGUI/ProcessChooser.h> | #include <LibGUI/ProcessChooser.h> | ||||||
|  | @ -128,7 +128,7 @@ int main(int argc, char** argv) | ||||||
|     window->resize(685, 500); |     window->resize(685, 500); | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ | ||||||
| #include <LibGUI/GMLSyntaxHighlighter.h> | #include <LibGUI/GMLSyntaxHighlighter.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/Splitter.h> | #include <LibGUI/Splitter.h> | ||||||
|  | @ -153,7 +153,7 @@ int main(int argc, char** argv) | ||||||
|         }); |         }); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
| 
 | 
 | ||||||
|     app_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) { |     app_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) { | ||||||
|  |  | ||||||
|  | @ -39,7 +39,7 @@ | ||||||
| #include <LibGUI/Button.h> | #include <LibGUI/Button.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/ProcessChooser.h> | #include <LibGUI/ProcessChooser.h> | ||||||
|  | @ -140,7 +140,7 @@ int main(int argc, char** argv) | ||||||
|         individual_sample_view.set_model(move(model)); |         individual_sample_view.set_model(move(model)); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("&File"); |     auto& app_menu = menubar->add_menu("&File"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); |     app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,9 +34,9 @@ | ||||||
| #include <LibGUI/Button.h> | #include <LibGUI/Button.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/StatusBar.h> | #include <LibGUI/Statusbar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <time.h> | #include <time.h> | ||||||
|  | @ -98,7 +98,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto& board_view = main_widget.add<BoardView>(&game.board()); |     auto& board_view = main_widget.add<BoardView>(&game.board()); | ||||||
|     board_view.set_focus(true); |     board_view.set_focus(true); | ||||||
|     auto& statusbar = main_widget.add<GUI::StatusBar>(); |     auto& statusbar = main_widget.add<GUI::Statusbar>(); | ||||||
| 
 | 
 | ||||||
|     auto update = [&]() { |     auto update = [&]() { | ||||||
|         board_view.set_board(&game.board()); |         board_view.set_board(&game.board()); | ||||||
|  | @ -178,7 +178,7 @@ int main(int argc, char** argv) | ||||||
|         } |         } | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("File"); |     auto& app_menu = menubar->add_menu("File"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -67,7 +67,7 @@ int main(int argc, char** argv) | ||||||
|     auto& game = window->set_main_widget<Breakout::Game>(); |     auto& game = window->set_main_widget<Breakout::Game>(); | ||||||
|     window->show(); |     window->show(); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("Game"); |     auto& app_menu = menubar->add_menu("Game"); | ||||||
|     app_menu.add_action(GUI::Action::create_checkable("Pause", { {}, Key_P }, [&](auto& action) { |     app_menu.add_action(GUI::Action::create_checkable("Pause", { {}, Key_P }, [&](auto& action) { | ||||||
|  |  | ||||||
|  | @ -33,7 +33,7 @@ | ||||||
| #include <LibGUI/FilePicker.h> | #include <LibGUI/FilePicker.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/MessageBox.h> | #include <LibGUI/MessageBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -96,7 +96,7 @@ int main(int argc, char** argv) | ||||||
|     widget.set_coordinates(config->read_bool_entry("Style", "Coordinates", true)); |     widget.set_coordinates(config->read_bool_entry("Style", "Coordinates", true)); | ||||||
|     widget.set_show_available_moves(config->read_bool_entry("Style", "ShowAvailableMoves", true)); |     widget.set_show_available_moves(config->read_bool_entry("Style", "ShowAvailableMoves", true)); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("Game"); |     auto& app_menu = menubar->add_menu("Game"); | ||||||
| 
 | 
 | ||||||
|     app_menu.add_action(GUI::Action::create("Resign", { Mod_None, Key_F3 }, [&](auto&) { |     app_menu.add_action(GUI::Action::create("Resign", { Mod_None, Key_F3 }, [&](auto&) { | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -69,7 +69,7 @@ int main(int argc, char** argv) | ||||||
|     auto& game = window->set_main_widget<Game>(); |     auto& game = window->set_main_widget<Game>(); | ||||||
|     window->set_minimum_size(game.columns(), game.rows()); |     window->set_minimum_size(game.columns(), game.rows()); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("Game"); |     auto& app_menu = menubar->add_menu("Game"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,7 +34,7 @@ | ||||||
| #include <LibGUI/ImageWidget.h> | #include <LibGUI/ImageWidget.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -92,7 +92,7 @@ int main(int argc, char** argv) | ||||||
|     auto& flag_label = container.add<GUI::Label>(); |     auto& flag_label = container.add<GUI::Label>(); | ||||||
|     auto& face_button = container.add<GUI::Button>(); |     auto& face_button = container.add<GUI::Button>(); | ||||||
|     face_button.set_focus_policy(GUI::FocusPolicy::TabFocus); |     face_button.set_focus_policy(GUI::FocusPolicy::TabFocus); | ||||||
|     face_button.set_button_style(Gfx::ButtonStyle::CoolBar); |     face_button.set_button_style(Gfx::ButtonStyle::Coolbar); | ||||||
|     face_button.set_fixed_size(36, 36); |     face_button.set_fixed_size(36, 36); | ||||||
| 
 | 
 | ||||||
|     auto& time_image = container.add<GUI::ImageWidget>(); |     auto& time_image = container.add<GUI::ImageWidget>(); | ||||||
|  | @ -104,7 +104,7 @@ int main(int argc, char** argv) | ||||||
|         window->resize(size); |         window->resize(size); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("Game"); |     auto& app_menu = menubar->add_menu("Game"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Bitmap.h> | #include <LibGfx/Bitmap.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -74,7 +74,7 @@ int main(int argc, char** argv) | ||||||
|     window->set_main_widget<Pong::Game>(); |     window->set_main_widget<Pong::Game>(); | ||||||
|     window->show(); |     window->show(); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("Game"); |     auto& app_menu = menubar->add_menu("Game"); | ||||||
|     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { |     app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { | ||||||
|  |  | ||||||
|  | @ -32,7 +32,7 @@ | ||||||
| #include <LibGUI/Button.h> | #include <LibGUI/Button.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -78,7 +78,7 @@ int main(int argc, char** argv) | ||||||
| 
 | 
 | ||||||
|     auto& game = window->set_main_widget<SnakeGame>(); |     auto& game = window->set_main_widget<SnakeGame>(); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
| 
 | 
 | ||||||
|     auto& app_menu = menubar->add_menu("Game"); |     auto& app_menu = menubar->add_menu("Game"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  | @ -63,7 +63,7 @@ int main(int argc, char** argv) | ||||||
|         window->set_title(String::formatted("Score: {} - Solitaire", score)); |         window->set_title(String::formatted("Score: {} - Solitaire", score)); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     auto menubar = GUI::MenuBar::construct(); |     auto menubar = GUI::Menubar::construct(); | ||||||
|     auto& app_menu = menubar->add_menu("Game"); |     auto& app_menu = menubar->add_menu("Game"); | ||||||
| 
 | 
 | ||||||
|     app_menu.add_action(GUI::Action::create("New game", { Mod_None, Key_F2 }, [&](auto&) { |     app_menu.add_action(GUI::Action::create("New game", { Mod_None, Key_F2 }, [&](auto&) { | ||||||
|  |  | ||||||
|  | @ -33,7 +33,7 @@ | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -33,7 +33,7 @@ | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/ModelEditingDelegate.h> | #include <LibGUI/ModelEditingDelegate.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/Clipboard.h> | #include <LibGUI/Clipboard.h> | ||||||
| #include <LibGUI/Desktop.h> | #include <LibGUI/Desktop.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/MenuBar.h> | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| #include <LibGUI/WindowServerConnection.h> | #include <LibGUI/WindowServerConnection.h> | ||||||
|  |  | ||||||
|  | @ -25,13 +25,13 @@ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/BoxLayout.h> | #include <LibGUI/BoxLayout.h> | ||||||
| #include <LibGUI/BreadcrumbBar.h> | #include <LibGUI/Breadcrumbbar.h> | ||||||
| #include <LibGUI/Button.h> | #include <LibGUI/Button.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGfx/Font.h> | #include <LibGfx/Font.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
| REGISTER_WIDGET(GUI, BreadcrumbBar) | REGISTER_WIDGET(GUI, Breadcrumbbar) | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
|  | @ -76,26 +76,26 @@ private: | ||||||
|     BreadcrumbButton() { } |     BreadcrumbButton() { } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| BreadcrumbBar::BreadcrumbBar() | Breadcrumbbar::Breadcrumbbar() | ||||||
| { | { | ||||||
|     auto& layout = set_layout<HorizontalBoxLayout>(); |     auto& layout = set_layout<HorizontalBoxLayout>(); | ||||||
|     layout.set_spacing(0); |     layout.set_spacing(0); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| BreadcrumbBar::~BreadcrumbBar() | Breadcrumbbar::~Breadcrumbbar() | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void BreadcrumbBar::clear_segments() | void Breadcrumbbar::clear_segments() | ||||||
| { | { | ||||||
|     m_segments.clear(); |     m_segments.clear(); | ||||||
|     remove_all_children(); |     remove_all_children(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void BreadcrumbBar::append_segment(String text, const Gfx::Bitmap* icon, String data, String tooltip) | void Breadcrumbbar::append_segment(String text, const Gfx::Bitmap* icon, String data, String tooltip) | ||||||
| { | { | ||||||
|     auto& button = add<BreadcrumbButton>(); |     auto& button = add<BreadcrumbButton>(); | ||||||
|     button.set_button_style(Gfx::ButtonStyle::CoolBar); |     button.set_button_style(Gfx::ButtonStyle::Coolbar); | ||||||
|     button.set_text(text); |     button.set_text(text); | ||||||
|     button.set_icon(icon); |     button.set_icon(icon); | ||||||
|     button.set_tooltip(move(tooltip)); |     button.set_tooltip(move(tooltip)); | ||||||
|  | @ -125,7 +125,7 @@ void BreadcrumbBar::append_segment(String text, const Gfx::Bitmap* icon, String | ||||||
|     m_segments.append(move(segment)); |     m_segments.append(move(segment)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void BreadcrumbBar::set_selected_segment(Optional<size_t> index) | void Breadcrumbbar::set_selected_segment(Optional<size_t> index) | ||||||
| { | { | ||||||
|     if (!index.has_value()) { |     if (!index.has_value()) { | ||||||
|         for_each_child_of_type<GUI::AbstractButton>([&](auto& button) { |         for_each_child_of_type<GUI::AbstractButton>([&](auto& button) { | ||||||
|  | @ -140,7 +140,7 @@ void BreadcrumbBar::set_selected_segment(Optional<size_t> index) | ||||||
|     segment.button->set_checked(true); |     segment.button->set_checked(true); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void BreadcrumbBar::doubleclick_event(MouseEvent& event) | void Breadcrumbbar::doubleclick_event(MouseEvent& event) | ||||||
| { | { | ||||||
|     if (on_doubleclick) |     if (on_doubleclick) | ||||||
|         on_doubleclick(event); |         on_doubleclick(event); | ||||||
|  | @ -30,11 +30,11 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class BreadcrumbBar : public GUI::Widget { | class Breadcrumbbar : public GUI::Widget { | ||||||
|     C_OBJECT(BreadcrumbBar); |     C_OBJECT(Breadcrumbbar); | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|     virtual ~BreadcrumbBar() override; |     virtual ~Breadcrumbbar() override; | ||||||
| 
 | 
 | ||||||
|     void clear_segments(); |     void clear_segments(); | ||||||
|     void append_segment(String text, const Gfx::Bitmap* icon = nullptr, String data = {}, String tooltip = {}); |     void append_segment(String text, const Gfx::Bitmap* icon = nullptr, String data = {}, String tooltip = {}); | ||||||
|  | @ -51,7 +51,7 @@ public: | ||||||
|     Function<void(MouseEvent& event)> on_doubleclick; |     Function<void(MouseEvent& event)> on_doubleclick; | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     BreadcrumbBar(); |     Breadcrumbbar(); | ||||||
| 
 | 
 | ||||||
|     struct Segment { |     struct Segment { | ||||||
|         RefPtr<const Gfx::Bitmap> icon; |         RefPtr<const Gfx::Bitmap> icon; | ||||||
|  | @ -49,7 +49,7 @@ Button::Button(String text) | ||||||
|     REGISTER_ENUM_PROPERTY( |     REGISTER_ENUM_PROPERTY( | ||||||
|         "button_style", button_style, set_button_style, Gfx::ButtonStyle, |         "button_style", button_style, set_button_style, Gfx::ButtonStyle, | ||||||
|         { Gfx::ButtonStyle::Normal, "Normal" }, |         { Gfx::ButtonStyle::Normal, "Normal" }, | ||||||
|         { Gfx::ButtonStyle::CoolBar, "CoolBar" }); |         { Gfx::ButtonStyle::Coolbar, "Coolbar" }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Button::~Button() | Button::~Button() | ||||||
|  | @ -77,7 +77,7 @@ void Button::paint_event(PaintEvent& event) | ||||||
| 
 | 
 | ||||||
|     if (paint_pressed || is_checked()) { |     if (paint_pressed || is_checked()) { | ||||||
|         painter.translate(1, 1); |         painter.translate(1, 1); | ||||||
|     } else if (m_icon && is_enabled() && is_hovered() && button_style() == Gfx::ButtonStyle::CoolBar) { |     } else if (m_icon && is_enabled() && is_hovered() && button_style() == Gfx::ButtonStyle::Coolbar) { | ||||||
|         auto shadow_color = palette().button().darkened(0.7f); |         auto shadow_color = palette().button().darkened(0.7f); | ||||||
|         painter.blit_filtered(icon_location.translated(1, 1), *m_icon, m_icon->rect(), [&shadow_color](auto) { |         painter.blit_filtered(icon_location.translated(1, 1), *m_icon, m_icon->rect(), [&shadow_color](auto) { | ||||||
|             return shadow_color; |             return shadow_color; | ||||||
|  |  | ||||||
|  | @ -12,7 +12,7 @@ set(SOURCES | ||||||
|     Application.cpp |     Application.cpp | ||||||
|     AutocompleteProvider.cpp |     AutocompleteProvider.cpp | ||||||
|     BoxLayout.cpp |     BoxLayout.cpp | ||||||
|     BreadcrumbBar.cpp |     Breadcrumbbar.cpp | ||||||
|     Button.cpp |     Button.cpp | ||||||
|     Calendar.cpp |     Calendar.cpp | ||||||
|     CheckBox.cpp |     CheckBox.cpp | ||||||
|  | @ -56,7 +56,7 @@ set(SOURCES | ||||||
|     LinkLabel.cpp |     LinkLabel.cpp | ||||||
|     ListView.cpp |     ListView.cpp | ||||||
|     Menu.cpp |     Menu.cpp | ||||||
|     MenuBar.cpp |         Menubar.cpp | ||||||
|     MenuItem.cpp |     MenuItem.cpp | ||||||
|     MessageBox.cpp |     MessageBox.cpp | ||||||
|     Model.cpp |     Model.cpp | ||||||
|  | @ -67,12 +67,12 @@ set(SOURCES | ||||||
|     OpacitySlider.cpp |     OpacitySlider.cpp | ||||||
|     Painter.cpp |     Painter.cpp | ||||||
|     ProcessChooser.cpp |     ProcessChooser.cpp | ||||||
|     ProgressBar.cpp |     Progressbar.cpp | ||||||
|     RadioButton.cpp |     RadioButton.cpp | ||||||
|     RegularEditingEngine.cpp |     RegularEditingEngine.cpp | ||||||
|     ResizeCorner.cpp |     ResizeCorner.cpp | ||||||
|     RunningProcessesModel.cpp |     RunningProcessesModel.cpp | ||||||
|     ScrollBar.cpp |         Scrollbar.cpp | ||||||
|     ScrollableWidget.cpp |     ScrollableWidget.cpp | ||||||
|     SeparatorWidget.cpp |     SeparatorWidget.cpp | ||||||
|     Shortcut.cpp |     Shortcut.cpp | ||||||
|  | @ -81,14 +81,14 @@ set(SOURCES | ||||||
|     SpinBox.cpp |     SpinBox.cpp | ||||||
|     Splitter.cpp |     Splitter.cpp | ||||||
|     StackWidget.cpp |     StackWidget.cpp | ||||||
|     StatusBar.cpp |         Statusbar.cpp | ||||||
|     TabWidget.cpp |     TabWidget.cpp | ||||||
|     TableView.cpp |     TableView.cpp | ||||||
|     TextBox.cpp |     TextBox.cpp | ||||||
|     TextDocument.cpp |     TextDocument.cpp | ||||||
|     TextEditor.cpp |     TextEditor.cpp | ||||||
|     ToolBar.cpp |         Toolbar.cpp | ||||||
|     ToolBarContainer.cpp |         ToolbarContainer.cpp | ||||||
|     TreeView.cpp |     TreeView.cpp | ||||||
|     UndoStack.cpp |     UndoStack.cpp | ||||||
|     Variant.cpp |     Variant.cpp | ||||||
|  |  | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
| #include <LibGUI/ColumnsView.h> | #include <LibGUI/ColumnsView.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGfx/CharacterBitmap.h> | #include <LibGfx/CharacterBitmap.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
| #include <LibGUI/Desktop.h> | #include <LibGUI/Desktop.h> | ||||||
| #include <LibGUI/ListView.h> | #include <LibGUI/ListView.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/Window.h> | #include <LibGUI/Window.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -85,7 +85,7 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window) | ||||||
|                 auto emoji_text = builder.to_string(); |                 auto emoji_text = builder.to_string(); | ||||||
|                 auto& button = horizontal_container.add<Button>(emoji_text); |                 auto& button = horizontal_container.add<Button>(emoji_text); | ||||||
|                 button.set_min_size(16, 16); |                 button.set_min_size(16, 16); | ||||||
|                 button.set_button_style(Gfx::ButtonStyle::CoolBar); |                 button.set_button_style(Gfx::ButtonStyle::Coolbar); | ||||||
|                 button.on_click = [this, button = &button](auto) { |                 button.on_click = [this, button = &button](auto) { | ||||||
|                     m_selected_emoji_text = button->text(); |                     m_selected_emoji_text = button->text(); | ||||||
|                     done(ExecOK); |                     done(ExecOK); | ||||||
|  |  | ||||||
|  | @ -41,7 +41,7 @@ | ||||||
| #include <LibGUI/MultiView.h> | #include <LibGUI/MultiView.h> | ||||||
| #include <LibGUI/SortingProxyModel.h> | #include <LibGUI/SortingProxyModel.h> | ||||||
| #include <LibGUI/TextBox.h> | #include <LibGUI/TextBox.h> | ||||||
| #include <LibGUI/ToolBar.h> | #include <LibGUI/Toolbar.h> | ||||||
| #include <LibGfx/FontDatabase.h> | #include <LibGfx/FontDatabase.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| #include <string.h> | #include <string.h> | ||||||
|  | @ -104,7 +104,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& file_ | ||||||
|     if (!widget.load_from_gml(file_picker_dialog_gml)) |     if (!widget.load_from_gml(file_picker_dialog_gml)) | ||||||
|         VERIFY_NOT_REACHED(); |         VERIFY_NOT_REACHED(); | ||||||
| 
 | 
 | ||||||
|     auto& toolbar = *widget.find_descendant_of_type_named<GUI::ToolBar>("toolbar"); |     auto& toolbar = *widget.find_descendant_of_type_named<GUI::Toolbar>("toolbar"); | ||||||
|     toolbar.set_has_frame(false); |     toolbar.set_has_frame(false); | ||||||
| 
 | 
 | ||||||
|     m_location_textbox = *widget.find_descendant_of_type_named<GUI::TextBox>("location_textbox"); |     m_location_textbox = *widget.find_descendant_of_type_named<GUI::TextBox>("location_textbox"); | ||||||
|  |  | ||||||
|  | @ -51,7 +51,7 @@ | ||||||
|                 name: "location_textbox" |                 name: "location_textbox" | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             @GUI::ToolBar { |             @GUI::Toolbar { | ||||||
|                 name: "toolbar" |                 name: "toolbar" | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/FontPickerWeightModel.h> | #include <LibGUI/FontPickerWeightModel.h> | ||||||
| #include <LibGUI/Label.h> | #include <LibGUI/Label.h> | ||||||
| #include <LibGUI/ListView.h> | #include <LibGUI/ListView.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGUI/Widget.h> | #include <LibGUI/Widget.h> | ||||||
| #include <LibGfx/FontDatabase.h> | #include <LibGfx/FontDatabase.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -58,7 +58,7 @@ class Label; | ||||||
| class Layout; | class Layout; | ||||||
| class ListView; | class ListView; | ||||||
| class Menu; | class Menu; | ||||||
| class MenuBar; | class Menubar; | ||||||
| class MenuItem; | class MenuItem; | ||||||
| class Model; | class Model; | ||||||
| class ModelEditingDelegate; | class ModelEditingDelegate; | ||||||
|  | @ -73,14 +73,14 @@ class RadioButton; | ||||||
| class ResizeCorner; | class ResizeCorner; | ||||||
| class ResizeEvent; | class ResizeEvent; | ||||||
| class ScreenRectChangeEvent; | class ScreenRectChangeEvent; | ||||||
| class ScrollBar; | class Scrollbar; | ||||||
| class ScrollableWidget; | class ScrollableWidget; | ||||||
| class Slider; | class Slider; | ||||||
| class SortingProxyModel; | class SortingProxyModel; | ||||||
| class SpinBox; | class SpinBox; | ||||||
| class Splitter; | class Splitter; | ||||||
| class StackWidget; | class StackWidget; | ||||||
| class StatusBar; | class Statusbar; | ||||||
| class TabWidget; | class TabWidget; | ||||||
| class TableView; | class TableView; | ||||||
| class TextBox; | class TextBox; | ||||||
|  | @ -90,8 +90,8 @@ struct TextDocumentSpan; | ||||||
| class TextDocumentUndoCommand; | class TextDocumentUndoCommand; | ||||||
| class TextEditor; | class TextEditor; | ||||||
| class ThemeChangeEvent; | class ThemeChangeEvent; | ||||||
| class ToolBar; | class Toolbar; | ||||||
| class ToolBarContainer; | class ToolbarContainer; | ||||||
| class TreeView; | class TreeView; | ||||||
| class Variant; | class Variant; | ||||||
| class VerticalBoxLayout; | class VerticalBoxLayout; | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ | ||||||
| #include <LibGUI/IconView.h> | #include <LibGUI/IconView.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
|  |  | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
| #include <LibGUI/ListView.h> | #include <LibGUI/ListView.h> | ||||||
| #include <LibGUI/Model.h> | #include <LibGUI/Model.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
| REGISTER_WIDGET(GUI, ListView) | REGISTER_WIDGET(GUI, ListView) | ||||||
|  |  | ||||||
|  | @ -66,7 +66,7 @@ public: | ||||||
|     bool is_visible() const { return m_visible; } |     bool is_visible() const { return m_visible; } | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     friend class MenuBar; |     friend class Menubar; | ||||||
| 
 | 
 | ||||||
|     int realize_menu(RefPtr<Action> default_action = nullptr); |     int realize_menu(RefPtr<Action> default_action = nullptr); | ||||||
|     void unrealize_menu(); |     void unrealize_menu(); | ||||||
|  |  | ||||||
|  | @ -26,34 +26,34 @@ | ||||||
| 
 | 
 | ||||||
| #include <AK/Badge.h> | #include <AK/Badge.h> | ||||||
| #include <LibGUI/Menu.h> | #include <LibGUI/Menu.h> | ||||||
| #include <LibGUI/MenuBar.h> |  | ||||||
| #include <LibGUI/MenuItem.h> | #include <LibGUI/MenuItem.h> | ||||||
|  | #include <LibGUI/Menubar.h> | ||||||
| #include <LibGUI/WindowServerConnection.h> | #include <LibGUI/WindowServerConnection.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| MenuBar::MenuBar() | Menubar::Menubar() | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| MenuBar::~MenuBar() | Menubar::~Menubar() | ||||||
| { | { | ||||||
|     unrealize_menubar(); |     unrealize_menubar(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Menu& MenuBar::add_menu(String name) | Menu& Menubar::add_menu(String name) | ||||||
| { | { | ||||||
|     auto& menu = add<Menu>(move(name)); |     auto& menu = add<Menu>(move(name)); | ||||||
|     m_menus.append(menu); |     m_menus.append(menu); | ||||||
|     return menu; |     return menu; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int MenuBar::realize_menubar() | int Menubar::realize_menubar() | ||||||
| { | { | ||||||
|     return WindowServerConnection::the().send_sync<Messages::WindowServer::CreateMenubar>()->menubar_id(); |     return WindowServerConnection::the().send_sync<Messages::WindowServer::CreateMenubar>()->menubar_id(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MenuBar::unrealize_menubar() | void Menubar::unrealize_menubar() | ||||||
| { | { | ||||||
|     if (m_menubar_id == -1) |     if (m_menubar_id == -1) | ||||||
|         return; |         return; | ||||||
|  | @ -61,7 +61,7 @@ void MenuBar::unrealize_menubar() | ||||||
|     m_menubar_id = -1; |     m_menubar_id = -1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MenuBar::notify_added_to_window(Badge<Window>) | void Menubar::notify_added_to_window(Badge<Window>) | ||||||
| { | { | ||||||
|     VERIFY(m_menubar_id == -1); |     VERIFY(m_menubar_id == -1); | ||||||
|     m_menubar_id = realize_menubar(); |     m_menubar_id = realize_menubar(); | ||||||
|  | @ -73,7 +73,7 @@ void MenuBar::notify_added_to_window(Badge<Window>) | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MenuBar::notify_removed_from_window(Badge<Window>) | void Menubar::notify_removed_from_window(Badge<Window>) | ||||||
| { | { | ||||||
|     unrealize_menubar(); |     unrealize_menubar(); | ||||||
| } | } | ||||||
|  | @ -33,11 +33,11 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class MenuBar : public Core::Object { | class Menubar : public Core::Object { | ||||||
|     C_OBJECT(MenuBar); |     C_OBJECT(Menubar); | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|     ~MenuBar(); |     ~Menubar(); | ||||||
| 
 | 
 | ||||||
|     Menu& add_menu(String name); |     Menu& add_menu(String name); | ||||||
| 
 | 
 | ||||||
|  | @ -47,7 +47,7 @@ public: | ||||||
|     int menubar_id() const { return m_menubar_id; } |     int menubar_id() const { return m_menubar_id; } | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     MenuBar(); |     Menubar(); | ||||||
| 
 | 
 | ||||||
|     int realize_menubar(); |     int realize_menubar(); | ||||||
|     void unrealize_menubar(); |     void unrealize_menubar(); | ||||||
|  | @ -27,16 +27,16 @@ | ||||||
| #include <AK/Assertions.h> | #include <AK/Assertions.h> | ||||||
| #include <AK/StringBuilder.h> | #include <AK/StringBuilder.h> | ||||||
| #include <LibGUI/Painter.h> | #include <LibGUI/Painter.h> | ||||||
| #include <LibGUI/ProgressBar.h> | #include <LibGUI/Progressbar.h> | ||||||
| #include <LibGfx/Palette.h> | #include <LibGfx/Palette.h> | ||||||
| 
 | 
 | ||||||
| REGISTER_WIDGET(GUI, ProgressBar) | REGISTER_WIDGET(GUI, Progressbar) | ||||||
| REGISTER_WIDGET(GUI, VerticalProgressBar) | REGISTER_WIDGET(GUI, VerticalProgressbar) | ||||||
| REGISTER_WIDGET(GUI, HorizontalProgressBar) | REGISTER_WIDGET(GUI, HorizontalProgressbar) | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| ProgressBar::ProgressBar(Orientation orientation) | Progressbar::Progressbar(Orientation orientation) | ||||||
|     : m_orientation(orientation) |     : m_orientation(orientation) | ||||||
| { | { | ||||||
|     REGISTER_STRING_PROPERTY("text", text, set_text); |     REGISTER_STRING_PROPERTY("text", text, set_text); | ||||||
|  | @ -48,11 +48,11 @@ ProgressBar::ProgressBar(Orientation orientation) | ||||||
|     REGISTER_INT_PROPERTY("max", max, set_max); |     REGISTER_INT_PROPERTY("max", max, set_max); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| ProgressBar::~ProgressBar() | Progressbar::~Progressbar() | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ProgressBar::set_value(int value) | void Progressbar::set_value(int value) | ||||||
| { | { | ||||||
|     if (m_value == value) |     if (m_value == value) | ||||||
|         return; |         return; | ||||||
|  | @ -60,7 +60,7 @@ void ProgressBar::set_value(int value) | ||||||
|     update(); |     update(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ProgressBar::set_range(int min, int max) | void Progressbar::set_range(int min, int max) | ||||||
| { | { | ||||||
|     VERIFY(min <= max); |     VERIFY(min <= max); | ||||||
|     m_min = min; |     m_min = min; | ||||||
|  | @ -68,7 +68,7 @@ void ProgressBar::set_range(int min, int max) | ||||||
|     m_value = clamp(m_value, m_min, m_max); |     m_value = clamp(m_value, m_min, m_max); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ProgressBar::paint_event(PaintEvent& event) | void Progressbar::paint_event(PaintEvent& event) | ||||||
| { | { | ||||||
|     Frame::paint_event(event); |     Frame::paint_event(event); | ||||||
| 
 | 
 | ||||||
|  | @ -93,10 +93,10 @@ void ProgressBar::paint_event(PaintEvent& event) | ||||||
|         progress_text = builder.to_string(); |         progress_text = builder.to_string(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     Gfx::StylePainter::paint_progress_bar(painter, rect, palette(), m_min, m_max, m_value, progress_text, m_orientation); |     Gfx::StylePainter::paint_progressbar(painter, rect, palette(), m_min, m_max, m_value, progress_text, m_orientation); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ProgressBar::set_orientation(Orientation value) | void Progressbar::set_orientation(Orientation value) | ||||||
| { | { | ||||||
|     if (m_orientation == value) |     if (m_orientation == value) | ||||||
|         return; |         return; | ||||||
|  | @ -30,10 +30,10 @@ | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| class ProgressBar : public Frame { | class Progressbar : public Frame { | ||||||
|     C_OBJECT(ProgressBar) |     C_OBJECT(Progressbar) | ||||||
| public: | public: | ||||||
|     virtual ~ProgressBar() override; |     virtual ~Progressbar() override; | ||||||
| 
 | 
 | ||||||
|     void set_range(int min, int max); |     void set_range(int min, int max); | ||||||
|     void set_min(int min) { set_range(min, max()); } |     void set_min(int min) { set_range(min, max()); } | ||||||
|  | @ -59,7 +59,7 @@ public: | ||||||
|     void set_format(Format format) { m_format = format; } |     void set_format(Format format) { m_format = format; } | ||||||
| 
 | 
 | ||||||
| protected: | protected: | ||||||
|     ProgressBar(Orientation = Orientation::Horizontal); |     Progressbar(Orientation = Orientation::Horizontal); | ||||||
| 
 | 
 | ||||||
|     virtual void paint_event(PaintEvent&) override; |     virtual void paint_event(PaintEvent&) override; | ||||||
| 
 | 
 | ||||||
|  | @ -72,28 +72,28 @@ private: | ||||||
|     Orientation m_orientation { Orientation::Horizontal }; |     Orientation m_orientation { Orientation::Horizontal }; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class VerticalProgressBar final : public ProgressBar { | class VerticalProgressbar final : public Progressbar { | ||||||
|     C_OBJECT(VerticalProgressBar); |     C_OBJECT(VerticalProgressbar); | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|     virtual ~VerticalProgressBar() override { } |     virtual ~VerticalProgressbar() override { } | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     VerticalProgressBar() |     VerticalProgressbar() | ||||||
|         : ProgressBar(Orientation::Vertical) |         : Progressbar(Orientation::Vertical) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class HorizontalProgressBar final : public ProgressBar { | class HorizontalProgressbar final : public Progressbar { | ||||||
|     C_OBJECT(HorizontalProgressBar); |     C_OBJECT(HorizontalProgressbar); | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|     virtual ~HorizontalProgressBar() override { } |     virtual ~HorizontalProgressbar() override { } | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     HorizontalProgressBar() |     HorizontalProgressbar() | ||||||
|         : ProgressBar(Orientation::Horizontal) |         : Progressbar(Orientation::Horizontal) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| }; | }; | ||||||
|  | @ -24,21 +24,21 @@ | ||||||
|  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/ScrollBar.h> |  | ||||||
| #include <LibGUI/ScrollableWidget.h> | #include <LibGUI/ScrollableWidget.h> | ||||||
|  | #include <LibGUI/Scrollbar.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
| ScrollableWidget::ScrollableWidget() | ScrollableWidget::ScrollableWidget() | ||||||
| { | { | ||||||
|     m_vertical_scrollbar = add<ScrollableWidgetScrollBar>(*this, Orientation::Vertical); |     m_vertical_scrollbar = add<ScrollableWidgetScrollbar>(*this, Orientation::Vertical); | ||||||
|     m_vertical_scrollbar->set_step(4); |     m_vertical_scrollbar->set_step(4); | ||||||
|     m_vertical_scrollbar->on_change = [this](int) { |     m_vertical_scrollbar->on_change = [this](int) { | ||||||
|         did_scroll(); |         did_scroll(); | ||||||
|         update(); |         update(); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     m_horizontal_scrollbar = add<ScrollableWidgetScrollBar>(*this, Orientation::Horizontal); |     m_horizontal_scrollbar = add<ScrollableWidgetScrollbar>(*this, Orientation::Horizontal); | ||||||
|     m_horizontal_scrollbar->set_step(4); |     m_horizontal_scrollbar->set_step(4); | ||||||
|     m_horizontal_scrollbar->set_page_step(30); |     m_horizontal_scrollbar->set_page_step(30); | ||||||
|     m_horizontal_scrollbar->on_change = [this](int) { |     m_horizontal_scrollbar->on_change = [this](int) { | ||||||
|  |  | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <LibGUI/Frame.h> | #include <LibGUI/Frame.h> | ||||||
| #include <LibGUI/ScrollBar.h> | #include <LibGUI/Scrollbar.h> | ||||||
| 
 | 
 | ||||||
| namespace GUI { | namespace GUI { | ||||||
| 
 | 
 | ||||||
|  | @ -60,10 +60,10 @@ public: | ||||||
|     Gfx::IntSize available_size() const; |     Gfx::IntSize available_size() const; | ||||||
|     Gfx::IntSize excess_size() const; |     Gfx::IntSize excess_size() const; | ||||||
| 
 | 
 | ||||||
|     ScrollBar& vertical_scrollbar() { return *m_vertical_scrollbar; } |     Scrollbar& vertical_scrollbar() { return *m_vertical_scrollbar; } | ||||||
|     const ScrollBar& vertical_scrollbar() const { return *m_vertical_scrollbar; } |     const Scrollbar& vertical_scrollbar() const { return *m_vertical_scrollbar; } | ||||||
|     ScrollBar& horizontal_scrollbar() { return *m_horizontal_scrollbar; } |     Scrollbar& horizontal_scrollbar() { return *m_horizontal_scrollbar; } | ||||||
|     const ScrollBar& horizontal_scrollbar() const { return *m_horizontal_scrollbar; } |     const Scrollbar& horizontal_scrollbar() const { return *m_horizontal_scrollbar; } | ||||||
|     Widget& corner_widget() { return *m_corner_widget; } |     Widget& corner_widget() { return *m_corner_widget; } | ||||||
|     const Widget& corner_widget() const { return *m_corner_widget; } |     const Widget& corner_widget() const { return *m_corner_widget; } | ||||||
| 
 | 
 | ||||||
|  | @ -92,12 +92,12 @@ protected: | ||||||
|     void set_size_occupied_by_fixed_elements(const Gfx::IntSize&); |     void set_size_occupied_by_fixed_elements(const Gfx::IntSize&); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     class ScrollableWidgetScrollBar final : public ScrollBar { |     class ScrollableWidgetScrollbar final : public Scrollbar { | ||||||
|         C_OBJECT(ScrollableWidgetScrollBar); |         C_OBJECT(ScrollableWidgetScrollbar); | ||||||
| 
 | 
 | ||||||
|     protected: |     protected: | ||||||
|         explicit ScrollableWidgetScrollBar(ScrollableWidget& owner, Gfx::Orientation orientation) |         explicit ScrollableWidgetScrollbar(ScrollableWidget& owner, Gfx::Orientation orientation) | ||||||
|             : ScrollBar(orientation) |             : Scrollbar(orientation) | ||||||
|             , m_owner(owner) |             , m_owner(owner) | ||||||
|         { |         { | ||||||
|         } |         } | ||||||
|  | @ -110,13 +110,13 @@ private: | ||||||
|     private: |     private: | ||||||
|         ScrollableWidget& m_owner; |         ScrollableWidget& m_owner; | ||||||
|     }; |     }; | ||||||
|     friend class ScrollableWidgetScrollBar; |     friend class ScrollableWidgetScrollbar; | ||||||
| 
 | 
 | ||||||
|     void update_scrollbar_ranges(); |     void update_scrollbar_ranges(); | ||||||
|     void handle_wheel_event(MouseEvent&, Widget&); |     void handle_wheel_event(MouseEvent&, Widget&); | ||||||
| 
 | 
 | ||||||
|     RefPtr<ScrollableWidgetScrollBar> m_vertical_scrollbar; |     RefPtr<ScrollableWidgetScrollbar> m_vertical_scrollbar; | ||||||
|     RefPtr<ScrollableWidgetScrollBar> m_horizontal_scrollbar; |     RefPtr<ScrollableWidgetScrollbar> m_horizontal_scrollbar; | ||||||
|     RefPtr<Widget> m_corner_widget; |     RefPtr<Widget> m_corner_widget; | ||||||
|     Gfx::IntSize m_content_size; |     Gfx::IntSize m_content_size; | ||||||
|     Gfx::IntSize m_size_occupied_by_fixed_elements; |     Gfx::IntSize m_size_occupied_by_fixed_elements; | ||||||
|  |  | ||||||
Some files were not shown because too many files have changed in this diff Show more
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling