mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2026-01-03 01:19:04 +08:00
fix: Fix group context menu shortcuts not working
This commit is contained in:
parent
75a694c38d
commit
0079b6f515
@ -86,6 +86,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
ui->tabWidget->installEventFilter(this);
|
||||
//
|
||||
RegisterHotkey(false);
|
||||
RegisterShortcuts();
|
||||
//
|
||||
auto last_size = NekoGui::dataStore->mw_size.split("x");
|
||||
if (last_size.length() == 2) {
|
||||
@ -1722,6 +1723,14 @@ void MainWindow::RegisterHotkey(bool unregister) {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::RegisterShortcuts() {
|
||||
for (const auto &action: ui->menuHidden_menu->actions()) {
|
||||
new QShortcut(action->shortcut(), this, [=](){
|
||||
action->trigger();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::HotkeyEvent(const QString &key) {
|
||||
if (key.isEmpty()) return;
|
||||
runOnUiThread([=] {
|
||||
|
||||
@ -192,6 +192,8 @@ private:
|
||||
|
||||
void HotkeyEvent(const QString &key);
|
||||
|
||||
void RegisterShortcuts();
|
||||
|
||||
// grpc
|
||||
|
||||
static void setup_grpc();
|
||||
|
||||
@ -419,9 +419,22 @@
|
||||
<addaction name="actionUrl_Test_Selected"/>
|
||||
<addaction name="menu_resolve_selected"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHidden_menu">
|
||||
<property name="title">
|
||||
<string>Hidden menu</string>
|
||||
</property>
|
||||
<addaction name="menu_update_subscription"/>
|
||||
<addaction name="menu_resolve_domain"/>
|
||||
<addaction name="menu_remove_invalid"/>
|
||||
<addaction name="actionUrl_Test_Group"/>
|
||||
<addaction name="menu_remove_unavailable"/>
|
||||
<addaction name="menu_clear_test_result"/>
|
||||
<addaction name="menu_delete_repeat"/>
|
||||
</widget>
|
||||
<addaction name="menu_program"/>
|
||||
<addaction name="menu_preferences"/>
|
||||
<addaction name="menu_server"/>
|
||||
<addaction name="menuHidden_menu"/>
|
||||
</widget>
|
||||
<action name="menu_exit">
|
||||
<property name="text">
|
||||
@ -701,6 +714,9 @@
|
||||
<property name="shortcut">
|
||||
<string notr="true">Ctrl+U</string>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_resolve_domain">
|
||||
<property name="text">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user