Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable window move when dragging menu buttons #44

Open
Zren opened this issue Mar 24, 2021 · 4 comments
Open

Ability to disable window move when dragging menu buttons #44

Zren opened this issue Mar 24, 2021 · 4 comments

Comments

@Zren
Copy link
Owner

Zren commented Mar 24, 2021

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

It will need to:

@Zren
Copy link
Owner Author

Zren commented Mar 24, 2021

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
Copy link

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

@Zren
Copy link
Owner Author

Zren commented Mar 24, 2021

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
Copy link

Oh, okay - got it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants