Merge pull request #1381 from bill-auger/patch-welcome-banner
[welcome] add optional branding banner to welcome page
This commit is contained in:
commit
a0b4b2bf5e
@ -106,6 +106,11 @@ strings:
|
|||||||
|
|
||||||
# These images are loaded from the branding module directory.
|
# These images are loaded from the branding module directory.
|
||||||
#
|
#
|
||||||
|
# productBanner is an optional image, which if present, will be shown
|
||||||
|
# on the welcome page of the application, above the welcome text.
|
||||||
|
# It is intended to have a width much greater than height.
|
||||||
|
# It is displayed at 64px height (also on HiDPI).
|
||||||
|
# Recommended size is 64px tall, and up to 460px wide.
|
||||||
# productIcon is used as the window icon, and will (usually) be used
|
# productIcon is used as the window icon, and will (usually) be used
|
||||||
# by the window manager to represent the application. This image
|
# by the window manager to represent the application. This image
|
||||||
# should be square, and may be displayed by the window manager
|
# should be square, and may be displayed by the window manager
|
||||||
@ -121,8 +126,9 @@ strings:
|
|||||||
#
|
#
|
||||||
# These filenames can also use substitutions from os-release (see above).
|
# These filenames can also use substitutions from os-release (see above).
|
||||||
images:
|
images:
|
||||||
productLogo: "squid.png"
|
productBanner: "banner.png"
|
||||||
productIcon: "squid.png"
|
productIcon: "squid.png"
|
||||||
|
productLogo: "squid.png"
|
||||||
productWelcome: "languages.png"
|
productWelcome: "languages.png"
|
||||||
|
|
||||||
# The slideshow is displayed during execution steps (e.g. when the
|
# The slideshow is displayed during execution steps (e.g. when the
|
||||||
|
@ -73,10 +73,11 @@ const QStringList Branding::s_stringEntryStrings =
|
|||||||
|
|
||||||
const QStringList Branding::s_imageEntryStrings =
|
const QStringList Branding::s_imageEntryStrings =
|
||||||
{
|
{
|
||||||
"productLogo",
|
"productBanner",
|
||||||
"productIcon",
|
"productIcon",
|
||||||
"productWelcome",
|
"productLogo",
|
||||||
"productWallpaper"
|
"productWallpaper",
|
||||||
|
"productWelcome"
|
||||||
};
|
};
|
||||||
|
|
||||||
const QStringList Branding::s_styleEntryStrings =
|
const QStringList Branding::s_styleEntryStrings =
|
||||||
|
@ -67,10 +67,11 @@ public:
|
|||||||
|
|
||||||
enum ImageEntry : short
|
enum ImageEntry : short
|
||||||
{
|
{
|
||||||
ProductLogo,
|
ProductBanner,
|
||||||
ProductIcon,
|
ProductIcon,
|
||||||
ProductWelcome,
|
ProductLogo,
|
||||||
ProductWallpaper
|
ProductWallpaper,
|
||||||
|
ProductWelcome
|
||||||
};
|
};
|
||||||
Q_ENUM( ImageEntry )
|
Q_ENUM( ImageEntry )
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent )
|
|||||||
, m_languages( nullptr )
|
, m_languages( nullptr )
|
||||||
, m_conf( conf )
|
, m_conf( conf )
|
||||||
{
|
{
|
||||||
|
|
||||||
connect( Calamares::ModuleManager::instance(),
|
connect( Calamares::ModuleManager::instance(),
|
||||||
&Calamares::ModuleManager::requirementsComplete,
|
&Calamares::ModuleManager::requirementsComplete,
|
||||||
m_checkingWidget,
|
m_checkingWidget,
|
||||||
@ -62,7 +61,8 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent )
|
|||||||
&CheckerContainer::requirementsProgress );
|
&CheckerContainer::requirementsProgress );
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
|
|
||||||
ui->verticalLayout->insertSpacing( 1, CalamaresUtils::defaultFontHeight() * 2 );
|
const int defaultFontHeight = CalamaresUtils::defaultFontHeight();
|
||||||
|
ui->verticalLayout->insertSpacing( 1, defaultFontHeight * 2 );
|
||||||
initLanguages();
|
initLanguages();
|
||||||
|
|
||||||
ui->mainText->setAlignment( Qt::AlignCenter );
|
ui->mainText->setAlignment( Qt::AlignCenter );
|
||||||
@ -77,11 +77,29 @@ WelcomePage::WelcomePage( Config* conf, QWidget* parent )
|
|||||||
ui->aboutButton->setIcon( CalamaresUtils::defaultPixmap(
|
ui->aboutButton->setIcon( CalamaresUtils::defaultPixmap(
|
||||||
CalamaresUtils::Information,
|
CalamaresUtils::Information,
|
||||||
CalamaresUtils::Original,
|
CalamaresUtils::Original,
|
||||||
2 * QSize( CalamaresUtils::defaultFontHeight(), CalamaresUtils::defaultFontHeight() ) ) );
|
2 * QSize( defaultFontHeight, defaultFontHeight ) ) );
|
||||||
connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox );
|
connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox );
|
||||||
|
|
||||||
int welcome_text_idx = ui->verticalLayout->indexOf( ui->mainText );
|
// insert system-check widget below welcome text
|
||||||
|
const int welcome_text_idx = ui->verticalLayout->indexOf( ui->mainText );
|
||||||
ui->verticalLayout->insertWidget( welcome_text_idx + 1, m_checkingWidget );
|
ui->verticalLayout->insertWidget( welcome_text_idx + 1, m_checkingWidget );
|
||||||
|
|
||||||
|
// insert optional logo banner image above welcome text
|
||||||
|
Calamares::Branding::ImageEntry bannerImage = Calamares::Branding::ProductBanner;
|
||||||
|
QString bannerPath = Calamares::Branding::instance()->imagePath( bannerImage );
|
||||||
|
if ( QFile::exists( bannerPath ) )
|
||||||
|
{
|
||||||
|
QPixmap bannerPixmap = QPixmap( bannerPath );
|
||||||
|
if ( !bannerPixmap.isNull() )
|
||||||
|
{
|
||||||
|
QLabel* bannerLabel = new QLabel;
|
||||||
|
bannerLabel->setPixmap( bannerPixmap );
|
||||||
|
bannerLabel->setMinimumHeight( 64 );
|
||||||
|
bannerLabel->setAlignment( Qt::AlignCenter );
|
||||||
|
ui->verticalLayout->insertSpacing( welcome_text_idx, defaultFontHeight );
|
||||||
|
ui->verticalLayout->insertWidget( welcome_text_idx, bannerLabel );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user