Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/controllers/hotkeys/ActionNames.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,21 @@ inline const std::map<HotkeyCategory, ActionDefinitionMap> actionNames{
.argumentsPromptHover = "Should the tabs be enabled, disabled, "
"toggled, or live-only.",
}},
{"lockZoom",
ActionDefinition{
.displayName = "Lock zoom",
.argumentDescription = "[lock, unlock, toggle. default: toggle]",
.minCountArguments = 0,
.maxCountArguments = 1,
.possibleArguments{
{"Toggle", {}},
{"Lock zoom", {"lock"}},
{"Unlock zoom", {"unlock"}},
},
.argumentsPrompt = "New value:",
.argumentsPromptHover =
"Should the zoom be locked, unlocked, or toggled.",
}},
}},
};

Expand Down
30 changes: 30 additions & 0 deletions src/widgets/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,36 @@ void Window::addShortcuts()
.arg(arg);
}

return "";
}},
{"lockZoom",
[this](std::vector<QString> arguments) -> QString {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: lambda capture 'this' is not used [clang-diagnostic-unused-lambda-capture]

Suggested change
[this](std::vector<QString> arguments) -> QString {
[](std::vector<QString> arguments) -> QString {

QString arg = arguments.empty() ? "toggle" : arguments.front();

if (arg == "lock")
{
qInfo() << "XXX: LOCK ZOOM";
// TODO: Implement zoom locking
}
else if (arg == "unlock")
{
qInfo() << "XXX: UNLOCK ZOOM";
// TODO: Implement zoom unlocking
}
else if (arg == "toggle")
{
qInfo() << "XXX: TOGGLE ZOOM LOCK";
// TODO: Implement zoom lock toggling
}
else
{
qCWarning(chatterinoHotkeys)
<< "Invalid argument for lockZoom hotkey: " << arg;
return QString(
R"(Invalid argument for lockZoom hotkey: %1. Use "lock", "unlock", or "toggle".)")
.arg(arg);
}

return "";
}},
};
Expand Down
Loading