[plasmalnf] Document configuration
- Improve documentation, explain necessity of theme: and image: keys - Scale screenshot up with font size (numbers picked arbitrarily)
This commit is contained in:
parent
874514a4e4
commit
6693f81375
@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
*
|
*
|
||||||
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "ThemeInfo.h"
|
#include "ThemeInfo.h"
|
||||||
|
|
||||||
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@ -28,16 +29,18 @@
|
|||||||
|
|
||||||
ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent)
|
ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent)
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
|
, m_id( info.id )
|
||||||
, m_check( new QRadioButton( info.name.isEmpty() ? info.id : info.name, parent ) )
|
, m_check( new QRadioButton( info.name.isEmpty() ? info.id : info.name, parent ) )
|
||||||
, m_description( new QLabel( info.description, parent ) )
|
, m_description( new QLabel( info.description, parent ) )
|
||||||
, m_id( info.id )
|
|
||||||
{
|
{
|
||||||
QHBoxLayout* layout = new QHBoxLayout( this );
|
QHBoxLayout* layout = new QHBoxLayout( this );
|
||||||
this->setLayout( layout );
|
this->setLayout( layout );
|
||||||
|
|
||||||
layout->addWidget( m_check, 1 );
|
layout->addWidget( m_check, 1 );
|
||||||
|
|
||||||
constexpr QSize image_size{120, 80};
|
const QSize image_size{
|
||||||
|
qMax(12 * CalamaresUtils::defaultFontHeight(), 120),
|
||||||
|
qMax(8 * CalamaresUtils::defaultFontHeight(), 80) };
|
||||||
|
|
||||||
QPixmap image( info.imagePath );
|
QPixmap image( info.imagePath );
|
||||||
if ( info.imagePath.isEmpty() )
|
if ( info.imagePath.isEmpty() )
|
||||||
|
@ -28,8 +28,20 @@ lnftool: "/usr/bin/lookandfeeltool"
|
|||||||
#
|
#
|
||||||
# Themes may be listed by id, (e.g. fluffy-bunny, below) or as a theme
|
# Themes may be listed by id, (e.g. fluffy-bunny, below) or as a theme
|
||||||
# and an image (e.g. breeze) which will be used to show a screenshot.
|
# and an image (e.g. breeze) which will be used to show a screenshot.
|
||||||
# Themes with no image get a "missing screenshot" image; if the
|
# Themes with no image set at all get a "missing screenshot" image; if the
|
||||||
# image file is not found, they get a color swatch based on the image name.
|
# image file is not found, they get a color swatch based on the image name.
|
||||||
|
#
|
||||||
|
# Valid forms of entries in the *themes* key:
|
||||||
|
# - A single string (unquoted), which is the theme id
|
||||||
|
# - A pair of *theme* and *image* keys, e.g.
|
||||||
|
# ```
|
||||||
|
# - theme: fluffy-bunny.desktop
|
||||||
|
# image: "fluffy-screenshot.png"
|
||||||
|
# ```
|
||||||
|
#
|
||||||
|
# The image screenshot is resized to 12x8 the current font size, with
|
||||||
|
# a minimum of 120x80 pixels. This allows the screenshot to scale up
|
||||||
|
# on HiDPI displays where the fonts are larger (in pixels).
|
||||||
themes:
|
themes:
|
||||||
- org.kde.fuzzy-pig.desktop
|
- org.kde.fuzzy-pig.desktop
|
||||||
- theme: org.kde.breeze.desktop
|
- theme: org.kde.breeze.desktop
|
||||||
|
Loading…
Reference in New Issue
Block a user