Skip to content

Commit 6c9683d

Browse files
committed
resizable log output (fixed #6)
1 parent fa6a8b7 commit 6c9683d

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ int main(int argc, char *argv[]) {
1313
KAboutData aboutData(
1414
QStringLiteral("livetikz"),
1515
i18n("LiveTikZ"),
16-
QStringLiteral("0.2"),
16+
QStringLiteral("0.3"),
1717
i18n("A TikZ editor with live preview."),
1818
KAboutLicense::GPL,
19-
i18n("(c) 2017-2018 Michael Schwarz"),
19+
i18n("(c) 2017-2020 Michael Schwarz"),
2020
"",
2121
"https://misc0110.net"
2222
);

mainwindow.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ MainWindow::MainWindow() : currentDoc(NULL), renderProcess(NULL), currentPage(0)
261261
templateFile = QUrl(settings.value("template", "").toString());
262262
updateTemplate(templateFile.path());
263263
templateLabel->setText(templateFile.url(QUrl::PreferLocalFile));
264+
265+
texfileWatcher = NULL;
264266

265267
doc->setHighlightingMode("Latex");
266268

@@ -354,15 +356,16 @@ void MainWindow::setupUI() {
354356
window = new QWidget;
355357
mainLayout = new QHBoxLayout;
356358
splitView = new QSplitter(window);
359+
357360
templateLabel = new QLineEdit("Select template...");
358-
359361
browseButton = new QPushButton("Browse");
360362
templateLayout = new QHBoxLayout;
361363
templateLayout->addWidget(templateLabel);
362364
templateLayout->addWidget(browseButton);
363365

364-
leftLayout = new QVBoxLayout;
365-
leftLayout->addLayout(templateLayout);
366+
containerLayout = new QVBoxLayout;
367+
splitLogView = new QSplitter(Qt::Vertical, window);
368+
containerLayout->addLayout(templateLayout);
366369
splitView->addWidget(view);
367370

368371
display = new ZoomScrollImage;
@@ -371,22 +374,29 @@ void MainWindow::setupUI() {
371374
log->setReadOnly(true);
372375
log->ensureCursorVisible();
373376
QFontMetrics m(log->font());
374-
log->setFixedHeight(5 * m.lineSpacing());
377+
// log->setFixedHeight(5 * m.lineSpacing());
375378

376379
logLayout = new QHBoxLayout;
377380

378381
splitView->addWidget(display);
379-
leftLayout->addWidget(splitView);
382+
splitLogView->addWidget(splitView);
380383

381384
logLayout->addWidget(log);
382385

383386
killButton = new QPushButton("Abort compilation");
384387
killButton->setVisible(false);
385388
logLayout->addWidget(killButton);
386389

387-
leftLayout->addLayout(logLayout);
390+
logWidget = new QWidget();
391+
logWidget->setLayout(logLayout);
392+
393+
splitLogView->addWidget(logWidget);
394+
splitLogView->setStretchFactor(0, 7);
395+
splitLogView->setStretchFactor(1, 1);
396+
397+
containerLayout->addWidget(splitLogView);
388398

389-
mainLayout->addLayout(leftLayout);
399+
mainLayout->addLayout(containerLayout);
390400

391401
window->setLayout(mainLayout);
392402
setCentralWidget(window);

mainwindow.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public slots:
7171
QHBoxLayout *templateLayout;
7272
QHBoxLayout *logLayout;
7373
QSpacerItem *spacerItem;
74-
QVBoxLayout *leftLayout;
74+
QVBoxLayout *containerLayout;
75+
QSplitter* splitLogView;
76+
QWidget *logWidget;
7577

7678
KParts::ReadWritePart *katePart;
7779
KTextEditor::View *view;

0 commit comments

Comments
 (0)