| 121 | } |
| 122 | |
| 123 | void ProjectCore::addAutoFocusSwitcher(WindowService *windowService, DToolButton *autoFocusSwitcher, DToolButton *focusFile) |
| 124 | { |
| 125 | autoFocusSwitcher->setToolTip(tr("Auto Focus")); |
| 126 | autoFocusSwitcher->setIcon(QIcon::fromTheme("focus_auto")); |
| 127 | autoFocusSwitcher->setCheckable(true); |
| 128 | autoFocusSwitcher->setChecked(true); |
| 129 | |
| 130 | focusFile->setToolTip(tr("Focus File")); |
| 131 | focusFile->setIcon(QIcon::fromTheme("focus")); |
| 132 | |
| 133 | connect(focusFile, &DToolButton::clicked, this, []() { |
| 134 | ProjectKeeper::instance()->treeView()->focusCurrentFile(); |
| 135 | }, |
| 136 | Qt::DirectConnection); |
| 137 | focusFile->hide(); |
| 138 | |
| 139 | connect(autoFocusSwitcher, &DToolButton::clicked, this, [=]() { |
| 140 | bool state = ProjectKeeper::instance()->treeView()->getAutoFocusState(); |
| 141 | ProjectKeeper::instance()->treeView()->setAutoFocusState(!state); |
| 142 | if (state) { |
| 143 | focusFile->show(); |
| 144 | } else { |
| 145 | focusFile->hide(); |
| 146 | } |
| 147 | }, |
| 148 | Qt::DirectConnection); |
| 149 | } |
| 150 | |
| 151 | void ProjectCore::addProjectProperty(WindowService *windowService, DToolButton *projectProperty) |
| 152 | { |
nothing calls this directly
no test coverage detected