Skip to content

Conversation

@mxmilkiib
Copy link
Contributor

adds a checkbox in Preferences > Controllers to hide controllers that are not enabled, making it easier for users with many controllers to find the ones they actually use.

the checkbox state is persisted in the config and the controller list visibility is updated efficiently using setHidden() to avoid expensive widget rebuilding.

implementation:

  • added checkbox ui element "hide controllers that are not enabled"
  • persists state in [controller]/hide_unenabled_controllers config key
  • uses lightweight updatecontrollervisibility() method to toggle tree item visibility instead of destroying/rebuilding all widgets
  • matches controllers correctly using controller pages in sync with tree items
  • updates visibility automatically when controller enabled state changes
  • added controller() getter to dlgprefcontroller for proper matching

fixes #14275

@mxmilkiib mxmilkiib marked this pull request as ready for review November 15, 2025 07:33
adds a checkbox in preferences > controllers to hide controllers
that are not enabled, making it easier for users with many controllers
to find the ones they actually use.

the checkbox state is persisted in the config and the controller list
visibility is updated efficiently using setHidden() to avoid expensive
widget rebuilding.

implementation:
- added checkbox ui element "hide controllers that are not enabled"
- persists state in [controller]/hide_unenabled_controllers config key
- uses lightweight updatecontrollervisibility() method to toggle tree
  item visibility instead of destroying/rebuilding all widgets
- matches controllers correctly using controller pages in sync with tree
  items
- updates visibility automatically when controller enabled state changes
- added controller() getter to dlgprefcontroller for proper matching

fixes mixxxdj#14275
@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.05-hide-unenabled-controllers branch from ba6f6e0 to 7c87579 Compare November 15, 2025 18:10
QTreeWidgetItem* pTreeItem = m_controllerTreeItems.at(i);
DlgPrefController* pControllerDlg = m_controllerPages.at(i);

if (pTreeItem && pControllerDlg && pControllerDlg->controller()) {
Copy link
Member

Choose a reason for hiding this comment

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

The DlgPrefController ctor does not assert a valid Controller* and there are no issues with that so I think we don't to check here either

Suggested change
if (pTreeItem && pControllerDlg && pControllerDlg->controller()) {
if (pTreeItem && pControllerDlg) {

#endif

const ConfigKey kHideUnenabledControllersCfgKey =
ConfigKey(QStringLiteral("[Controller]"), QStringLiteral("hide_unenabled_controllers"));
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember I ever came across "unenabled"?
Wh< not "disabled"?

Suggested change
ConfigKey(QStringLiteral("[Controller]"), QStringLiteral("hide_unenabled_controllers"));
ConfigKey(QStringLiteral("[Controller]"), QStringLiteral("hide_disabled_controllers"));

Copy link
Member

Choose a reason for hiding this comment

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

For consistency, same for the config keys, function names and UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checkbox on Prefs > Controllers to hide unenabled controllers

2 participants