Yoda/src/app/browser/main.cpp

80 lines
1.0 KiB
C++
Raw Normal View History

2024-08-11 22:04:34 +03:00
#include "main.hpp"
#include "main/tab.hpp"
using namespace app::browser;
Main::Main()
{
// Init container
2024-08-12 14:24:28 +03:00
set_orientation(
Gtk::Orientation::VERTICAL
);
2024-08-11 22:04:34 +03:00
set_homogeneous(
HOMOGENEOUS
2024-08-11 22:04:34 +03:00
);
// Init tabs
2024-08-27 14:30:23 +03:00
mainTab = new main::Tab();
2024-08-11 22:04:34 +03:00
append(
2024-08-27 14:30:23 +03:00
* mainTab
2024-08-11 22:04:34 +03:00
);
}
2024-08-12 09:45:22 +03:00
Main::~Main()
{
2024-08-27 14:30:23 +03:00
delete mainTab;
2024-08-12 09:45:22 +03:00
}
2024-08-20 16:27:35 +03:00
// Getters
Glib::ustring Main::get_current_tab_label_text()
{
2024-08-27 14:30:23 +03:00
return mainTab->get_label_text(
2024-08-27 16:01:33 +03:00
mainTab->get_current_page()
2024-08-20 16:27:35 +03:00
);
};
// Actions
2024-08-12 18:16:27 +03:00
void Main::tab_append()
2024-08-11 22:04:34 +03:00
{
2024-08-27 14:30:23 +03:00
mainTab->append(
_("New page")
);
2024-08-12 19:11:00 +03:00
};
2024-08-14 07:11:24 +03:00
void Main::tab_update()
{
2024-08-27 14:30:23 +03:00
mainTab->update(
mainTab->get_current_page()
2024-08-14 07:35:19 +03:00
);
2024-08-14 07:11:24 +03:00
};
2024-08-12 19:11:00 +03:00
void Main::tab_close()
{
2024-08-27 14:30:23 +03:00
mainTab->close(
mainTab->get_current_page()
2024-08-12 21:12:08 +03:00
);
2024-08-12 20:24:06 +03:00
};
void Main::tab_close_left()
{
2024-08-27 14:30:23 +03:00
mainTab->close_left();
2024-08-12 20:24:06 +03:00
};
void Main::tab_close_right()
{
2024-08-27 14:30:23 +03:00
mainTab->close_right();
2024-08-12 20:24:06 +03:00
};
void Main::tab_close_all()
{
2024-08-27 14:30:23 +03:00
mainTab->close_all();
2024-08-27 15:53:15 +03:00
};
void Main::refresh()
{
mainTab->refresh(
mainTab->get_current_page()
);
2024-08-11 22:04:34 +03:00
};