impr: Disable main menu items for views that aren't selected right now

This commit is contained in:
WerWolv
2025-02-02 22:32:24 +01:00
parent 7752354598
commit 9fb38922ea
3 changed files with 15 additions and 5 deletions

View File

@@ -98,6 +98,14 @@ namespace hex {
[[nodiscard]] static std::string toWindowName(const UnlocalizedString &unlocalizedName);
[[nodiscard]] bool isFocused() const { return m_focused; }
/**
* @brief Used for focus handling. Don't use this directly
* @param focused Whether this view is focused
*/
void setFocused(bool focused) { m_focused = focused; }
public:
class Window;
class Special;
@@ -110,6 +118,7 @@ namespace hex {
std::map<Shortcut, ShortcutManager::ShortcutEntry> m_shortcuts;
bool m_windowJustOpened = false;
const char *m_icon;
bool m_focused = false;
friend class ShortcutManager;
};