Open Zren opened 3 years ago
You'd need to write a new function to handle the AppMenuButton::pressed
signal.
In the AppMenuButton
constructor(AppMenuButton::AppMenuButton
), we need to connect(...)
a signal to another signal. I'm not sure if Qt's connect functions supports that, so we'll just create an anonymous "slot" function, that emits the other signal. I'll need the slot function anyways since I'll need to check the config first to see if I need to emit the clicked signal.
Here's an example which I have NOT tested.
connect(this, &AppMenuButton::pressed,
[this] {
emit clicked();
}
);
connect(this, &AppMenuButton::clicked,
this, &AppMenuButton::trigger);
Eg:
What should be changed in setCurrentIndex
method (line 108)?
Those were just examples of emit
and an anonymous connect function. I wasn't planning on doing a complete example when I added the examples.
Oh, okay - got it!
In Issue #2, @emvaized asked if we could disable the "window drag" option.
It will need to:
initDragMove(event->pos());
inDecoration::mousePressEvent
when config says so.AppMenuButton::pressed
signal to theAppMenuButton::clicked
signal. In thepressed
signal handler, check if the config option is set, then emit the clicked signal.