Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@
<default>false</default>
</entry>
<entry name="scaleIconsToFit" type="bool">
<label>Whether to automatically scale System Tray icons to fix the available thickness of the panel. If false, tray icons will be capped at the smallMedium size (22px) and become a two-row/column layout when the panel is thick.</label>
<label>Whether to automatically scale System Tray icons to fix the available thickness of the panel.</label>
<default>false</default>
</entry>

<!-- Yeni eklediğimiz int değişkeni (Uygula butonunu tetikleyecek olan) -->
<entry name="panelIconSize" type="int">
<label>Panel icon size style (0: Small, 1: Medium, 2: Scale with panel size)</label>
<default>0</default>
</entry>
<entry name="iconSpacing" type="int">
<label>spacing between icons, determined by this number multiplied by Kirigami.Units.smallSpacing</label>
<default>2</default>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

SPDX-License-Identifier: GPL-2.0-or-later
*/

pragma ComponentBehavior: Bound

import QtQuick
Expand All @@ -27,6 +26,7 @@ KCMUtils.ScrollViewKCM {
id: iconsPage

signal configurationChanged
property int cfg_panelIconSize
property bool unsavedChanges: !(changedVisibility.size === 0 && changedShortcuts.size === 0)

property bool cfg_scaleIconsToFit
Expand Down Expand Up @@ -207,30 +207,27 @@ KCMUtils.ScrollViewKCM {
id: sizeChooser

readonly property string scaleString: Plasmoid.formFactor === PlasmaCore.Types.Horizontal
? i18nc("@item:inlistbox Icon size", "Scale with Panel height")
: i18nc("@item:inlistbox Icon size", "Scale with Panel width")
? i18nc("@item:inlistbox Icon size", "Scale with Panel height")
: i18nc("@item:inlistbox Icon size", "Scale with Panel width")

Kirigami.FormData.label: i18nc("@label:listbox Whether the system tray icons in the Panel always stay small or scale with the Panel's size", "Panel icon size:")
Layout.preferredWidth: formLayout.maxComboboxWidth

model: [
{
"label": i18nc("@item:inlistbox Icon size", "Small"),
"size": "small"
},
{
"label": scaleString,
"size": "scale"
}
{ "label": i18nc("@item:inlistbox Icon size", "Small"), "value": 0 },
{ "label": i18nc("@item:inlistbox Icon size", "Medium"), "value": 1 },
{ "label": scaleString, "value": 2 }
]
textRole: "label"

currentIndex: iconsPage.cfg_scaleIconsToFit ? 1 : 0
currentIndex: iconsPage.cfg_panelIconSize

onActivated: index => {
iconsPage.cfg_scaleIconsToFit = model[currentIndex]["size"] == "scale";
let selectedValue = model[index]["value"];
iconsPage.cfg_panelIconSize = selectedValue;
iconsPage.cfg_scaleIconsToFit = (selectedValue === 2);
}
}

QQC2.ComboBox {
id: spacingChooser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org>
SPDX-FileCopyrightText: 2020 Konrad Materka <materka@gmail.com>
SPDX-FileCopyrightText: 2026 Nathaniel Krebs <areyoufeelingitnowmrkrebs@gmail.com>

SPDX-License-Identifier: LGPL-2.0-or-later
*/
* SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org>
* SPDX-FileCopyrightText: 2020 Konrad Materka <materka@gmail.com>
* SPDX-FileCopyrightText: 2026 Nathaniel Krebs <areyoufeelingitnowmrkrebs@gmail.com>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
pragma ComponentBehavior: Bound

import QtQuick
Expand Down Expand Up @@ -130,7 +130,7 @@ ContainmentItem {
preventStealing: true

/** Extracts the name of the system tray applet in the drag data if present
* otherwise returns null*/
* otherwise returns null*/
function systemTrayAppletName(event) {
if (event.mimeData.formats.indexOf("text/x-plasmoidservicename") < 0) {
return null;
Expand Down Expand Up @@ -190,16 +190,32 @@ ContainmentItem {
verticalLayoutDirection: (root.vertical && root.reverseLayout) ? GridView.BottomToTop : GridView.TopToBottom

// The icon size to display when not using the auto-scaling setting
readonly property int smallIconSize: Kirigami.Units.iconSizes.smallMedium
// Determines the base size based on the panelIconSize value in memory (Small if 0, Medium if 1).
readonly property int smallIconSize: {
if (Plasmoid.configuration.panelIconSize === 1) {
// Medium option (e.g., we add 6px to the original 22px small Medium value to make it 28px)
return Kirigami.Units.iconSizes.smallMedium + 6;
}
// 0 (Small) or the default original 22px size
return Kirigami.Units.iconSizes.smallMedium;
}

readonly property bool autoSize: Plasmoid.configuration.scaleIconsToFit
// If the panelIconSize value is 2, automatic scaling (Scale with Panel height) will be activated.
readonly property bool autoSize: Plasmoid.configuration.panelIconSize === 2

readonly property int gridThickness: root.vertical ? root.width : root.height
// Should change to 2 rows/columns on a 56px panel (in standard DPI)
readonly property int rowsOrColumns: autoSize ? 1 : Math.max(1, Math.min(count, Math.floor(gridThickness / (smallIconSize + Kirigami.Units.smallSpacing))))

// Add margins only if the panel is larger than a small icon (to avoid large gaps between tiny icons)
readonly property int cellSpacing: Kirigami.Units.smallSpacing * Plasmoid.configuration.iconSpacing
readonly property int cellSpacing: {
// If Medium mode is selected, tighten the spacing (e.g., set it to a fixed 2 pixels)
if (Plasmoid.configuration.panelIconSize === 1) {
return 2;
}
// In other modes (Small), the original spacing value from the settings application will apply.
return Kirigami.Units.smallSpacing * Plasmoid.configuration.iconSpacing;
}
readonly property int smallSizeCellLength: gridThickness < smallIconSize ? smallIconSize : smallIconSize + cellSpacing

cellHeight: {
Expand Down Expand Up @@ -304,8 +320,8 @@ ContainmentItem {
floating: Plasmoid.location == PlasmaCore.Desktop

removeBorderStrategy: Plasmoid.location === PlasmaCore.Types.Floating
? PlasmaCore.AppletPopup.AtScreenEdges
: PlasmaCore.AppletPopup.AtScreenEdges | PlasmaCore.AppletPopup.AtPanelEdges
? PlasmaCore.AppletPopup.AtScreenEdges
: PlasmaCore.AppletPopup.AtScreenEdges | PlasmaCore.AppletPopup.AtPanelEdges


hideOnWindowDeactivate: !Plasmoid.configuration.pin
Expand Down Expand Up @@ -345,7 +361,7 @@ ContainmentItem {
id: separator
// Only draw for popups of panel applets, not desktop applets
visible: [PlasmaCore.Types.TopEdge, PlasmaCore.Types.LeftEdge, PlasmaCore.Types.RightEdge, PlasmaCore.Types.BottomEdge]
.includes(Plasmoid.location) && !dialog.margin
.includes(Plasmoid.location) && !dialog.margin
anchors {
topMargin: -dialog.topPadding
leftMargin: -dialog.leftPadding
Expand Down