Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline our custom Label/LineEdit system #745

Merged
merged 6 commits into from
Apr 30, 2023

Conversation

matty0ung
Copy link
Contributor

Broadly speaking, the idea was to create two new classes, SmartLabel and SmartLineEdit replace the inheritance hierarchies of BtLabel and BtLineEdit. Having to create a new (albeit trivial) subclass of each of these for each new type of thing we want to measure was becoming unwieldy. Also, as @mikfire has previously noted, it's a pain to have to remember which version of BtLineEdit etc to use where in the .ui file.

There is slightly more to it, specifically:

  • BtLabel and all its subclasses (BtColorLabel, BtDensityLabel, etc) -> widgets/SmartLabel
  • BtLineEdit and all its subclasses (BtGenericEdit, BtMassEdit, etc) -> widgets/SmartLineEdit
  • BtDigitWidget and its subclasses (BtMassDigit, BtGenericDigit) -> widgets/SmartDigitWidget
  • UiAmountWithUnits -> SmartField (base class for SmartLineEdit and SmartDigitWidget)
  • New helper functions in SmartAmounts namespace, plus macros to call them

Various bits of .ui files are simplified as, eg, signal connections are done in code now.

This should fix #733

Also includes fixes for #741 and #743

@matty0ung matty0ung merged commit ffbf8e8 into Brewtarget:develop Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some more confusion about decimal separators
1 participant