From 73ee1578a9600915e5d48a3bbff2cd6321421388 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 21 Feb 2014 12:09:21 -0500 Subject: [PATCH] Keymap: Hide/show warning/stop icon views --- src/preferences/keymap/ModifierKeysWindow.cpp | 43 ++++++++++++++++++- src/preferences/keymap/ModifierKeysWindow.h | 3 +- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/preferences/keymap/ModifierKeysWindow.cpp b/src/preferences/keymap/ModifierKeysWindow.cpp index 902194898e..f0460b8039 100644 --- a/src/preferences/keymap/ModifierKeysWindow.cpp +++ b/src/preferences/keymap/ModifierKeysWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Haiku Inc. All rights reserved. + * Copyright 2011-2014 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -341,6 +341,8 @@ ModifierKeysWindow::ModifierKeysWindow() _MarkMenuItems(); _ValidateDuplicateKeys(); + + PostMessage(kMsgHideShowIcons); } @@ -398,6 +400,7 @@ ModifierKeysWindow::MessageReceived(BMessage* message) _MarkMenuItems(); _ValidateDuplicateKeys(); + _HideShowIcons(); // enable/disable revert button fRevertButton->SetEnabled( @@ -470,6 +473,7 @@ ModifierKeysWindow::MessageReceived(BMessage* message) _MarkMenuItems(); _ValidateDuplicateKeys(); + _HideShowIcons(); fRevertButton->SetEnabled(false); break; @@ -839,3 +843,40 @@ ModifierKeysWindow::_DuplicateKeys() return duplicateMask; } + + +void +ModifierKeysWindow::_HideShowIcons() +{ + if (fShiftConflictView->Icon() == NULL) { + while (!fShiftConflictView->IsHidden()) + fShiftConflictView->Hide(); + } else { + while (fShiftConflictView->IsHidden()) + fShiftConflictView->Show(); + } + + if (fControlConflictView->Icon() == NULL) { + while (!fControlConflictView->IsHidden()) + fControlConflictView->Hide(); + } else { + while (fControlConflictView->IsHidden()) + fControlConflictView->Show(); + } + + if (fOptionConflictView->Icon() == NULL) { + while (!fOptionConflictView->IsHidden()) + fOptionConflictView->Hide(); + } else { + while (fOptionConflictView->IsHidden()) + fOptionConflictView->Show(); + } + + if (fCommandConflictView->Icon() == NULL) { + while (!fCommandConflictView->IsHidden()) + fCommandConflictView->Hide(); + } else { + while (fCommandConflictView->IsHidden()) + fCommandConflictView->Show(); + } +} diff --git a/src/preferences/keymap/ModifierKeysWindow.h b/src/preferences/keymap/ModifierKeysWindow.h index 344321d9c8..aa77663435 100644 --- a/src/preferences/keymap/ModifierKeysWindow.h +++ b/src/preferences/keymap/ModifierKeysWindow.h @@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 Haiku Inc. All rights reserved. + * Copyright 2011-2014 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -57,6 +57,7 @@ private: int32 _LastKey(); void _ValidateDuplicateKeys(); uint32 _DuplicateKeys(); + void _HideShowIcons(); BPopUpMenu* fShiftMenu; BPopUpMenu* fControlMenu;