mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
use lambda function instead of private method
This commit is contained in:
parent
6aeff55cc8
commit
bdf33f1086
2 changed files with 7 additions and 23 deletions
|
|
@ -20,10 +20,13 @@ Label::Label(
|
||||||
controller->signal_pressed().connect(
|
controller->signal_pressed().connect(
|
||||||
[this](int n, double x, double y)
|
[this](int n, double x, double y)
|
||||||
{
|
{
|
||||||
on_click(
|
if (n == 2) // double click
|
||||||
n, x, y
|
{
|
||||||
|
activate_action(
|
||||||
|
"win.tab_close"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
add_controller(
|
add_controller(
|
||||||
|
|
@ -32,16 +35,3 @@ Label::Label(
|
||||||
}
|
}
|
||||||
|
|
||||||
Label::~Label() = default;
|
Label::~Label() = default;
|
||||||
|
|
||||||
void Label::on_click(
|
|
||||||
int n,
|
|
||||||
double x,
|
|
||||||
double y
|
|
||||||
) {
|
|
||||||
if (n == 2) // double click
|
|
||||||
{
|
|
||||||
activate_action(
|
|
||||||
"win.tab_close"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,6 @@ namespace app::browser::main::tab
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Gtk::GestureClick> controller;
|
Glib::RefPtr<Gtk::GestureClick> controller;
|
||||||
|
|
||||||
void on_click(
|
|
||||||
int n,
|
|
||||||
double x,
|
|
||||||
double y
|
|
||||||
);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Label(
|
Label(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue