mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
implement label title widget
This commit is contained in:
parent
6f77138796
commit
1d8ec008d3
2 changed files with 52 additions and 0 deletions
22
src/app/browser/main/tab/label/title.cpp
Normal file
22
src/app/browser/main/tab/label/title.cpp
Normal 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
|
||||||
|
);
|
||||||
|
}
|
||||||
30
src/app/browser/main/tab/label/title.hpp
Normal file
30
src/app/browser/main/tab/label/title.hpp
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue