mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-07-05 20:42:08 -07:00
Add quit (Ctrl+Q) shortcut to GUI
This commit is contained in:
parent
801f902bea
commit
36816db7ac
4 changed files with 22 additions and 0 deletions
|
@ -55,6 +55,7 @@ class MainWindow : public QMainWindow
|
|||
|
||||
void UpdateDiscoveryEnabled();
|
||||
void ShowSettings();
|
||||
void Quit();
|
||||
|
||||
void UpdateDisplayServers();
|
||||
void UpdateServerWidgets();
|
||||
|
|
|
@ -48,6 +48,7 @@ class StreamWindow: public QMainWindow
|
|||
void ToggleFullscreen();
|
||||
void ToggleStretch();
|
||||
void ToggleZoom();
|
||||
void Quit();
|
||||
};
|
||||
|
||||
#endif // CHIAKI_GUI_STREAMWINDOW_H
|
||||
|
|
|
@ -146,6 +146,11 @@ MainWindow::MainWindow(Settings *settings, QWidget *parent)
|
|||
AddToolBarAction(settings_action);
|
||||
connect(settings_action, &QAction::triggered, this, &MainWindow::ShowSettings);
|
||||
|
||||
auto quit_action = new QAction(tr("Quit"), this);
|
||||
quit_action->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
addAction(quit_action);
|
||||
connect(quit_action, &QAction::triggered, this, &MainWindow::Quit);
|
||||
|
||||
auto scroll_area = new QScrollArea(this);
|
||||
scroll_area->setWidgetResizable(true);
|
||||
scroll_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
@ -305,6 +310,11 @@ void MainWindow::ShowSettings()
|
|||
dialog.exec();
|
||||
}
|
||||
|
||||
void MainWindow::Quit()
|
||||
{
|
||||
qApp->exit();
|
||||
}
|
||||
|
||||
void MainWindow::UpdateDisplayServers()
|
||||
{
|
||||
display_servers.clear();
|
||||
|
|
|
@ -102,6 +102,11 @@ void StreamWindow::Init()
|
|||
addAction(zoom_action);
|
||||
connect(zoom_action, &QAction::triggered, this, &StreamWindow::ToggleZoom);
|
||||
|
||||
auto quit_action = new QAction(tr("Quit"), this);
|
||||
quit_action->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||
addAction(quit_action);
|
||||
connect(quit_action, &QAction::triggered, this, &StreamWindow::Quit);
|
||||
|
||||
resize(connect_info.video_profile.width, connect_info.video_profile.height);
|
||||
|
||||
if(connect_info.fullscreen)
|
||||
|
@ -127,6 +132,11 @@ void StreamWindow::keyReleaseEvent(QKeyEvent *event)
|
|||
session->HandleKeyboardEvent(event);
|
||||
}
|
||||
|
||||
void StreamWindow::Quit()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
void StreamWindow::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if(session && session->HandleMouseEvent(event))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue