Browse Source

implement label title widget

CPP-GTK4
yggverse 3 months ago
parent
commit
1d8ec008d3
  1. 22
      src/app/browser/main/tab/label/title.cpp
  2. 30
      src/app/browser/main/tab/label/title.hpp

22
src/app/browser/main/tab/label/title.cpp

@ -0,0 +1,22 @@ @@ -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
);
}

30
src/app/browser/main/tab/label/title.hpp

@ -0,0 +1,30 @@ @@ -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
Loading…
Cancel
Save