mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
wallpaper-panel: prevent combobox from covering the path
This commit is contained in:
@@ -776,10 +776,10 @@ SmartPanel {
|
||||
|
||||
// Right side: actions (view mode, hide filenames, refresh)
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
enabled: Settings.data.colorSchemes.useWallpaperColors
|
||||
baseSize: 0.8
|
||||
minimumWidth: 180
|
||||
maximumWidth: 180
|
||||
model: TemplateProcessor.schemeTypes
|
||||
currentKey: Settings.data.colorSchemes.generationMethod
|
||||
onSelected: key => {
|
||||
|
||||
@@ -491,7 +491,13 @@ Singleton {
|
||||
// -------------------------------------------------------------------
|
||||
function getCurrentBrowsePath(screenName) {
|
||||
if (currentBrowsePaths[screenName] !== undefined) {
|
||||
return currentBrowsePaths[screenName];
|
||||
var stored = currentBrowsePaths[screenName];
|
||||
var root = getMonitorDirectory(screenName);
|
||||
if (root && stored.startsWith(root)) {
|
||||
return stored;
|
||||
}
|
||||
// Stored path is outside the root directory, reset it
|
||||
delete currentBrowsePaths[screenName];
|
||||
}
|
||||
return getMonitorDirectory(screenName);
|
||||
}
|
||||
@@ -509,14 +515,14 @@ Singleton {
|
||||
var currentPath = getCurrentBrowsePath(screenName);
|
||||
var rootPath = getMonitorDirectory(screenName);
|
||||
|
||||
// Don't go above the root directory
|
||||
if (currentPath === rootPath)
|
||||
// Don't navigate if root is invalid or we're already at root
|
||||
if (!rootPath || currentPath === rootPath)
|
||||
return;
|
||||
|
||||
// Get parent directory
|
||||
var parentPath = currentPath.replace(/\/[^\/]+\/?$/, "");
|
||||
if (parentPath === "")
|
||||
parentPath = "/";
|
||||
parentPath = rootPath;
|
||||
|
||||
// Don't go above root
|
||||
if (!parentPath.startsWith(rootPath)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import qs.Widgets
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
property real maximumWidth: 200
|
||||
property real minimumWidth: 200
|
||||
property real popupHeight: 180
|
||||
|
||||
@@ -25,7 +26,6 @@ RowLayout {
|
||||
signal selected(string key)
|
||||
|
||||
spacing: Style.marginL
|
||||
Layout.fillWidth: true
|
||||
opacity: enabled ? 1.0 : 0.6
|
||||
|
||||
// Less strict comparison with != (instead of !==) so it can properly compare int vs string (ex for FPS: 30 and "30")
|
||||
@@ -135,6 +135,7 @@ RowLayout {
|
||||
ComboBox {
|
||||
id: combo
|
||||
|
||||
Layout.maximumWidth: Math.round(root.maximumWidth * Style.uiScaleRatio)
|
||||
Layout.minimumWidth: Math.round(root.minimumWidth * Style.uiScaleRatio)
|
||||
Layout.preferredHeight: Math.round(root.preferredHeight * Style.uiScaleRatio)
|
||||
implicitWidth: Layout.minimumWidth
|
||||
|
||||
Reference in New Issue
Block a user