mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
UI: Defer creation of hotkey dupe icon until needed
This commit is contained in:
parent
bc9eee922e
commit
c3543273e4
|
@ -184,7 +184,13 @@ void OBSHotkeyEdit::ClearKey()
|
|||
|
||||
void OBSHotkeyEdit::UpdateDuplicationState()
|
||||
{
|
||||
if (dupeIcon && dupeIcon->isVisible() != hasDuplicate) {
|
||||
if (!dupeIcon && !hasDuplicate)
|
||||
return;
|
||||
|
||||
if (!dupeIcon)
|
||||
CreateDupeIcon();
|
||||
|
||||
if (dupeIcon->isVisible() != hasDuplicate) {
|
||||
dupeIcon->setVisible(hasDuplicate);
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -74,7 +74,6 @@ public:
|
|||
setAttribute(Qt::WA_InputMethodEnabled, false);
|
||||
setAttribute(Qt::WA_MacShowFocusRect, true);
|
||||
InitSignalHandler();
|
||||
CreateDupeIcon();
|
||||
ResetKey();
|
||||
}
|
||||
OBSHotkeyEdit(QWidget *parent = nullptr)
|
||||
|
@ -102,7 +101,7 @@ public:
|
|||
|
||||
protected:
|
||||
OBSSignal layoutChanged;
|
||||
QAction *dupeIcon;
|
||||
QAction *dupeIcon = nullptr;
|
||||
|
||||
void InitSignalHandler();
|
||||
void CreateDupeIcon();
|
||||
|
|
Loading…
Reference in a new issue