implement label title widget

This commit is contained in:
yggverse 2024-09-17 07:25:23 +03:00
parent 6f77138796
commit 1d8ec008d3
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#include "title.hpp"
using namespace app::browser::main::tab::label;
Title::Title()
{
set_text(
_("New page")
);
set_ellipsize(
Pango::EllipsizeMode::END
);
set_width_chars(
WIDTH_CHARS
);
set_single_line_mode(
true
);
}

View File

@ -0,0 +1,30 @@
#ifndef APP_BROWSER_MAIN_TAB_LABEL_NAME_HPP
#define APP_BROWSER_MAIN_TAB_LABEL_NAME_HPP
#include <glibmm/i18n.h>
#include <glibmm/ustring.h>
#include <gtkmm/label.h>
#include <pangomm/layout.h>
namespace app::browser::main::tab::label
{
class Title : public Gtk::Label
{
/*
* Internal members
*/
private:
// Defaults
static const int WIDTH_CHARS = 16;
/*
* Class API
*/
public:
Title();
};
}
#endif // APP_BROWSER_MAIN_TAB_LABEL_NAME_HPP