Yoda/src/app/browser/header.cpp

48 lines
793 B
C++
Raw Normal View History

#include "header.hpp"
2024-08-20 14:38:13 +03:00
#include "header/main.hpp"
#include "header/menu.hpp"
#include "header/tab.hpp"
using namespace app::browser;
Header::Header()
{
2024-08-12 09:45:22 +03:00
// Init header bar
set_show_title_buttons(
2024-08-27 16:27:56 +03:00
SHOW_TITLE_BUTTONS
);
2024-08-12 09:45:22 +03:00
// Init menu
2024-09-02 16:25:31 +03:00
headerMenu = Gtk::make_managed<header::Menu>();
2024-08-12 09:45:22 +03:00
pack_start(
2024-08-27 16:27:56 +03:00
* headerMenu
);
2024-08-12 09:45:22 +03:00
// Init tab
2024-09-02 16:25:31 +03:00
headerTab = Gtk::make_managed<header::Tab>();
2024-08-12 09:45:22 +03:00
pack_start(
2024-08-27 16:27:56 +03:00
* headerTab
2024-08-12 09:45:22 +03:00
);
2024-08-20 14:38:13 +03:00
// Init main widget
2024-09-02 16:25:31 +03:00
headerMain = Gtk::make_managed<header::Main>();
2024-08-20 14:38:13 +03:00
set_title_widget(
2024-08-27 16:27:56 +03:00
* headerMain
2024-08-20 14:38:13 +03:00
);
2024-08-12 09:45:22 +03:00
}
2024-09-08 07:47:39 +03:00
void Header::refresh(
const Glib::ustring & TITLE,
const Glib::ustring & SUBTITLE
2024-08-20 15:25:31 +03:00
) {
2024-08-27 16:27:56 +03:00
headerMain->set_title(
2024-09-08 07:47:39 +03:00
TITLE
2024-08-20 15:25:31 +03:00
);
2024-08-27 16:22:48 +03:00
2024-08-27 16:27:56 +03:00
headerMain->set_subtitle(
2024-09-08 07:47:39 +03:00
SUBTITLE
2024-08-27 16:22:48 +03:00
);
}