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

method to set label before checkbox in CheckboxSetInputBase class #557

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

milosilic
Copy link
Collaborator

Ability to set the labels for each checkbox on the left side of the toggle.
The spacing between two filters and their belonging labels are made bigger so it is more clear which label refers to which toggle.

display: flex;
align-items: center;
}
.ui-cbis-p label {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We want extra margin only when label is before checkbox, otherwise it would consume some unwanted space when it is used as after checkbox.
Add separate part of style (label-first) to mark that:
.ui-cbis-p {
padding-right: 10px;
&.label-first {
display: flex;
align-items: center;
label {
margin-right: 4px;
}
}
}

IRenderInto<T> cr = m_actualContentRenderer;
if(cr == null)
cr = m_actualContentRenderer = calculateContentRenderer(lv);
Label span = new Label();
span.setForTarget((NodeBase) cb);
pair.add(span);
if(m_labelBeforeCheckbox) {
pair.add(span);
Copy link
Collaborator

Choose a reason for hiding this comment

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

add:
span.addCss("label-first");

Copy link
Collaborator

@millevlada millevlada left a comment

Choose a reason for hiding this comment

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

see remarks

IRenderInto<T> cr = m_actualContentRenderer;
if(cr == null)
cr = m_actualContentRenderer = calculateContentRenderer(lv);
Label span = new Label();
span.setForTarget((NodeBase) cb);
pair.add(span);
if(m_labelBeforeCheckbox) {
span.addCssClass("label-first");
Copy link
Owner

Choose a reason for hiding this comment

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

All css classes in DomUI use the ui-prefix combined with the component short code.

@fjalvingh fjalvingh merged commit 67ebf56 into skarp-master Sep 10, 2024
2 checks passed
@fjalvingh fjalvingh deleted the labelBeforeCheckbox branch September 10, 2024 09:16
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.

3 participants