mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 16:58:24 +02:00
[qml] Qt5.15: Disable the alternative palette to support disabled elements
Supporting the alternative palette (triggered with Ctrl+Shift+P) requires a manual conversion from the QPalette to the QML palette, which does not directly support disabled elements. Keeping the previous palette management will support disabled elements, but cause issues when switching to the alternative palette. Until both can be fully supported, the alternative palette is disabled.
This commit is contained in:
parent
8db25a6f89
commit
30cd13c7b3
1 changed files with 12 additions and 6 deletions
|
@ -39,6 +39,10 @@ ApplicationWindow {
|
|||
ensureSaved(function(){ Qt.quit() })
|
||||
}
|
||||
|
||||
palette: _PaletteManager.palette
|
||||
|
||||
// TODO: uncomment for Qt6, which correctly supports palette for disabled elements AND an alternate base
|
||||
/*
|
||||
// QPalette is not convertible to QML palette (anymore)
|
||||
Component.onCompleted: {
|
||||
palette.alternateBase = _PaletteManager.alternateBase
|
||||
|
@ -56,13 +60,13 @@ ApplicationWindow {
|
|||
palette.window = _PaletteManager.window
|
||||
palette.windowText = _PaletteManager.windowText
|
||||
|
||||
// TODO: uncomment for Qt6, which supports palette for disabled elements
|
||||
/* palette.disabled.buttonText = _PaletteManager.disabledButtonText
|
||||
palette.disabled.buttonText = _PaletteManager.disabledButtonText
|
||||
palette.disabled.highlight = _PaletteManager.disabledHighlight
|
||||
palette.disabled.highlightedText = _PaletteManager.disabledHighlightedText
|
||||
palette.disabled.text = _PaletteManager.disabledText
|
||||
palette.disabled.windowText = _PaletteManager.disabledWindowText */
|
||||
}
|
||||
palette.disabled.windowText = _PaletteManager.disabledWindowText
|
||||
} */
|
||||
|
||||
SystemPalette { id: activePalette }
|
||||
SystemPalette { id: disabledPalette; colorGroup: SystemPalette.Disabled }
|
||||
|
||||
|
@ -560,10 +564,12 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Action {
|
||||
// TODO: uncomment for Qt6 to re-enable the alternative palette (the alternative palette and the disabled items currently cannot both be supported)
|
||||
/* Action {
|
||||
|
||||
shortcut: "Ctrl+Shift+P"
|
||||
onTriggered: _PaletteManager.togglePalette()
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
// Utility functions for elements in the menubar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue