Skip to content

Conversation

@Warchamp7
Copy link
Member

Description

Clean up some logic in Idian widgets and introduce ability to adjust icon colors based on widget state.

Motivation and Context

Qt itself does not allow style selectors for child widgets underneath a state selector. For example, it is impossible to do the following:

QFrame:hover QPushbutton {
    background: red;
}

To navigate around this shortcoming of QSS, the Idian widgets in many places apply a property matching the various states, such as .hover and then trigger an update of children widget styles.

The first commit of this PR moves that logic into a dedicated Event Filter. This also allows this logic to be applied to any other widget by using the idian::Utils class.

The second commit adds additional functionality to the event filter, which will take the computed text color of a widget and apply that color to it's icon. This will give us the ability to adjust colors of icons that have been set by QSS, as qproperty-icon also cannot be changed in pseudo state selector rules like :hover and :disabled.

How Has This Been Tested?

Tested all widgets in the Idian playground widget, as well as my local work-in-progress Audio Mixer refactor branch.

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Tweak (non-breaking change to improve existing functionality)
  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Warchamp7 Warchamp7 force-pushed the idian-states-filter branch from 4d28e7e to 2aadffd Compare October 15, 2025 22:17
@Warchamp7 Warchamp7 force-pushed the idian-states-filter branch from 2aadffd to e82a423 Compare October 15, 2025 22:43
@WizardCM WizardCM added Enhancement Improvement to existing functionality Code Cleanup Non-breaking change which makes code smaller or more readable New Feature New feature or plugin labels Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup Non-breaking change which makes code smaller or more readable Enhancement Improvement to existing functionality New Feature New feature or plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants