This commit is contained in:
Ly-sec
2025-12-19 16:24:55 +01:00
5 changed files with 53 additions and 5 deletions
+4
View File
@@ -2740,6 +2740,10 @@
"sfw": "SFW",
"sketchy": "Sketchy"
},
"ratios": {
"any": "Any",
"label": "Aspect Ratio"
},
"resolution": {
"atleast": "At least",
"exact": "Exact",
+1
View File
@@ -163,6 +163,7 @@
"wallhavenOrder": "desc",
"wallhavenCategories": "111",
"wallhavenPurity": "100",
"wallhavenRatios": "",
"wallhavenResolutionMode": "atleast",
"wallhavenResolutionWidth": "",
"wallhavenResolutionHeight": ""
+1
View File
@@ -342,6 +342,7 @@ Singleton {
property string wallhavenOrder: "desc"
property string wallhavenCategories: "111" // general,anime,people
property string wallhavenPurity: "100" // sfw only
property string wallhavenRatios: ""
property string wallhavenResolutionMode: "atleast" // "atleast" or "exact"
property string wallhavenResolutionWidth: ""
property string wallhavenResolutionHeight: ""
+4 -5
View File
@@ -23,7 +23,7 @@ Rectangle {
readonly property string barPosition: Settings.data.bar.position
readonly property bool isVerticalBar: barPosition === "left" || barPosition === "right"
readonly property string density: Settings.data.bar.density
readonly property real itemSize: (density === "compact") ? Style.capsuleHeight * 0.9 : Style.capsuleHeight * 0.8
readonly property real itemSize: (density === "compact") ? Style.capsuleHeight * 1.0 : Style.capsuleHeight * 0.9
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
property var widgetSettings: {
@@ -420,14 +420,14 @@ Rectangle {
if (isVerticalBar)
return Style.capsuleHeight;
var calculatedWidth = showTitle ? Math.round(taskbarLayout.implicitWidth) : Math.round(taskbarLayout.implicitWidth + Style.marginM * 2);
var calculatedWidth = showTitle ? taskbarLayout.implicitWidth : taskbarLayout.implicitWidth + Style.marginM * 2;
// Apply maximum width constraint when smartWidth is enabled
if (smartWidth && maxTaskbarWidth > 0) {
return Math.min(calculatedWidth, maxTaskbarWidth);
}
return calculatedWidth;
return Math.round(calculatedWidth);
}
implicitHeight: visible ? (isVerticalBar ? Math.round(taskbarLayout.implicitHeight + Style.marginM * 2) : Style.capsuleHeight) : 0
radius: Style.radiusM
@@ -473,7 +473,7 @@ Rectangle {
readonly property color titleBgColor: (isHovered || isFocused) ? Color.mHover : Style.capsuleColor
readonly property color titleFgColor: (isHovered || isFocused) ? Color.mOnHover : Color.mOnSurface
Layout.preferredWidth: root.showTitle ? contentWidth + Style.marginM * 2 : contentWidth // Add margins for both pinned and running apps
Layout.preferredWidth: root.showTitle ? Math.round(contentWidth + Style.marginM * 2) : Math.round(contentWidth) // Add margins for both pinned and running apps
Layout.preferredHeight: root.itemSize
Layout.alignment: Qt.AlignCenter
@@ -517,7 +517,6 @@ Rectangle {
source: ThemeIcons.iconForAppId(taskbarItem.modelData.appId)
smooth: true
asynchronous: true
scale: taskbarItem.isFocused ? 1.0 : 0.8
// Apply dock shader to all taskbar icons
layer.enabled: widgetSettings.colorizeIcons !== false
@@ -270,6 +270,48 @@ Popup {
}
}
// Aspect Ratio
RowLayout {
Layout.fillWidth: true
spacing: Style.marginM
NText {
text: I18n.tr("wallpaper.panel.ratios.label")
color: Color.mOnSurface
pointSize: Style.fontSizeM
Layout.preferredWidth: implicitWidth
}
NComboBox {
id: ratioComboBox
Layout.fillWidth: true
Layout.minimumWidth: 200
model: [
{ "key": "", "name": I18n.tr("wallpaper.panel.ratios.any") },
{ "key": "16x9", "name": "16x9" },
{ "key": "16x10", "name": "16x10" },
{ "key": "21x9", "name": "21x9" },
{ "key": "32x9", "name": "32x9" },
{ "key": "48x9", "name": "48x9" },
{ "key": "9x16", "name": "9x16" },
{ "key": "10x16", "name": "10x16" },
{ "key": "9x18", "name": "9x18" },
{ "key": "1x1", "name": "1x1" },
{ "key": "3x2", "name": "3x2" },
{ "key": "4x3", "name": "4x3" },
{ "key": "5x4", "name": "5x4" }
]
currentKey: Settings.data.wallpaper.wallhavenRatios || ""
onSelected: key => {
Settings.data.wallpaper.wallhavenRatios = key;
if (typeof WallhavenService !== "undefined") {
WallhavenService.ratios = key;
WallhavenService.search(Settings.data.wallpaper.wallhavenQuery || "", 1);
}
}
}
}
// Categories
RowLayout {
Layout.fillWidth: true
@@ -657,6 +699,7 @@ Popup {
WallhavenService.purity = Settings.data.wallpaper.wallhavenPurity;
WallhavenService.sorting = Settings.data.wallpaper.wallhavenSorting;
WallhavenService.order = Settings.data.wallpaper.wallhavenOrder;
WallhavenService.ratios = Settings.data.wallpaper.wallhavenRatios;
// Update resolution settings (without triggering search)
updateResolution(false);