Commit Graph

261 Commits

Author SHA1 Message Date
deepin-bot[bot] 6002ec2b37
chore: Sync by (#30)
chore: Sync by
2022-07-19 10:28:40 +00:00
ck ea044318c0 fix(build): arch build failed
add makedepends libqtxdg

Log:
Influence: none
Change-Id: I7993a5bd0ca9cadac0c2af38a10e9d45afd8d75a
2022-07-19 10:22:35 +08:00
ck a479eaa5a8 chore: update changelog
update changelog

Log: update changelog
Influence: none
Change-Id: Iefda76009421210bfb0132576e973757407fafd4
2022-07-19 10:22:35 +08:00
ck 4976a77764 chore: update changelog
update changelog

Log: update changelog
Influence: none
Change-Id: I6ba374db79ab7e5448317008cf97f26c5ba23b29
2022-07-19 10:22:35 +08:00
Chen Bin d0bf83a9f6 fix: Icon fallback for mode option only
In the method of getting icons in QML, only the mode of
the icon needs to be fallback, so change all fallback to
only fallback mode to ensure the consistency of the interface.

Log:
Influence: None
Change-Id: If95c352b77c89fba2e393e542d43f19aff665ba3
2022-07-19 10:22:35 +08:00
Chen Bin 454ba294a9 fix: DciIcon allows no fallback when matching icons
When using DciIcon, it is allowed to apply a fallback mechanism
that does not use DciIcon's own. In this case, the target icon
will be found directly by the parameters.

Log:
Influence: None
Change-Id: Ia288e3ba3bd08c2a7729cf9f6154e77e4ad7b512
2022-07-19 10:22:35 +08:00
Chen Bin b917cd8f65 fix: Add default icon fill style
1. For icons that do not use the palette, it is hoped that the
effect can be achieved by modifying the brightness of icons in
different states. Therefore, it is necessary to add an interface
for DciIcon to determine whether to use the palette.

2. Add the interface to modify the icon style by default, traverse
the pixels of the picture, and uniformly reduce the brightness.

Log:
Influence: None
Change-Id: I2c8592fab72751f887b51d48f346e562f82a51cc
2022-07-19 10:22:35 +08:00
ck 3cba7f1fce chore: update changelog version
update verion to 5.6.1

Log: none
Influence: none
Change-Id: I39e316f1e556d2fe67fc68bce5bcf2a303f25cbd
2022-07-19 10:22:35 +08:00
ck 326eb00c69 chore: use Qt5XdgIconLoader instead of Qt5Xdg
Qt5Xdg depends Qt5Widgets, dtkgui not depends Qt5Widgets

Log: none
Influence: none
Change-Id: I8dd89e323ff7c7cdaa5c9ac9ea62bc70d6d506e8
2022-07-19 10:22:35 +08:00
ck 71b349d2c7 fix(build): 覆盖旧配方rc文件重复添加
util.pri 中添加过 RESOURCES,去掉重复添加的

Log: none
Influence: none
Change-Id: Ie576f712405dc9309c164324f745567603a74bbc
2022-07-19 10:22:35 +08:00
wang fei 0f52bb9546 chore: 更新changelog
develop/snipe 分支更新changelog 到 5.6.0.1

Log:
Influence: changelog
Change-Id: I4da222f8d3b65b85acb3d507acff51c219453aa1
2022-07-19 10:22:35 +08:00
ck e7568851c4 revert: 将拼写错误接口标记废弃
This revert commit 06d2103534a21346e3996dbbcdf7cd403411bf0e
标记废弃而不删除,保证接口不减少

Log:
Incluence: abi
Change-Id: I4c5a24088eeafacad7a421f91f4c97b069ebed48
2022-07-19 10:22:35 +08:00
Chen Bin 5c15f33b5d fix: Memory leakage of icons
When the picture data is empty, an uninitialized variable generates a
random-size picture, which takes up a lot of memory space. So these
variables must be initialized before they can be used to prevent unknown
problems.

Log:
Influence: Dci Icon
Change-Id: Ife9f6e02f3fe2cc07e9d6f9f39d76b6230c6c930
2022-07-19 10:22:35 +08:00
Chen Bin 4b8687678b fix: DCI path has one more '/' symbol
When looking for icon theme, redundant '/' symbols will
appear in the icon of parsing application.

Log:
Influence: None
Change-Id: Ib55a8d6132eb1ed2aec98918529d59c3dd9c9536
2022-07-19 10:22:35 +08:00
Chen Bin 503ac5d6b0 chore: fix typo
DPalette中存在错别字接口修复。

Log:
Influence: 使用dtkgui的应用的接口影响
Change-Id: I4622c7c9c40e2aa7f3924f332dbe9f20a0dfd9ac
2022-07-19 10:22:35 +08:00
ck 7eefcfe8ae fix(build): can't build with source format '3.0 (quilt)'
debian: switch packaging format from "quilt" to "native"

Log:
Influence: build
Change-Id: I2fdda4245fcc0e467b9d815c846d791791950b3f
2022-07-19 10:22:35 +08:00
Ye ShanShan ca0a01c9c7 feat: add openUrl function
it's convenient for qml moved openUrl from dtkwidget to dtkgui.

Log: 
Influence: dtkdeclarative relys on this commit.
Change-Id: I7f720b02e91467a2bfb2bd3608afba8ad0d12312
2022-07-19 10:22:35 +08:00
Ye ShanShan 679a234177 feat: Add user manual functon
widgets and quick both use user manual,
so it is moved from DApplication.

Log: 
Influence: dtkdeclarative relys on this commit.
Change-Id: Ie2a5fb7edffb9ceeee48d42ba1b396291a4e5539
2022-07-19 10:22:35 +08:00
ck 7484c50c08 fix: 修复异常退出时再次启动失败的问题
reverts commit 88e0b51da7
去掉原来通过共享内存记录pid的方式来避免快速启动应用导致单进程失败的实现
改成启动时通过QLockFile来确保是 server 还是 client。保证只有一个 server ,其他
都是 client (旧逻辑:启动先通过localsocket连接 localserver,连接失败再启动
server,正常启动时没有问题, 当脚本快速多次启动(detached)单进程应用时,都在
等待连接,超时之后就启动了多个应用)

Bug: https://pms.uniontech.com/bug-view-111699.html
Log:
Influence: single-instance
Change-Id: I9b38e039abbbd70de969a1abf2f4f37fe07e1315
2022-07-19 10:22:35 +08:00
Chen Bin 6393c2e1ee refactor: Refactor the attribute parsing function
1. Separate the logic of each step so that the parsing part of each
property does not interfere with each other.

2. Fix the problem of parsing failure when it has `padding` and no
`palette` in the property

Log:
Influence: None
Change-Id: I35c2b807a72d6329a222fbcd99ce5b656e1dc412
2022-07-19 10:22:35 +08:00
wang fei 2c0a96ce2a feat: ddciicon增加fromTheme接口
1. 增加static DDciIcon fromTheme(const QString &name);
2. 增加static DDciIcon fromTheme(const QString &name, const DDciIcon &fallback);

Log:
Influence: fromTheme接口
Change-Id: I280bbac69e68bd500069ad145baf02861311f3f7
2022-07-19 10:22:35 +08:00
zccrs 3dd4b9b5fa feat: support group name on find dci icon file
Use the '/' to split the icon group name and it's actual icon name.
In the dtkdeclarative and dtkwidget, should be add the application
id for prefix for the icon name, eg: the "test" built-in icon in the
"org.deepin.app" application,  when to find it with
DIconTheme::findDciIconFile, the "iconName" argument should is
"org.deepin.app/test".

Influence: 无

Log:
Change-Id: Icc45faf16926993a6281aca5bee995b839c5b462
2022-07-19 10:22:35 +08:00
zccrs 54ef3e64ca feat: supported fallback to without theme directory for get dci icon
Use the DStandardPaths::paths(DStandardPaths::DSG::DataDir) instead of
the DStandardPaths::path(DStandardPaths::DSG::DataDir), support multi
path for find icon from theme.

Influence: 无

Log:
Change-Id: Ie444eea4e6a93ff37a8585aee8b451940302cd7f
2022-07-19 10:22:35 +08:00
Chen Bin e9c615b5dc feat: Add the webp plugin dependence
DCI icons need the support of webp plugin when parsing
some icons, otherwise the images will not be displayed
normally.

Log:
Influence: Dtkgui dependence
Change-Id: I9c4a780dc23fdf2e96c9e23e6580b4efd56f695b
2022-07-19 10:22:35 +08:00
Chen Bin d145d3027d fix(DciIcon): Image scaling sawtooth
Fast scaling of the image will cause aliasing problems, Use
smooth scaling to solve this problem.

Log:
Influence: Dci icon
Change-Id: I4fa8e464539e03bd7bee79fe2f3e34463b3bd6c3
2022-07-19 10:22:35 +08:00
Chen Bin 411ceb5116 fix(DciIcon): Function add const keyword
Add keywords to limit the call scope of a function.

Log:
Influence: Dci icon
Change-Id: I091fca795da23aa128ffc0e5bbecf361d5db9b15
2022-07-19 10:22:35 +08:00
Chen Bin eba6c902da fix: macos runtime error.
Add runtime environment dependencies for MacOS.

Log:
Influence: dci image tool
Change-Id: I1d8869b719fcaa1ff6cbab9d88b7a330f6fa3b67
2022-07-19 10:22:35 +08:00
Chen Bin 533d213b1b feat: Add dci image convert tool
Some images saved into dci icon should convert it's format
to alpha8. therefore, we need to add a tool to complete the
format conversion.

Log:
Influence: none
Change-Id: Ia9e146db60e9e7cc4b323c5a4b892777a9313a42
2022-07-19 10:22:35 +08:00
Chen Bin 885c1fd01f feat(DCI icon): Add analytical adaptation under alpha8 format
Alpha8 format only retains the alpha channel, so the file size
of DCI icon will be effectively reduced. However, due to the
compression problem of some image formats, this behavior only
supports images in the format of "PNG".

Log:
Influence: dci icon
Change-Id: Ifbc99fc1a5995adbf593d24aa60b943a49d4b308
2022-07-19 10:22:35 +08:00
Chen Bin 794fdc7af4 fix: Determine if the icon file is empty when painting
There may be situations where the icon data reading fails
or the icon file cannot be read, resulting in the inability
 to obtain the pixmap data with warnings.

Log:
Influence: Built-in Icon
Change-Id: I6fa4677bc4c5d7986d5546c4068d390976591e98
2022-07-19 10:22:35 +08:00
Chen Bin 1d4d680ded fix(icon theme): Search built-in theme when themeName is empty
We expect to find icons from built-in icon themes without icon themes.

Log:
Influence: DCI icon theme
Change-Id: Ie625c4f9c431c4fb95f5c509d16742715d79a9a1
2022-07-19 10:22:35 +08:00
Chen Bin 6d092b93f0 feat: Add icon padding property
Layers with some icons may have a padding attribute that
makes the layer not take up Icon space beyond the padding
area (based on this design).

1. Padding will increase in scale ratio to fit icon size
2. The resulting icon file will contain all sizes of the
icon (including padding sizes).
3. If the target icon size is larger than the source icon
size, padding scales to fit the icon size.

Log:
Influence: DCI icon
Change-Id: I5f1594e24202bf5ee1891885322e327d37344d23
2022-07-19 10:22:35 +08:00
Chen Bin a252a7fa1f fix: Convert icon palette to QString
There is no need to convert the icon palette into qurl type,
but directly into qstring type in the internal implementation,
which is convenient for external use.

Log:
Influence: dci icon
Change-Id: Idc0136bb0fdff2ac96b0f84aca9ff86f5b4df152
2022-07-19 10:22:35 +08:00
Chen Bin b3a9d5362b refactor: Reimplement DCI Icon
1. Delete the icon type controlled by Type enum. The icon type
does not recognize whether the icon is one or more, and has
certain limitations in finding and using.

2. Delete data qualification with foreground and background only.
Add the layer concept, Each state of an icon can only add 5
layers at most, and each layer has its own color for decoration,
increasing the flexibility of icon drawing.

3. Add Icon palette object. It is a common object that controls
the color of icon layers. There are currently four palettes:
foreground, background, highlight, highlightForeground.

Log:
Influence: DCI ICON
Change-Id: Idf818cc9cf77aefd8a88a13fd21f9f817160e729
2022-07-19 10:22:35 +08:00
Chen Bin 38b51ed45d fix: High DPI case the icon size is invalid
Because of calculating the device ratio multi-times, painting icons
use a invalid size.

Log:
Influence: None
Change-Id: Ia6f5407a6bc4ad58781483c83ca08eec6a2a11a9
2022-07-19 10:22:35 +08:00
Chen Bin 56873401b9 fix: Cannot get the icon data when the iconSize is -1
Some icons use - 1 as the initial icon size, but the icon cannot be
found, This problem can be solved by modifying the judgment condition
to < = 0.

Log:
Influence: find DciIcon use iconSize -1
Change-Id: If34bd8d609a5df0f67689519abe9189cc4e44db0
2022-07-19 10:22:35 +08:00
Chen Bin b4e53fb126 refactor: Change DDciIcon result to icon path
Loading the dci icon file will consume some time. Modify the loading
icon file way to load its path, and add the corresponding cache var-
iable to speed up the loading speed.

Log:
Influence: dci icon theme
Change-Id: I44c593484da14a4c2757ac38321622ad83b031b0
2022-07-19 10:22:35 +08:00
Chen Bin 678a18847e feat: Add implementation of icon theme
This implementation is based on the icon theme specification and
the dci file specification. Relevant specifications including icon
naming, directory naming and icon search are formulated. For more
details, please refer to the icon topic specification document of
DSG.

icon name example:
    // Correctly
    *  1. example
    *  2. org.deepin.app/example
    *  3. org.deepin.app/icons/example
    // Wrongful
    *  1. example.dci
    *  2. org.deepin.app/../icons/example.dci
    *  3. ../example.dci
    *  4. org.deepin.app/../icons/example.dci
    ...

icon theme paths:
    *  1. DSG system path: DSG-DataDir + "/icons"
    *  2. app resource path: :/dsg/icons
    *  3. app built in path: :/dsg/built-in-icons
    *  4. other custom paths.

Log:
Influence: None
Change-Id: If9b3cbe42b21319bfde4091f845aa1e28b7a27b4
2022-07-19 10:22:35 +08:00
Chen Bin 1562b12e9a fix: Move the CurrentType enum value to the end.
The CurrentType is a special value that indicates the type which
is used currently. It is not an actual value, and can't be used to
process logic. So move the value to the end of Type enum.

Log:
Influence: Dci Icon's type
Change-Id: I08a2ffa70d63c33f8ba4818e1982d4bbc9127fc4
2022-07-19 10:22:35 +08:00
Ye ShanShan 0eae7ec610 feat: add openUrl function
it's convenient for qml moved openUrl from dtkwidget to dtkgui.

Log: 
Influence: dtkdeclarative relys on this commit.
Change-Id: I7f720b02e91467a2bfb2bd3608afba8ad0d12312
2022-07-19 10:22:35 +08:00
Ye ShanShan 8f76d8e683 feat: Place the macro Q_ENUM after the enum declaration
This macro registers enum type with the meta-object system.

Log: 
Influence: qml access window's flags.
Change-Id: I9dfef86724a86c04b7a0fa4b36436464bd12d7da
2022-07-19 10:22:35 +08:00
Chen Bin 918da56c8d fix: DCI icon paint failed when size is invalid
When the iconsize parameter does not exist, we still expect
to draw the DCI icon instead of returning an error. Because
the icon passed in by the user already contains the size of
the icon.

The ok variable is not used. We need to use it as the judgment
condition for the success of integer conversion.

Log:
Influence: DCI Icons
Change-Id: I3a26102819542718af97aa8ff373b05cfc5de61f
(cherry picked from commit 58088867b060426cee52a7656a0986862e6ef8c9)
2022-07-19 10:22:35 +08:00
zccrs 2b30030af2 feat: 根据DCI标准添加DDciIcon类
DDciIcon 类为 Dci 文件和 Dci 图标资源提供了一个
严格标准的图标实例。通过将标准的 DCI 图标文件或图标
数据解析成可添加到 Dtk 控件中的图标资源。通常的这类
标准的图标资源都包含{ 深浅主题、图标状态、以及不同类
型 }。该类将根据当前需要的状态,将对应的图标展现出来。

 DDciIcon 所需要的原始数据文件最少需要一个 Normal
状态下的图标资源,否则此 Icon 将被视为是空图标。对于
有不同状态的图标资源,DDciIcon 在绘制时会优选选择使
用其自带的内容,但对于目标状态和图标状态不同的图标资源,
其绘制会根据画笔的前景色进行统一处理。

针对图标种类,DDciIcon 存储一个当前图标的变量,如果在
绘制时未指定目标图标种类,则会获取默认的当前图标种类变量
进行绘制,默认的当前图标种类为 TextType,不同的图标种
类其绘制方式也不一样,种类包含{ TextType、ActionType、
IconType }。详细描述请查阅DTK相关文档。

Log:
Influence: 无
Change-Id: Ia85d64e0885674d8b8ff8c17587f3781ac54d6b2
(cherry picked from commit 62f7b1d290841372a6dbe6e03a034bec093febb6)
2022-07-19 10:22:35 +08:00
Ye ShanShan b22b1d6aa2 feat: Add user manual functon
widgets and quick both use user manual,
so it is moved from DApplication.

Log: 
Influence: dtkdeclarative relys on this commit.
Change-Id: Ie2a5fb7edffb9ceeee48d42ba1b396291a4e5539
2022-07-19 10:22:35 +08:00
zccrs 6e800eb1d8 fix: Avoid repeatedly turning on notitlebar mode
Only in the enable state to initialize the window radius property.

Log:
Influence: None
Change-Id: I025bd95fe50834c8dbbbe8ca3f72945b0209af13
2022-07-19 10:22:35 +08:00
zccrs b40b8b42a8 feat: Add DIconTheme class
DIconTheme 提供从图标主题中查找 QIcon 的功能,与 QIcon::fromTheme
不同的是,DIconTheme 默认不会通过 Qt platform theme 进行图标加载,
而是直接创建内置图标引擎,或者是 XdgIconLoaderEngine,这样可以保证
在任何桌面环境下使用此接口的程序都能正确的查找到图标,这对 DTK 程序
而言非常重要,因为它们一般都还会依赖 DBuiltinIconEngine 提供的功能。

Log:
Influence: 无
Change-Id: I34ff035ffc7b3cfece780fe2676553638904a00d
2022-07-19 10:22:35 +08:00
ck d8f440c01e fix: dock radius changed when set global windowradius
if user has set windowradius, we do not set again when
DPlatformTheme::windowRadiusChanged emit.

Bug: https://pms.uniontech.com/bug-view-147219.html
Log: fix dock radius changed when set global windowradius
Influence: dock radius
Change-Id: Iba8226a67bbc5dfdac4151ab046725b3b1dca512
2022-07-13 14:42:41 +08:00
justforlxz ede95f3d9d feat: update archlinux build
update archlinux build

Log:
2022-06-21 17:43:35 +08:00
justforlxz 9777dc8959 feat: add archlinux build
sync from deepin-community

Log:
2022-06-21 13:08:01 +08:00
ck b24280bbe0 fix: dcc 再次调用 setSingleInstance后无法启动
旧版控制中心有使用不同的 key 再次调用 setSingleInstance
本次修改后,同一个进程多次调用接口使用后调用的key来锁定文件,符合
之前的 local server close 再 listen 的逻辑。

Influence: dcc setSingleInstance twice
Log: 修复dtkgui升级后dcc无法启动的问题
Change-Id: I97d9146be88d34cc12d16fc75cd1eccdeb53c315
2022-06-06 14:53:24 +08:00