Skip to content

Commit

Permalink
fixes for config page and spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
psifidotos committed Oct 24, 2020
1 parent f50dce3 commit cf7719c
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 95 deletions.
7 changes: 1 addition & 6 deletions org.kde.plasma.private.systemtray/contents/config/config.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,5 @@ ConfigModel {
name: i18n("Entries")
icon: "preferences-desktop-notification"
source: "ConfigEntries.qml"
}
ConfigCategory {
name: i18n("Appearance")
icon: "preferences-desktop-wallpaper"
source: "ConfigAppearance.qml"
}
}
}
83 changes: 0 additions & 83 deletions org.kde.plasma.private.systemtray/contents/ui/ConfigAppearance.qml

This file was deleted.

30 changes: 30 additions & 0 deletions org.kde.plasma.private.systemtray/contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.14
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Controls 2.14 as QQC2
import QtQuick.Layouts 1.13

Expand All @@ -27,8 +28,13 @@ import org.kde.plasma.core 2.1 as PlasmaCore
import org.kde.kirigami 2.13 as Kirigami

ColumnLayout {
id: generalPage
property bool cfg_scaleIconsToFit

property alias cfg_iconsSpacing: iconsSpacing.value
property alias cfg_internalMainHighlightEnabled: internalHighlightChk.checked


Kirigami.FormLayout {
Layout.fillHeight: true

Expand All @@ -45,5 +51,29 @@ ColumnLayout {
checked: cfg_scaleIconsToFit == true
onToggled: cfg_scaleIconsToFit = checked
}

QQC2.Label {
text: " "
}

QtControls.SpinBox{
id: iconsSpacing
minimumValue: 0
maximumValue: 36 //in pixels

suffix: i18nc("pixels","px.")

Kirigami.FormData.label: i18n("Spacing:")
}

QQC2.Label {
text: " "
}

QtControls.CheckBox {
id: internalHighlightChk
text: i18n("Internal highlight for main popup window is enabled")
Kirigami.FormData.label: i18n("Highlight:")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ PlasmaCore.FrameSvgItem {
}
return prefix;
}
opacity: parent && dialog.visible ? plasmoid.configuration.internalMainHighlightEnabled : 0
opacity: parent && dialog.visible && (plasmoid.configuration.internalMainHighlightEnabled || visibleAppletActivated)? 1 : 0

Behavior on opacity {
NumberAnimation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ PlasmaCore.ToolTipArea {
implicitHeight: !root.vertical && abstractItem.inVisibleLayout ? abstractItem.height : size
Layout.topMargin: abstractItem.inHiddenLayout ? units.smallSpacing : 0

visible: !colorizerLoader.active
opacity: !colorizerLoader.active
}
PlasmaComponents3.Label {
id: label
Expand Down
8 changes: 4 additions & 4 deletions org.kde.plasma.private.systemtray/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ MouseArea {

if (root.internalMainHighlightEnabled || parent !== root) {
latteBridge.actions.setProperty(plasmoid.id, "activeIndicatorEnabled", false);
} else if (target) {
} else if (parent) {
latteBridge.actions.setProperty(plasmoid.id, "activeIndicatorEnabled", true);
}
}
Expand Down Expand Up @@ -183,7 +183,7 @@ MouseArea {
id: tasksGrid
readonly property int smallSizeCellLength: root.cellThickness >= root.smallIconSize ? root.smallIconSize + plasmoid.configuration.iconsSpacing
: root.smallIconSize
readonly property int autoSizeCellLength: root.cellThickness / root.rowsOrColumns
readonly property int autoSizeCellLength: (root.cellThickness / root.rowsOrColumns)
readonly property int totalLength: root.vertical ? cellHeight * Math.round(count / root.rowsOrColumns)
: cellWidth * Math.round(count / root.rowsOrColumns)

Expand All @@ -195,8 +195,8 @@ MouseArea {
implicitHeight: root.vertical ? totalLength : root.height
implicitWidth: !root.vertical ? totalLength : root.width

cellHeight: root.vertical && !root.autoSize ? smallSizeCellLength : autoSizeCellLength
cellWidth: !root.vertical && !root.autoSize ? smallSizeCellLength : autoSizeCellLength
cellHeight: root.vertical && !root.autoSize ? smallSizeCellLength : autoSizeCellLength + (root.vertical ? plasmoid.configuration.iconsSpacing : 0)
cellWidth: !root.vertical && !root.autoSize ? smallSizeCellLength : autoSizeCellLength + (!root.vertical ? plasmoid.configuration.iconsSpacing : 0)

model: PlasmaCore.SortFilterModel {
sourceModel: plasmoid.nativeInterface.systemTrayModel
Expand Down

0 comments on commit cf7719c

Please sign in to comment.