| 175 | } |
| 176 | |
| 177 | void AskPageWidget::initInputWidget() |
| 178 | { |
| 179 | QVBoxLayout *layout = new QVBoxLayout; |
| 180 | layout->setContentsMargins(10, 0, 10, 10); |
| 181 | layout->setSpacing(0); |
| 182 | inputWidget->setLayout(layout); |
| 183 | |
| 184 | QHBoxLayout *btnLayout = new QHBoxLayout; |
| 185 | layout->addLayout(btnLayout); |
| 186 | btnLayout->setContentsMargins(0, 0, 0, 0); |
| 187 | |
| 188 | deleteBtn = new DToolButton(this); |
| 189 | deleteBtn->setFixedSize(26, 26); |
| 190 | deleteBtn->setIcon(QIcon::fromTheme("uc_chat_clear")); |
| 191 | deleteBtn->setToolTip(tr("delete this session")); |
| 192 | |
| 193 | btnLayout->addWidget(deleteBtn); |
| 194 | |
| 195 | historyBtn = new DToolButton(this); |
| 196 | historyBtn->setIcon(QIcon::fromTheme("uc_chat_history")); |
| 197 | historyBtn->setFixedSize(26, 26); |
| 198 | historyBtn->setToolTip(tr("history sessions")); |
| 199 | historyBtn->hide(); // todo: Display after completion of functionality |
| 200 | btnLayout->addWidget(historyBtn); |
| 201 | |
| 202 | #if 0 // history not ready |
| 203 | createNewBtn = new DToolButton(this); |
| 204 | createNewBtn->setIcon(QIcon::fromTheme("uc_chat_new")); |
| 205 | createNewBtn->setFixedSize(26, 26); |
| 206 | createNewBtn->setToolTip(tr("create new session")); |
| 207 | btnLayout->addWidget(createNewBtn); |
| 208 | #endif |
| 209 | btnLayout->addStretch(1); |
| 210 | |
| 211 | modelCb = new QComboBox(this); |
| 212 | modelCb->setFixedHeight(26); |
| 213 | modelCb->setMaximumWidth(200); |
| 214 | updateModelCb(); |
| 215 | btnLayout->addWidget(modelCb); |
| 216 | |
| 217 | inputEdit = new InputEditWidget(inputWidget); |
| 218 | placeHolderText = tr("Ask question here, press Enter to send..."); |
| 219 | inputEdit->edit()->setPlaceholderText(placeHolderText); |
| 220 | |
| 221 | inputWidget->setFixedHeight(inputEdit->height() + inputExtraHeight); |
| 222 | inputWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); |
| 223 | |
| 224 | layout->addWidget(inputEdit); |
| 225 | } |
| 226 | |
| 227 | void AskPageWidget::initConnection() |
| 228 | { |
nothing calls this directly
no test coverage detected