mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Workspace: added a new slider to control icon size.
This commit is contained in:
@@ -129,7 +129,7 @@
|
||||
"showPinnedApps": true,
|
||||
"smartWidth": true,
|
||||
"maxTaskbarWidth": 40,
|
||||
"iconScale": 1
|
||||
"iconScale": 0.8
|
||||
},
|
||||
"Tray": {
|
||||
"blacklist": [],
|
||||
@@ -154,7 +154,8 @@
|
||||
"colorizeIcons": false,
|
||||
"unfocusedIconsOpacity": 1,
|
||||
"groupedBorderOpacity": 1,
|
||||
"enableScrollWheel": true
|
||||
"enableScrollWheel": true,
|
||||
"iconScale": 0.8
|
||||
},
|
||||
"Volume": {
|
||||
"displayMode": "onhover"
|
||||
|
||||
@@ -51,9 +51,11 @@ Item {
|
||||
readonly property real unfocusedIconsOpacity: (widgetSettings.unfocusedIconsOpacity !== undefined) ? widgetSettings.unfocusedIconsOpacity : widgetMetadata.unfocusedIconsOpacity
|
||||
readonly property real groupedBorderOpacity: (widgetSettings.groupedBorderOpacity !== undefined) ? widgetSettings.groupedBorderOpacity : widgetMetadata.groupedBorderOpacity
|
||||
readonly property bool enableScrollWheel: (widgetSettings.enableScrollWheel !== undefined) ? widgetSettings.enableScrollWheel : widgetMetadata.enableScrollWheel
|
||||
readonly property real iconScale: (widgetSettings.iconScale !== undefined) ? widgetSettings.iconScale : widgetMetadata.iconScale
|
||||
|
||||
// Only for grouped mode / show apps
|
||||
readonly property int itemSize: Style.toOdd(Style.capsuleHeight * 0.8)
|
||||
readonly property int baseItemSize: Style.toOdd(Style.capsuleHeight * 0.8)
|
||||
readonly property int iconSize: Style.toOdd(baseItemSize * iconScale)
|
||||
|
||||
// Context menu state for grouped mode - store IDs instead of object references to avoid stale references
|
||||
property string selectedWindowId: ""
|
||||
@@ -775,8 +777,8 @@ Item {
|
||||
property var workspaceModel: model
|
||||
property bool hasWindows: (workspaceModel?.windows?.count ?? 0) > 0
|
||||
|
||||
width: Style.toOdd((hasWindows ? groupedIconsFlow.implicitWidth : root.itemSize) + (root.isVertical ? Style.marginXS : Style.marginXL))
|
||||
height: Style.toOdd((hasWindows ? groupedIconsFlow.implicitHeight : root.itemSize) + (root.isVertical ? Style.marginL : Style.marginXS))
|
||||
width: Style.toOdd((hasWindows ? groupedIconsFlow.implicitWidth : root.iconSize) + (root.isVertical ? (root.baseItemSize - root.iconSize + Style.marginXS) : Style.marginXL))
|
||||
height: Style.toOdd((hasWindows ? groupedIconsFlow.implicitHeight : root.iconSize) + (root.isVertical ? Style.marginL : (root.baseItemSize - root.iconSize + Style.marginXS)))
|
||||
color: Style.capsuleColor
|
||||
radius: Style.radiusS
|
||||
border.color: Settings.data.bar.showOutline ? Style.capsuleBorderColor : Qt.alpha((workspaceModel.isFocused ? Color.mPrimary : Color.mOutline), root.groupedBorderOpacity)
|
||||
@@ -810,7 +812,7 @@ Item {
|
||||
|
||||
x: Style.pixelAlignCenter(parent.width, width)
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
spacing: 4
|
||||
spacing: 2
|
||||
flow: root.isVertical ? Flow.TopToBottom : Flow.LeftToRight
|
||||
|
||||
Repeater {
|
||||
@@ -821,8 +823,8 @@ Item {
|
||||
|
||||
property bool itemHovered: false
|
||||
|
||||
width: root.itemSize
|
||||
height: root.itemSize
|
||||
width: root.iconSize
|
||||
height: root.iconSize
|
||||
|
||||
IconImage {
|
||||
id: groupedAppIcon
|
||||
@@ -837,12 +839,13 @@ Item {
|
||||
|
||||
Rectangle {
|
||||
id: groupedFocusIndicator
|
||||
anchors.bottomMargin: 0
|
||||
visible: model.isFocused
|
||||
anchors.bottomMargin: -2
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: model.isFocused ? 4 : 0
|
||||
height: model.isFocused ? 4 : 0
|
||||
color: model.isFocused ? Color.mPrimary : Color.transparent
|
||||
width: Style.toOdd(root.iconSize * 0.25)
|
||||
height: 4
|
||||
color: Color.mPrimary
|
||||
radius: Math.min(Style.radiusXXS, width / 2)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ ColumnLayout {
|
||||
property real valueUnfocusedIconsOpacity: widgetData.unfocusedIconsOpacity !== undefined ? widgetData.unfocusedIconsOpacity : widgetMetadata.unfocusedIconsOpacity
|
||||
property real valueGroupedBorderOpacity: widgetData.groupedBorderOpacity !== undefined ? widgetData.groupedBorderOpacity : widgetMetadata.groupedBorderOpacity
|
||||
property bool valueEnableScrollWheel: widgetData.enableScrollWheel !== undefined ? widgetData.enableScrollWheel : widgetMetadata.enableScrollWheel
|
||||
property real valueIconScale: widgetData.iconScale !== undefined ? widgetData.iconScale : widgetMetadata.iconScale
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
@@ -37,6 +38,7 @@ ColumnLayout {
|
||||
settings.unfocusedIconsOpacity = valueUnfocusedIconsOpacity;
|
||||
settings.groupedBorderOpacity = valueGroupedBorderOpacity;
|
||||
settings.enableScrollWheel = valueEnableScrollWheel;
|
||||
settings.iconScale = valueIconScale;
|
||||
return settings;
|
||||
}
|
||||
|
||||
@@ -147,4 +149,16 @@ ColumnLayout {
|
||||
text: Math.floor(valueGroupedBorderOpacity * 100) + "%"
|
||||
visible: valueShowApplications
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
label: I18n.tr("bar.widget-settings.taskbar.icon-scale.label")
|
||||
description: I18n.tr("bar.widget-settings.taskbar.icon-scale.description")
|
||||
from: 0.5
|
||||
to: 1
|
||||
stepSize: 0.01
|
||||
value: valueIconScale
|
||||
onMoved: value => valueIconScale = value
|
||||
text: Math.round(valueIconScale * 100) + "%"
|
||||
visible: valueShowApplications
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ Singleton {
|
||||
"showPinnedApps": true,
|
||||
"smartWidth": true,
|
||||
"maxTaskbarWidth": 40,
|
||||
"iconScale": 1.0
|
||||
"iconScale": 0.8
|
||||
},
|
||||
"Tray": {
|
||||
"blacklist": [],
|
||||
@@ -224,7 +224,8 @@ Singleton {
|
||||
"colorizeIcons": false,
|
||||
"unfocusedIconsOpacity": 1.0,
|
||||
"groupedBorderOpacity": 1.0,
|
||||
"enableScrollWheel": true
|
||||
"enableScrollWheel": true,
|
||||
"iconScale": 0.8
|
||||
},
|
||||
"Volume": {
|
||||
"displayMode": "onhover"
|
||||
|
||||
Reference in New Issue
Block a user