From 509593493178a65a2e5db4a45eec7c95c3cbee0f Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Sun, 1 Apr 2018 09:20:36 +0200 Subject: [PATCH] Fixed author name not showing up. --- gui/mainwindow.cpp | 7 ++++++- gui/mainwindow.ui | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c552432..9f8c381 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -24,6 +24,7 @@ void MainWindow::loadFromRecipe(Recipe recipe){ setAuthorName("Click 'New' to get started."); } else { setRecipeName(recipe.getName()); + setAuthorName(recipe.getAuthor()); setInstruction(recipe.getInstruction()); setIngredients(recipe.getIngredients()); if (recipe.getImage().isNull()){ @@ -72,7 +73,11 @@ void MainWindow::setTags(vector tags){ } void MainWindow::setAuthorName(string name){ - ui->authorLabel->setText(QString::fromStdString(name)); + if (name.empty()){ + ui->authorLabel->setText(""); + } else { + ui->authorLabel->setText(QString::fromStdString("By "+name)); + } } void MainWindow::on_newButton_clicked(){ diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 266c9b1..a80624e 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -373,7 +373,7 @@ font: "Noto Sans CJK KR"; - 20 + 16