diff --git a/CMakeLists.txt b/CMakeLists.txt index 44b70ec0..f90ae066 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,13 @@ include(ECMSetupVersion) include(GenerateExportHeader) option(ENABLE_CONFIG_QT "Enable fcitx5-config-qt" On) option(ENABLE_TEST "Enable test" Off) +option(BUILD_UOS "Build for UOS (use UOS Sogou IM)" Off) +if (BUILD_UOS) + add_definitions(-DBUILD_UOS) + message(" >>> Build for UOS: Sogou IM = com.sogou.ime.ng.fcitx5.uos") +else() + message(" >>> Build for Deepin: Sogou IM = com.sogou.ime.ng.fcitx5.deepin") +endif() add_definitions(-DTRANSLATION_DOMAIN=\"org.fcitx.fcitx5.kcm\") add_definitions(-DFCITX_GETTEXT_DOMAIN=\"deepin-fcitx5-configtool\") add_definitions(-DQT_NO_KEYWORDS) diff --git a/debian/changelog b/debian/changelog index dd048faa..1ea9c97a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +deepin-fcitx5configtool-plugin (6.0.28) unstable; urgency=medium + + * fix: add UOS build support and update dependencies + * style(ui): adjust font and icon size for keyboard layout + * style(ui): unify title styles and fix addon button alignment + + -- dengzhongyuan Tue, 31 Mar 2026 22:27:45 +0800 + deepin-fcitx5configtool-plugin (6.0.27) unstable; urgency=medium * fix: add gettext translation support for fcitx5 config diff --git a/debian/control b/debian/control index 43828218..fb995efa 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,7 @@ Build-Depends: libpolkit-qt6-1-dev, pkg-config, xkb-data, + lsb-release, Standards-Version: 4.6.2 Rules-Requires-Root: no Homepage: https://github.com/fcitx/fcitx5-configtool diff --git a/debian/rules b/debian/rules index 750396dd..5e6d24bc 100755 --- a/debian/rules +++ b/debian/rules @@ -20,11 +20,14 @@ $(eval $(call detect_qt_version)) %: dh $@ --parallel +UOS_SYSTEM := $(shell lsb_release -i -s 2>/dev/null | grep -i uos | wc -l | tr -d ' ') + override_dh_auto_configure: dh_auto_configure -- \ -DENABLE_KCM=Off \ -DCMAKE_BUILD_TYPE=Release \ - -DQT_DIR=$(QT_DIR) + -DQT_DIR=$(QT_DIR) \ + $(if $(filter 1,$(UOS_SYSTEM)),-DBUILD_UOS=ON,) override_dh_auto_install: dh_auto_install --destdir=debian/tmp diff --git a/src-old/src/dcc-module/imsettingwindow.cpp b/src-old/src/dcc-module/imsettingwindow.cpp index ac1f6f6d..7a0fbff6 100644 --- a/src-old/src/dcc-module/imsettingwindow.cpp +++ b/src-old/src/dcc-module/imsettingwindow.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021 ~ 2021 Deepin Technology Co., Ltd. +// Copyright (C) 2021 ~ 2026 Deepin Technology Co., Ltd. // SPDX-FileCopyrightText: 2023 Deepin Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -36,8 +36,13 @@ DWIDGET_USE_NAMESPACE +#ifdef BUILD_UOS +const QString SOGOU_IM_UNIQUE_NAME = "com.sogou.ime.ng.fcitx5.uos"; +const QString SOGOU_CONFIGURE_APP_ID = "com.sogou.ime.ng.fcitx5.uos.configurer"; +#else const QString SOGOU_IM_UNIQUE_NAME = "com.sogou.ime.ng.fcitx5.deepin"; const QString SOGOU_CONFIGURE_APP_ID = "com.sogou.ime.ng.fcitx5.deepin.configurer"; +#endif using namespace dcc_fcitx_configtool::widgets; diff --git a/src/dcc-fcitx5configtool/operation/fcitx5configtool.cpp b/src/dcc-fcitx5configtool/operation/fcitx5configtool.cpp index 7f595072..2584bf96 100644 --- a/src/dcc-fcitx5configtool/operation/fcitx5configtool.cpp +++ b/src/dcc-fcitx5configtool/operation/fcitx5configtool.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "fcitx5configtool.h" @@ -31,9 +31,15 @@ namespace deepin { namespace fcitx5configtool { static QString kFcitxConfigGlobalPath = "fcitx://config/global"; +#ifdef BUILD_UOS +static const QString kSogouAddonUniqueName = "com.sogou.ime.ng.fcitx5.uos-addon"; +static const QString kSogouIMUniqueName = "com.sogou.ime.ng.fcitx5.uos"; +static const QString kSogouConfigureAppId = "com.sogou.ime.ng.fcitx5.uos.configurer"; +#else static const QString kSogouAddonUniqueName = "com.sogou.ime.ng.fcitx5.deepin-addon"; static const QString kSogouIMUniqueName = "com.sogou.ime.ng.fcitx5.deepin"; -static const QString kSogouConfigureAppId = "sogou-ime-setting"; +static const QString kSogouConfigureAppId = "com.sogou.ime.ng.fcitx5.deepin.configurer"; +#endif Fcitx5ConfigToolWorkerPrivate::Fcitx5ConfigToolWorkerPrivate(Fcitx5ConfigToolWorker *parent) : QObject(parent), q(parent) diff --git a/src/dcc-fcitx5configtool/qml/DetailConfigItem.qml b/src/dcc-fcitx5configtool/qml/DetailConfigItem.qml index b732a59e..d79da4e9 100644 --- a/src/dcc-fcitx5configtool/qml/DetailConfigItem.qml +++ b/src/dcc-fcitx5configtool/qml/DetailConfigItem.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 - 2027 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // SPDX-License-Identifier: GPL-3.0-or-later import QtQuick 2.15 import QtQuick.Layouts 1.15 @@ -65,121 +65,120 @@ DccObject { } } - Loader { - active: !root.loading - asynchronous: true - sourceComponent: DccRepeater { - model: root.configOptions - delegate: Component { - DccObject { - parentName: containerItem.name - displayName: modelData.description - weight: root.weight + index + 1 - pageType: DccObject.Editor - visible: headerItem.expanded - backgroundType: DccObject.Normal | DccObject.Hover - page: Loader { - height: 40 - sourceComponent: { - switch (modelData.type) { - case "Boolean": - return booleanComponent - case "Integer": - return integerComponent - case "String": - return stringComponent - case "List|Key": - return keyComponent - case "Enum": - return enumComponent - default: - return null - } + // Must be a direct child of containerItem so DccManager can register it. + DccRepeater { + id: optionRepeater + visible: !root.loading + model: root.configOptions + delegate: Component { + DccObject { + parentName: containerItem.name + displayName: modelData.description + weight: root.weight + index + 1 + pageType: DccObject.Editor + visible: headerItem.expanded + backgroundType: DccObject.Normal | DccObject.Hover + page: Loader { + height: 40 + sourceComponent: { + switch (modelData.type) { + case "Boolean": + return booleanComponent + case "Integer": + return integerComponent + case "String": + return stringComponent + case "List|Key": + return keyComponent + case "Enum": + return enumComponent + default: + return null } + } - Component { - id: booleanComponent - D.Switch { - checked: modelData.value === "True" - onCheckedChanged: { - dccData.fcitx5ConfigProxy.setValue( - root.name + "/" + modelData.name, - checked ? "True" : "False") - } + Component { + id: booleanComponent + D.Switch { + checked: modelData.value === "True" + onCheckedChanged: { + dccData.fcitx5ConfigProxy.setValue( + root.name + "/" + modelData.name, + checked ? "True" : "False") } } + } - Component { - id: integerComponent - D.SpinBox { - width: 55 - implicitWidth: 55 - value: parseInt(modelData.value) - onValueChanged: { - dccData.fcitx5ConfigProxy.setValue( - root.name + "/" + modelData.name, - value.toString()) - } + Component { + id: integerComponent + D.SpinBox { + width: 55 + implicitWidth: 55 + value: parseInt(modelData.value) + onValueChanged: { + dccData.fcitx5ConfigProxy.setValue( + root.name + "/" + modelData.name, + value.toString()) } } + } - Component { - id: stringComponent - D.TextField { - text: modelData.value - onTextChanged: { - dccData.fcitx5ConfigProxy.setValue( - root.name + "/" + modelData.name, - text) - } + Component { + id: stringComponent + D.TextField { + text: modelData.value + onTextChanged: { + dccData.fcitx5ConfigProxy.setValue( + root.name + "/" + modelData.name, + text) } } + } - Component { - id: keyComponent - KeySequenceDisplay { - placeholderText: qsTr("Please enter a new shortcut") - keys: modelData.value - background.visible: false - onFocusChanged: { - if (!focus) { - if (keys.length > 0) { - dccData.fcitx5ConfigProxy.setValue( - root.name + "/" + modelData.name + "/0", - keys, true) - } else if (root.keyName != modelData.name) { - keys = modelData.value - } + Component { + id: keyComponent + KeySequenceDisplay { + placeholderText: qsTr("Please enter a new shortcut") + keys: modelData.value + background.visible: false + onFocusChanged: { + if (!focus) { + if (keys.length > 0) { + dccData.fcitx5ConfigProxy.setValue( + root.name + "/" + modelData.name + "/0", + keys, true) + } else if (root.keyName != modelData.name) { + keys = modelData.value } } - onKeysChanged: { - root.keyName = modelData.name - } + } + onKeysChanged: { + root.keyName = modelData.name + } - Connections { - target: root - function onKeyNameChanged() { - if (root.keyName != modelData.name) { - focus = false - } + Connections { + target: root + function onKeyNameChanged() { + if (root.keyName != modelData.name) { + focus = false } } } } + } - Component { - id: enumComponent - D.ComboBox { - model: modelData.propertiesI18n - flat: true - currentIndex: modelData.properties.indexOf( - modelData.value) ? modelData.properties.indexOf( - modelData.value) : 0 - onCurrentIndexChanged: { - dccData.fcitx5ConfigProxy.setValue( - root.name + "/" + modelData.name, - modelData.properties[currentIndex]) - } + Component { + id: enumComponent + D.ComboBox { + model: modelData.propertiesI18n + flat: true + currentIndex: modelData.properties.indexOf( + modelData.value) ? modelData.properties.indexOf( + modelData.value) : 0 + onCurrentIndexChanged: { + dccData.fcitx5ConfigProxy.setValue( + root.name + "/" + modelData.name, + modelData.properties[currentIndex]) } } }