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

Custom highlight color in tabs #5579

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

pajlada
Copy link
Member

@pajlada pajlada commented Aug 31, 2024

Original PR: #1557 authored by @2qar

2qar and others added 12 commits February 15, 2020 21:00
I put it there last night and I think I forgot about it :)
Moved the functionality to tabHighlightRequested instead of having two
signals that modify similar things
The little bit that set the tab's highlight color never checked whether
the tab was a nullptr or not
i'm a little silly
This makes the color look almost identical in highlights, but completely identical in tab highlights
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -397,6 +398,15 @@ bool NotebookTab::hasHighlightsEnabled() const
return this->highlightEnabled_;
}

void NotebookTab::setHighlightColor(std::shared_ptr<QColor> color)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'color' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
void NotebookTab::setHighlightColor(std::shared_ptr<QColor> color)
void NotebookTab::setHighlightColor(const std::shared_ptr<QColor>& color)

src/widgets/helper/NotebookTab.hpp:67:

-     void setHighlightColor(std::shared_ptr<QColor> color);
+     void setHighlightColor(const std::shared_ptr<QColor>& color);

});
conns.managedConnect(
split->getChannelView().tabHighlightRequested,
[this](HighlightState state, std::shared_ptr<QColor> color) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'color' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
[this](HighlightState state, std::shared_ptr<QColor> color) {
[this](HighlightState state, const std::shared_ptr<QColor>& color) {

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.

2 participants