mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
implement separated tab label class
This commit is contained in:
parent
6e115ca3c1
commit
88e5ba3736
6 changed files with 87 additions and 46 deletions
44
src/app/browser/main/tab/label.cpp
Normal file
44
src/app/browser/main/tab/label.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#include "label.hpp"
|
||||
|
||||
using namespace app::browser::main::tab;
|
||||
|
||||
Label::Label()
|
||||
{
|
||||
set_text(
|
||||
_("New tab")
|
||||
);
|
||||
|
||||
// Setup label controller
|
||||
controller = Gtk::GestureClick::create();
|
||||
|
||||
/* @TODO remove as default
|
||||
controller->set_button(
|
||||
GDK_BUTTON_PRIMARY
|
||||
);*/
|
||||
|
||||
controller->signal_pressed().connect(
|
||||
sigc::mem_fun(
|
||||
* this,
|
||||
& Label::on_click
|
||||
)
|
||||
);
|
||||
|
||||
add_controller(
|
||||
controller
|
||||
);
|
||||
}
|
||||
|
||||
Label::~Label() = default;
|
||||
|
||||
void Label::on_click(
|
||||
int n,
|
||||
double x,
|
||||
double y
|
||||
) {
|
||||
if (n == 2) // double click
|
||||
{
|
||||
//Tab::close(
|
||||
// -1 // active
|
||||
//);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue