1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-13 16:47:36 +00:00

Launcher: Add tooltips to LauncherButtons.

This commit is contained in:
Andreas Kling 2019-04-09 02:21:24 +02:00
parent 26a06f3fcd
commit d6ff64db00

View file

@ -35,10 +35,11 @@ int main(int argc, char** argv)
class LauncherButton final : public GButton { class LauncherButton final : public GButton {
public: public:
LauncherButton(const String& icon_path, const String& exec_path, GWidget* parent) LauncherButton(const String& name, const String& icon_path, const String& exec_path, GWidget* parent)
: GButton(parent) : GButton(parent)
, m_executable_path(exec_path) , m_executable_path(exec_path)
{ {
set_tooltip(name);
set_button_style(ButtonStyle::CoolBar); set_button_style(ButtonStyle::CoolBar);
set_icon(GraphicsBitmap::load_from_file(icon_path)); set_icon(GraphicsBitmap::load_from_file(icon_path));
set_preferred_size({ 50, 50 }); set_preferred_size({ 50, 50 });
@ -69,10 +70,10 @@ GWindow* make_launcher_window()
widget->layout()->set_margins({ 5, 5, 5, 5 }); widget->layout()->set_margins({ 5, 5, 5, 5 });
window->set_main_widget(widget); window->set_main_widget(widget);
new LauncherButton("/res/icons/Terminal.png", "/bin/Terminal", widget); new LauncherButton("Terminal", "/res/icons/Terminal.png", "/bin/Terminal", widget);
new LauncherButton("/res/icons/FontEditor.png", "/bin/FontEditor", widget); new LauncherButton("FontEditor", "/res/icons/FontEditor.png", "/bin/FontEditor", widget);
new LauncherButton("/res/icons/32x32/filetype-folder.png", "/bin/FileManager", widget); new LauncherButton("FileManager", "/res/icons/32x32/filetype-folder.png", "/bin/FileManager", widget);
new LauncherButton("/res/icons/TextEditor.png", "/bin/TextEditor", widget); new LauncherButton("TextEditor", "/res/icons/TextEditor.png", "/bin/TextEditor", widget);
return window; return window;
} }