-
Notifications
You must be signed in to change notification settings - Fork 25
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
Implement support for further grouping by category in Library (HVAC, Schedules, etc) #713
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
1. implement OSCategoryPlaceholder class for further grouping inside OSCollapsibleItemList 2. Modification to search bar to use category in addition to type and name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this is neat, thanks a lot @manuvarkey
I do question whether we shouldn't use an actual OSCollapsibleItemHeader directly, so we can expand it or not.
Here is a demo of the current code:
void OSCollapsibleItemList::addCategoryPlaceholderItem(OSCategoryPlaceholder* categoryPlaceholderItem) { | ||
|
||
m_placeholderItems.push_back(categoryPlaceholderItem); | ||
m_vLayout->insertWidget(0, categoryPlaceholderItem); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@macumber This makes me realize we have a std::vector<OSCollapsibleItem*> m_collapsibleItems;
but our void OSCollapsibleItemList::addCollapsibleItem(OSCollapsibleItem* collapsibleItem)
does not add to it... even though other functions loop on it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah looks like we never add anything to m_collapsibleItems
so it's kind of useless.
We did discuss adding a second level of expanding headers in #123 but I steered @manuvarkey towards the solution he implemented because I thought the multiple levels of collapsable headers would get complicated. I updated the code to compile, changed the style of the placeholder, and added categories to all the tabs. What do you think? |
The style looks great. And I can understand the rationale behind too much grouping = confusing. LGTM, feel free to merge at will! |
this->setProperty("style", "0"); | ||
this->setStyleSheet("QWidget#OSCategoryPlaceholder[style=\"0\"] { background-color: #95B3DE; border-bottom: 1px solid black; }"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a side note than anything, but I wonder when we should just inline styles versus using the qss stylesheet. @macumber do you have rules for this?
OpenStudioApplication/src/openstudio_lib/openstudiolib.qss
Lines 989 to 995 in a9b492b
QWidget#NavigatorWidget { | |
background: #808080; | |
border-bottom: 1px solid black; | |
/* | |
border-right: 1px solid #C0C0C0; | |
*/ | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always torn between trying to write documentation and rules for what exists vs burn it all down and start over. I think it would make the most sense to have all styes in qss files, but that would require a sensible naming hierarchy everywhere. It gets hard when a name changes and the styles don't apply to some tab anymore.
OSCategoryPlaceholder
class for further grouping insideOSCollapsibleItemList