MCPcopy Create free account
hub / github.com/KDE/kdevelop / updateAllTabColors

Method updateAllTabColors

kdevplatform/shell/mainwindow.cpp:506–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506void MainWindow::updateAllTabColors()
507{
508 auto documentController = Core::self()->documentController();
509 if (!documentController)
510 return;
511
512 const auto defaultColor = ::defaultColor(palette());
513 if (UiConfig::colorizeByProject()) {
514 QHash<const Sublime::View*, QColor> viewColors;
515 const auto containers = this->containers();
516 for (auto* container : containers) {
517 const auto views = container->views();
518 viewColors.reserve(views.size());
519 viewColors.clear();
520 for (auto view : views) {
521 const auto urlDoc = qobject_cast<Sublime::UrlDocument*>(view->document());
522 if (urlDoc) {
523 viewColors[view] = colorForDocument(urlDoc->url(), palette(), defaultColor);
524 }
525 }
526 container->setTabColors(viewColors);
527 }
528 } else {
529 const auto containers = this->containers();
530 for (auto* container : containers) {
531 container->resetTabColors(defaultColor);
532 }
533 }
534}
535
536void MainWindow::updateTabColor(IDocument* doc)
537{

Callers

nothing calls this directly

Calls 12

containersMethod · 0.95
defaultColorFunction · 0.85
colorForDocumentFunction · 0.85
documentControllerMethod · 0.80
setTabColorsMethod · 0.80
resetTabColorsMethod · 0.80
viewsMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
documentMethod · 0.45
urlMethod · 0.45

Tested by

no test coverage detected