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

Implement support for further grouping by category in Library (HVAC, Schedules, etc) #713

Merged
merged 6 commits into from
Jul 11, 2024

Conversation

manuvarkey
Copy link
Contributor

  1. Implement OSCategoryPlaceholder class for further grouping inside OSCollapsibleItemList
  2. Modification to search bar to use category in addition to type and name.
  3. Resolves Organize HVAC library by category #123

Copy link
Contributor

github-actions bot commented May 8, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@manuvarkey
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request May 8, 2024
1. implement OSCategoryPlaceholder class for further grouping inside OSCollapsibleItemList
2. Modification to search bar to use category in addition to type and name.
Copy link
Collaborator

@jmarrec jmarrec left a 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:

Peek 2024-05-13 15-25

Comment on lines +171 to +175
void OSCollapsibleItemList::addCategoryPlaceholderItem(OSCategoryPlaceholder* categoryPlaceholderItem) {

m_placeholderItems.push_back(categoryPlaceholderItem);
m_vLayout->insertWidget(0, categoryPlaceholderItem);
}
Copy link
Collaborator

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...

Copy link
Collaborator

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.

@macumber
Copy link
Collaborator

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?

image

@jmarrec
Copy link
Collaborator

jmarrec commented Jul 8, 2024

The style looks great. And I can understand the rationale behind too much grouping = confusing.

LGTM, feel free to merge at will!

Comment on lines +48 to +49
this->setProperty("style", "0");
this->setStyleSheet("QWidget#OSCategoryPlaceholder[style=\"0\"] { background-color: #95B3DE; border-bottom: 1px solid black; }");
Copy link
Collaborator

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?

QWidget#NavigatorWidget {
background: #808080;
border-bottom: 1px solid black;
/*
border-right: 1px solid #C0C0C0;
*/
}

Copy link
Collaborator

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.

@macumber macumber merged commit 203fd59 into openstudiocoalition:develop Jul 11, 2024
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2024
@jmarrec jmarrec changed the title Implement support for further grouping HVAC library by category Implement support for further grouping by category in Library (HVAC, Schedules, etc) Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Organize HVAC library by category
3 participants