mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Browser: Add icons for the "new tab" and "close tab" actions
This commit is contained in:
parent
2b64cf3efe
commit
9d8620f956
Notes:
sideshowbarker
2024-07-19 07:19:46 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9d8620f9565
4 changed files with 3 additions and 2 deletions
|
@ -183,7 +183,7 @@ Tab::Tab()
|
|||
|
||||
auto& app_menu = m_menubar->add_menu("Browser");
|
||||
app_menu.add_action(WindowActions::the().create_new_tab_action());
|
||||
app_menu.add_action(GUI::Action::create("Close tab", { Mod_Ctrl, Key_W }, [this](auto&) {
|
||||
app_menu.add_action(GUI::Action::create("Close tab", { Mod_Ctrl, Key_W }, Gfx::Bitmap::load_from_file("/res/icons/16x16/close-tab.png"), [this](auto&) {
|
||||
on_tab_close_request(*this);
|
||||
}, this));
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "WindowActions.h"
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
|
@ -16,7 +17,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
ASSERT(!s_the);
|
||||
s_the = this;
|
||||
m_create_new_tab_action = GUI::Action::create(
|
||||
"New tab", { Mod_Ctrl, Key_T }, [this](auto&) {
|
||||
"New tab", { Mod_Ctrl, Key_T }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"), [this](auto&) {
|
||||
if (on_create_new_tab)
|
||||
on_create_new_tab();
|
||||
},
|
||||
|
|
BIN
Base/res/icons/16x16/close-tab.png
Normal file
BIN
Base/res/icons/16x16/close-tab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 199 B |
BIN
Base/res/icons/16x16/new-tab.png
Normal file
BIN
Base/res/icons/16x16/new-tab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 224 B |
Loading…
Reference in a new issue