From 6693f8137593ff9832f2a60340b7d499ce8af061 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Feb 2018 10:24:33 +0100 Subject: [PATCH] [plasmalnf] Document configuration - Improve documentation, explain necessity of theme: and image: keys - Scale screenshot up with font size (numbers picked arbitrarily) --- src/modules/plasmalnf/ThemeWidget.cpp | 9 ++++++--- src/modules/plasmalnf/plasmalnf.conf | 14 +++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/modules/plasmalnf/ThemeWidget.cpp b/src/modules/plasmalnf/ThemeWidget.cpp index c618a4947..b3f6d161e 100644 --- a/src/modules/plasmalnf/ThemeWidget.cpp +++ b/src/modules/plasmalnf/ThemeWidget.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * Copyright 2017, Adriaan de Groot + * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #include "ThemeInfo.h" +#include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" #include @@ -28,16 +29,18 @@ ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent) : QWidget( parent ) + , m_id( info.id ) , m_check( new QRadioButton( info.name.isEmpty() ? info.id : info.name, parent ) ) , m_description( new QLabel( info.description, parent ) ) - , m_id( info.id ) { QHBoxLayout* layout = new QHBoxLayout( this ); this->setLayout( layout ); 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 ); if ( info.imagePath.isEmpty() ) diff --git a/src/modules/plasmalnf/plasmalnf.conf b/src/modules/plasmalnf/plasmalnf.conf index 8f395338c..e1021015b 100644 --- a/src/modules/plasmalnf/plasmalnf.conf +++ b/src/modules/plasmalnf/plasmalnf.conf @@ -28,8 +28,20 @@ lnftool: "/usr/bin/lookandfeeltool" # # 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. -# 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. +# +# 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: - org.kde.fuzzy-pig.desktop - theme: org.kde.breeze.desktop