Commit 161309cd authored by Konrad Materka's avatar Konrad Materka
Browse files

[applets/systemtray] Configurable maximum icon size

Add configuration UI for setting maximum icon size. This utilizes existing configuration parameter. It is a maximum allowed icon size, if panel is smaller, icon will fit to closest smaller size.

BUG: 360333

BUG: 355587

FIXED-IN: 5.20.0
parent 3a39bd94
......@@ -22,6 +22,11 @@ import QtQuick 2.0
import org.kde.plasma.configuration 2.0
ConfigModel {
ConfigCategory {
name: i18n("General")
icon: "plasma"
source: "ConfigGeneral.qml"
}
ConfigCategory {
name: i18n("Entries")
icon: "preferences-desktop-notification"
......
/***************************************************************************
* Copyright (C) 2020 Konrad Materka <materka@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.14
import QtQuick.Controls 2.14 as QtControls
import QtQuick.Layouts 1.14 as QtLayouts
import org.kde.kirigami 2.13 as Kirigami
Kirigami.FormLayout {
property alias cfg_iconSize: iconSizeComboBox.currentIndex
QtControls.ComboBox {
id: iconSizeComboBox
Kirigami.FormData.label: i18n("Maximum icon size:")
model: [i18n("Very Small"), i18n("Small"), i18n("Medium"), i18n("Large"), i18n("Huge"), i18n("Enormous")]
}
}
......@@ -129,7 +129,7 @@ PlasmaCore.ToolTipArea {
Item {
id: iconContainer
anchors.verticalCenter: parent.verticalCenter
width: Math.min(abstractItem.width, abstractItem.height)
width: inVisibleLayout ? root.itemSize : hiddenLayout.iconItemHeight
height: width
property alias inHiddenLayout: abstractItem.inHiddenLayout
property alias inVisibleLayout: abstractItem.inVisibleLayout
......
......@@ -157,8 +157,8 @@ MouseArea {
interactive: false //disable features we don't need
flow: vertical ? GridView.LeftToRight : GridView.TopToBottom
cellHeight: Math.min(root.itemSize + units.smallSpacing, root.height)
cellWidth: Math.min(root.itemSize + units.smallSpacing, root.width)
cellHeight: root.itemSize + units.smallSpacing
cellWidth: root.itemSize + units.smallSpacing
readonly property int columns: !vertical ? Math.ceil(count / rows)
: Math.max(1, Math.floor(root.width / cellWidth))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment