ui: change about dialog
authorjihye <jihye424.kim@samsung.com>
Thu, 5 Jan 2017 10:58:48 +0000 (19:58 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 14 Feb 2017 05:21:12 +0000 (14:21 +0900)
Change-Id: Ic28c8e109bd6517cf71d7b6fb9caf16161087d2b
Signed-off-by: jihye <jihye424.kim@samsung.com>
tizen/src/Makefile
tizen/src/ui/menu/aboutdialog.cpp
tizen/src/ui/menu/aboutdialog.h
tizen/src/ui/resource/images/about_bg.png [new file with mode: 0644]
tizen/src/ui/resource/images/tizen_sdk.png [deleted file]
tizen/src/ui/resource/resource.qrc
tizen/src/ui/resource/ui_strings.h

index e5cd5ee..5fa5024 100755 (executable)
@@ -63,7 +63,7 @@ endif
 
 ifdef CONFIG_QT
        cp -pP ui/resource/images/display_off_guide.png $(EMUL_DIR)/images
-       cp -pP ui/resource/images/tizen_sdk.png $(EMUL_DIR)/images
+       cp -pP ui/resource/images/about_bg.png $(EMUL_DIR)/images
 ifdef CONFIG_DARWIN
        cp -pP ui/resource/icons/emulator_icon.ico $(EMUL_DIR)/icons
 endif
index b956dd8..7667ad0 100644 (file)
@@ -4,8 +4,9 @@
  * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
+ * jihye kim <jihye424.kim@samsung.com>
  * GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
 #include "mainwindow.h"
 #include "emul_state.h"
 
+#ifdef CONFIG_WIN32
+#define TITLE_FONT_SIZE_1 11
+#define TITLE_FONT_SIZE_2 22
+#define TITLE_FONT_SIZE_3 "11"
+#define TEXT_FONT_SIZE 8
+#elif defined(CONFIG_DARWIN)
+#define TITLE_FONT_SIZE_1 14
+#define TITLE_FONT_SIZE_2 25
+#define TITLE_FONT_SIZE_3 "14"
+#define TEXT_FONT_SIZE 12
+#else
+#define TITLE_FONT_SIZE_1 12
+#define TITLE_FONT_SIZE_2 23
+#define TITLE_FONT_SIZE_3 "12"
+#define TEXT_FONT_SIZE 10
+#endif
+
 AboutDialog::AboutDialog(QWidget *parent) :
     QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint)
 {
     setWindowTitle(ABOUT_TITLE);
-
-    // remove ? button
+    /* remove ? button */
     setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+    setStyleSheet("background-color: white");
 
-    QVBoxLayout *baseLayout = new QVBoxLayout(this);
-    baseLayout->setMargin(0);
-    baseLayout->setSpacing(5);
-
-    /* upside */
-    QHBoxLayout *upsideLayout = new QHBoxLayout();
-    upsideLayout->setMargin(0);
-    upsideLayout->setSpacing(0);
-
+    /* top side - title image */
     QLabel *imageLabel = new QLabel(this);
     QString sdkImagePath = QDir(QCoreApplication::applicationDirPath() +
         QDir::separator() + SDK_EMULATOR_IMAGES_PATH + SDK_ABOUT_IMAGE_FILE).absolutePath();
-    QPixmap sdkImage(sdkImagePath);
-    if (sdkImage.isNull() == false) {
-        imageLabel->setPixmap(sdkImage);
-    } else {
+
+    QPixmap sdkImage(430, 90);
+    sdkImage.fill(Qt::blue);
+    if (!sdkImage.load(sdkImagePath)) {
         qWarning() << "failed to load image from" << sdkImagePath;
     }
-    upsideLayout->addWidget(imageLabel);
+    imageLabel->setPixmap(sdkImage);
+
+    /* make title text */
+    makeTitleText(imageLabel);
+
+    /* bottom side */
+    QFrame *line = new QFrame();
+    line->setStyleSheet("color: rgb(173, 173, 173)");
+    line->setFrameShape(QFrame::HLine);
+    line->setLineWidth(1);
+    line->setFrameShadow(QFrame::Plain);
+
+    QHBoxLayout *downsideLayout = new QHBoxLayout();
+    downsideLayout->setAlignment(Qt::AlignRight);
+    downsideLayout->setContentsMargins(20,18, 20, 18);
+    QPushButton *closeBtn = new QPushButton("Close", this);
+    closeBtn->setMinimumSize(QSize(86, 24));
+    closeBtn->setStyleSheet(
+            "QPushButton {"
+                "border: 2px solid #008AEE;"
+                "border-radius: 0px;"
+                "background-color: #E1E1E1;"
+                "background-radius: 0px;"
+                "outline: none;"
+            "}"
+            "QPushButton:hover {"
+                "background-color: #CDE9FF;"
+            "}"
+            "QPushButton:pressed {"
+                "background-color: #008AEE;"
+            "}");
+
+    connect(closeBtn, SIGNAL(clicked()), this, SLOT(close()));
+    downsideLayout->addWidget(closeBtn);
+
+    QVBoxLayout *baseLayout = new QVBoxLayout(this);
+    baseLayout->setMargin(0);
+    baseLayout->setSpacing(0);
+    baseLayout->addWidget(imageLabel);
+
+    /* center side */
+    baseLayout->addLayout(makeAboutText());
+
+    baseLayout->addWidget(line);
+    baseLayout->addLayout(downsideLayout);
+}
 
-    /* Emulator platform version*/
+void AboutDialog::makeTitleText(QWidget *widget)
+{
+    /* Emulator platform version */
     QString platformVersion = QString(get_platform_version()).section('-', 1).trimmed();
 
+    QLabel *sdk_name = new QLabel();
+    QLabel *title = new QLabel();
+    sdk_name->setStyleSheet("background-color: rgba(255,255,255,0%)");
+    title->setStyleSheet("background-color: rgba(255,255,255,0%)");
+    sdk_name->setText("<font color=\"white\">" + QString(SDK_OFFICIAL_NAME) + "</font>");
+
+    title->setText("<font color=\"white\">" + QString("Emulator ")
+                + "<span style=\"font-size:" + TITLE_FONT_SIZE_3 + "pt\">"+ QString("for " + platformVersion)
+                + "</span>" + "</font>");
+
+    QFont font = sdk_name->font();
+    font.setFamily("Arial");
+    font.setPointSize(TITLE_FONT_SIZE_1);
+    sdk_name->setFont(font);
+
+    font = title->font();
+    font.setFamily("Arial");
+    font.setPointSize(TITLE_FONT_SIZE_2);
+    font.setBold(true);
+    title->setFont(font);
+
+    sdk_name->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+    title->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+
+    QVBoxLayout *box = new QVBoxLayout(widget);
+    QVBoxLayout *titleLayout = new QVBoxLayout();
+    titleLayout->setSpacing(0);
+    titleLayout->setMargin(0);
+
+    titleLayout->addWidget(sdk_name);
+    titleLayout->addWidget(title);
+
+    box->setContentsMargins(28,20,50,17);
+    box->addLayout(titleLayout);
+}
+
+QLayout * AboutDialog::makeAboutText()
+{
     /* SDK version */
     QString versionFilePath = QDir(QCoreApplication::applicationDirPath() +
         QDir::separator() + SDK_ROOT_PATH + SDK_VERSION_FILE).absolutePath();
     QSettings versionFile(versionFilePath, QSettings::IniFormat);
-    QString sdkVer = versionFile.value(SDK_VERSION_FILE_KEY).toString();
-    if (sdkVer.isEmpty() == true) {
+
+    QString sdkVerTxt = versionFile.value(SDK_VERSION_FILE_KEY).toString();
+    if (sdkVerTxt.isEmpty() == true) {
         qWarning() << "failed to load SDK version file from" << versionFilePath;
-        sdkVer = GENERIC_TEXT_UNDEFINED;
+        sdkVerTxt = GENERIC_TEXT_UNDEFINED;
     }
 
     /* Package version */
-    QString pkgVer = QString(pkginfo_version).section(':', 1);
-
-    /*
-    QString SnapshotName = "Undefined";
-    QFile file("../../../install-manager/installmanager.conf");
-    if (file.open(QIODevice::ReadOnly | QIODevice::Text) == true) {
-        QTextStream in(&file);
-        while (!in.atEnd()) {
-            QString line = in.readLine();
-            if (line.startsWith("Snapshot-Path", Qt::CaseInsensitive) == true) {
-                QStringList snapshotPath = line.split(":", QString::SkipEmptyParts)[1].split("/");
-                SnapshotName = snapshotPath.last().trimmed();
-                qDebug() << "Snapshot Name :" << SnapshotName;
-            }
-        }
-
-        file.close();
-    } else {
-        qWarning("failed to load snapshot name");
-    }
-    */
-
-    QString aboutText =
-        "<b>" + QString(EMULATOR_TITLE) + " for " +  platformVersion + "</b><p>" +
-        ABOUT_SDK_VERSION_TEXT + " : " + sdkVer + "<br>" +
-        ABOUT_PKG_VERSION_TEXT + " : " + pkgVer + "<br>" +
-        /* "Snapshot : " + SnapshotName + "<br>" + */
-        ABOUT_BUILD_DATE_TEXT + " : " + QString(build_date) + "<p><br>" +
-        ABOUT_VISIT_TEXT + " <a href=\"" + SDK_OFFICIAL_URL + "\">" +
-        SDK_OFFICIAL_URL + "</a>";
-
-    QLabel *textLabel = new QLabel(this);
-    textLabel->setStyleSheet("background-color: white");
-    textLabel->setTextFormat(Qt::RichText);
-    //textLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
-    textLabel->setOpenExternalLinks(true);
-    textLabel->setMargin(10);
-    textLabel->setText(aboutText);
-    upsideLayout->addWidget(textLabel);
-
-    baseLayout->addLayout(upsideLayout);
-
-    /* downside */
-    QHBoxLayout *downsideLayout = new QHBoxLayout();
-    downsideLayout->setAlignment(Qt::AlignRight);
-    downsideLayout->setMargin(10);
-
-    QPushButton *okBtn = new QPushButton("OK", this);
-    connect(okBtn, SIGNAL(clicked()), this, SLOT(close()));
-    downsideLayout->addWidget(okBtn);
-
-    baseLayout->addLayout(downsideLayout);
+    QString pkgVerTxt = QString(pkginfo_version).section(':', 1);
+    QString siteTxt = "<a href=\"" + QString(SDK_OFFICIAL_URL) + "\">"
+            SDK_OFFICIAL_URL + "</a>";
+
+    QLabel *sdkVerTitle = new QLabel(ABOUT_SDK_VERSION_TEXT);
+    QLabel *sdkVer = new QLabel(sdkVerTxt);
+    QLabel *pkgVerTitle = new QLabel(ABOUT_PKG_VERSION_TEXT);
+    QLabel *pkgVer = new QLabel(pkgVerTxt);
+    QLabel *buildDateTitle = new QLabel(ABOUT_BUILD_DATE_TEXT);
+    QLabel *buildDate = new QLabel(QString(build_date));
+    QLabel *siteTitle = new QLabel(ABOUT_VISIT_TEXT);
+    QLabel *site = new QLabel();
+    site->setTextFormat(Qt::RichText);
+    site->setOpenExternalLinks(true);
+    site->setText(siteTxt);
+
+    QFont titleFont = sdkVerTitle->font();
+    titleFont.setPointSize(TEXT_FONT_SIZE);
+    titleFont.setBold(true);
+    sdkVerTitle->setFont(titleFont);
+    pkgVerTitle->setFont(titleFont);
+    buildDateTitle->setFont(titleFont);
+    siteTitle->setFont(titleFont);
+
+    QFont txtFont = sdkVer->font();
+    txtFont.setPointSize(TEXT_FONT_SIZE);
+    sdkVer->setFont(txtFont);
+    pkgVer->setFont(txtFont);
+    buildDate->setFont(txtFont);
+    site->setFont(txtFont);
+
+    QGridLayout *gridLayout = new QGridLayout();
+    gridLayout->setVerticalSpacing(17);
+    gridLayout->setHorizontalSpacing(40);
+    gridLayout->addWidget(sdkVerTitle, 0, 0, 1, 1);
+    gridLayout->addWidget(sdkVer, 0, 1, 1, 1);
+    gridLayout->addWidget(pkgVerTitle, 1, 0, 1, 1);
+    gridLayout->addWidget(pkgVer, 1, 1, 1, 1);
+    gridLayout->addWidget(buildDateTitle, 2, 0, 1, 1);
+    gridLayout->addWidget(buildDate, 2, 1, 1, 1);
+    gridLayout->addWidget(siteTitle, 3, 0, 1, 1);
+    gridLayout->addWidget(site, 3, 1, 1, 1);
+
+    gridLayout->setColumnMinimumWidth(0, 110);
+    gridLayout->setColumnMinimumWidth(1, 190);
+    gridLayout->setColumnStretch(1, 190);
+
+    QVBoxLayout *layout = new QVBoxLayout();
+    layout->setContentsMargins(28, 22, 0, 22);
+    layout->addLayout(gridLayout);
+    return (QLayout *)layout;
 }
-
 /* override */
 void AboutDialog::showEvent(QShowEvent *event)
 {
index f81c96d..b43c2d2 100644 (file)
@@ -42,6 +42,10 @@ public:
 
 protected:
     void showEvent(QShowEvent *event);
+
+private:
+    QLayout *makeAboutText();
+    void makeTitleText(QWidget *widget);
 };
 
 #endif // ABOUTDIALOG_H
diff --git a/tizen/src/ui/resource/images/about_bg.png b/tizen/src/ui/resource/images/about_bg.png
new file mode 100644 (file)
index 0000000..1333194
Binary files /dev/null and b/tizen/src/ui/resource/images/about_bg.png differ
diff --git a/tizen/src/ui/resource/images/tizen_sdk.png b/tizen/src/ui/resource/images/tizen_sdk.png
deleted file mode 100644 (file)
index b276703..0000000
Binary files a/tizen/src/ui/resource/images/tizen_sdk.png and /dev/null differ
index 637465b..a846245 100644 (file)
@@ -1,6 +1,6 @@
 <RCC>
     <qresource prefix="/">
-        <file>images/tizen_sdk.png</file>
+        <file>images/about_bg.png</file>
         <file>images/display_off_guide.png</file>
 
         <file>images/main-skin/arrow_normal.png</file>
index 3a5c3af..81c7dce 100644 (file)
@@ -34,7 +34,7 @@
 
 #define EMULATOR_TITLE "Tizen Emulator"
 
-#define SDK_OFFICIAL_NAME "Tizen SDK"
+#define SDK_OFFICIAL_NAME "TIZEN STUDIO"
 #define SDK_OFFICIAL_URL "https://developer.tizen.org"
 
 /* SDK path */
@@ -48,7 +48,7 @@
 #define SDK_ECP_FILE_JAR "emulator-control-panel.jar"
 
 /* resource file name */
-#define SDK_ABOUT_IMAGE_FILE "tizen_sdk.png"
+#define SDK_ABOUT_IMAGE_FILE "about_bg.png"
 #define SDK_VERSION_FILE "sdk.version"
 #define SDK_VERSION_FILE_KEY "TIZEN_SDK_VERSION"
 #define EMULATOR_ICON_FILE "emulator_icon.ico"
 #define ABOUT_SDK_VERSION_TEXT "SDK Version"
 #define ABOUT_PKG_VERSION_TEXT "Package Version"
 #define ABOUT_BUILD_DATE_TEXT "Build Date"
-#define ABOUT_VISIT_TEXT "Visit"
+#define ABOUT_VISIT_TEXT "Tizen site"
 
 /* SDB related */
 #define FILE_EXTENSION_WGT "wgt"