From 08bbb9cb615f0ecd0d041baacd7a024c1e30db5c Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 12 Jul 2024 17:05:27 +0200 Subject: app: add main menu button tooltip --- app/include/turns/app/windows/main.hpp | 2 ++ app/src/windows/main.cpp | 2 ++ app/tests/windows/main.cpp | 7 +++++++ 3 files changed, 11 insertions(+) (limited to 'app') diff --git a/app/include/turns/app/windows/main.hpp b/app/include/turns/app/windows/main.hpp index a39d156..e27c1c7 100644 --- a/app/include/turns/app/windows/main.hpp +++ b/app/include/turns/app/windows/main.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace turns::app::windows { @@ -17,6 +18,7 @@ namespace turns::app::windows private: Gtk::Button * m_add_participant; AdwApplicationWindow * m_adw; + Gtk::MenuButton * m_open_main_menu; AdwWindowTitle * m_title; }; diff --git a/app/src/windows/main.cpp b/app/src/windows/main.cpp index d8118c6..2ad9117 100644 --- a/app/src/windows/main.cpp +++ b/app/src/windows/main.cpp @@ -14,9 +14,11 @@ namespace turns::app::windows : Gtk::ApplicationWindow{base} , m_add_participant{builder->get_widget("add_participant")} , m_adw{ADW_APPLICATION_WINDOW(gobj())} + , m_open_main_menu{builder->get_widget("open_main_menu")} , m_title(ADW_WINDOW_TITLE(builder->get_widget("title")->gobj())) { m_add_participant->set_tooltip_text(_(tooltips::add_a_participant)); + m_open_main_menu->set_tooltip_text(_(tooltips::main_menu)); adw_window_title_set_subtitle(m_title, _(labels::no_active_turn_order)); } diff --git a/app/tests/windows/main.cpp b/app/tests/windows/main.cpp index fca04fd..b6e1122 100644 --- a/app/tests/windows/main.cpp +++ b/app/tests/windows/main.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include namespace turns::app::windows::tests @@ -65,6 +66,12 @@ namespace turns::app::windows::tests auto widget = builder->get_widget("add_participant"); REQUIRE(widget->get_tooltip_text() == Glib::ustring{_(tooltips::add_a_participant)}); } + + SECTION("the open_main_menu button has the correct tooltip") + { + auto widget = builder->get_widget("open_main_menu"); + REQUIRE(widget->get_tooltip_text() == Glib::ustring{_(tooltips::main_menu)}); + } } } // namespace turns::app::windows::tests \ No newline at end of file -- cgit v1.2.3