Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/private/dquickcontrolpalette.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

Expand Down Expand Up @@ -844,7 +844,17 @@ QColor DQuickControlColorSelector::getColorOf(const DQuickControlPalette *palett

// items with inactive state should use inactive color, it likes dtkgui's generatePaletteColor_helper.
static const auto useInactiveColor = DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::UseInactiveColorGroup);
if (useInactiveColor && state->controlState == DQMLGlobalObject::InactiveState) {
bool shouldBlendInactive = useInactiveColor && state->controlState == DQMLGlobalObject::InactiveState;
if (shouldBlendInactive) {
if (m_control) {
// If the control's inactive palette is same as active palette, it means the control does not have a real
// inactive state, we should not blend the color with inactive mask color, otherwise it will cause the
// color looks like disabled and hard to recognize.
const auto qpalette = _d_getControlPalette(m_control);
shouldBlendInactive = !qpalette.isEqual(QPalette::Inactive, QPalette::Active);
}
}
if (shouldBlendInactive) {
const auto &palette = DGuiApplicationHelper::standardPalette(state->controlTheme);
const auto &windowColor = palette.color(QPalette::Window);

Expand Down