Zren / material-decoration

Material-ish window decoration theme for KWin, with LIM, based on zzag's original design.
GNU General Public License v2.0
197 stars 17 forks source link

Ability to disable window move when dragging menu buttons #44

Open Zren opened 3 years ago

Zren commented 3 years ago

In Issue #2, @emvaized asked if we could disable the "window drag" option.

It will need to:

Zren commented 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:

emvaized commented 3 years ago

What should be changed in setCurrentIndex method (line 108)?

Zren commented 3 years ago

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.

emvaized commented 3 years ago

Oh, okay - got it!