From 8e3730f61dc6cbce8e31d7ca48e17915592ae075 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 20 Aug 2024 16:27:35 +0300 Subject: [PATCH] add get_current_tab_label_text method --- src/app/browser/main.cpp | 11 +++++++++++ src/app/browser/main.hpp | 9 ++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/app/browser/main.cpp b/src/app/browser/main.cpp index 4d4c5884..40b562c7 100644 --- a/src/app/browser/main.cpp +++ b/src/app/browser/main.cpp @@ -27,6 +27,17 @@ Main::~Main() delete tab; } +// Getters +Glib::ustring Main::get_current_tab_label_text() +{ + int page_number = tab->get_current_page(); + + return tab->get_label_text( + page_number + ); +}; + +// Actions void Main::tab_append() { tab->append( diff --git a/src/app/browser/main.hpp b/src/app/browser/main.hpp index 10a3a77a..34fef3c3 100644 --- a/src/app/browser/main.hpp +++ b/src/app/browser/main.hpp @@ -1,6 +1,7 @@ #ifndef APP_BROWSER_MAIN_HPP #define APP_BROWSER_MAIN_HPP +#include #include namespace app::browser @@ -19,12 +20,14 @@ namespace app::browser Main(); ~Main(); + Glib::ustring get_current_tab_label_text(); + void tab_append(); - void tab_update(); - void tab_close(); + void tab_close_all(); void tab_close_left(); void tab_close_right(); - void tab_close_all(); + void tab_close(); + void tab_update(); }; }