From: jihye Date: Thu, 5 Jan 2017 10:58:48 +0000 (+0900) Subject: ui: change about dialog X-Git-Tag: TizenStudio_2.0_p2.3.2~9^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8aebb94da716975f0386aa91e17f8730933c938b;p=sdk%2Femulator%2Fqemu.git ui: change about dialog Change-Id: Ic28c8e109bd6517cf71d7b6fb9caf16161087d2b Signed-off-by: jihye --- diff --git a/tizen/src/Makefile b/tizen/src/Makefile index e5cd5ee..5fa5024 100755 --- a/tizen/src/Makefile +++ b/tizen/src/Makefile @@ -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 diff --git a/tizen/src/ui/menu/aboutdialog.cpp b/tizen/src/ui/menu/aboutdialog.cpp index b956dd8..7667ad0 100644 --- a/tizen/src/ui/menu/aboutdialog.cpp +++ b/tizen/src/ui/menu/aboutdialog.cpp @@ -4,8 +4,9 @@ * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: + * jihye kim * GiWoong Kim - * Sangho Park + * SeokYeon Hwang * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,102 +34,195 @@ #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("" + QString(SDK_OFFICIAL_NAME) + ""); + + title->setText("" + QString("Emulator ") + + ""+ QString("for " + platformVersion) + + "" + ""); + + 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 = - "" + QString(EMULATOR_TITLE) + " for " + platformVersion + "

" + - ABOUT_SDK_VERSION_TEXT + " : " + sdkVer + "
" + - ABOUT_PKG_VERSION_TEXT + " : " + pkgVer + "
" + - /* "Snapshot : " + SnapshotName + "
" + */ - ABOUT_BUILD_DATE_TEXT + " : " + QString(build_date) + "


" + - ABOUT_VISIT_TEXT + " " + - SDK_OFFICIAL_URL + ""; - - 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 = "" + SDK_OFFICIAL_URL + ""; + + 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) { diff --git a/tizen/src/ui/menu/aboutdialog.h b/tizen/src/ui/menu/aboutdialog.h index f81c96d..b43c2d2 100644 --- a/tizen/src/ui/menu/aboutdialog.h +++ b/tizen/src/ui/menu/aboutdialog.h @@ -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 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 index b276703..0000000 Binary files a/tizen/src/ui/resource/images/tizen_sdk.png and /dev/null differ diff --git a/tizen/src/ui/resource/resource.qrc b/tizen/src/ui/resource/resource.qrc index 637465b..a846245 100644 --- a/tizen/src/ui/resource/resource.qrc +++ b/tizen/src/ui/resource/resource.qrc @@ -1,6 +1,6 @@ - images/tizen_sdk.png + images/about_bg.png images/display_off_guide.png images/main-skin/arrow_normal.png diff --git a/tizen/src/ui/resource/ui_strings.h b/tizen/src/ui/resource/ui_strings.h index 3a5c3af..81c7dce 100644 --- a/tizen/src/ui/resource/ui_strings.h +++ b/tizen/src/ui/resource/ui_strings.h @@ -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" @@ -127,7 +127,7 @@ #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"