| 1874 | } |
| 1875 | |
| 1876 | std::optional<Options::MouseCommand> Window::getMousePressCommand(Qt::MouseButton button) const |
| 1877 | { |
| 1878 | if (button == Qt::NoButton) { |
| 1879 | return std::nullopt; |
| 1880 | } |
| 1881 | if (isActive()) { |
| 1882 | if (options->isClickRaise() && !isMostRecentlyRaised()) { |
| 1883 | return Options::MouseActivateRaiseAndPassClick; |
| 1884 | } |
| 1885 | } else { |
| 1886 | switch (button) { |
| 1887 | case Qt::LeftButton: |
| 1888 | return options->commandWindow1(); |
| 1889 | case Qt::MiddleButton: |
| 1890 | return options->commandWindow2(); |
| 1891 | case Qt::RightButton: |
| 1892 | return options->commandWindow3(); |
| 1893 | default: |
| 1894 | // all other buttons pass Activate & Pass Client |
| 1895 | return Options::MouseActivateAndPassClick; |
| 1896 | } |
| 1897 | } |
| 1898 | return std::nullopt; |
| 1899 | } |
| 1900 | |
| 1901 | std::optional<Options::MouseCommand> Window::getMouseReleaseCommand(Qt::MouseButton button) const |
| 1902 | { |
no test coverage detected