Update upstream source from tag 'upstream/5.5.45'
Update to upstream version '5.5.45'
with Debian dir 7cf5cdc5a5752c948f98e2357c26f7bc56f86cf0
Boyuan Yang
1 year, 11 months ago
0 | 0 |
name: Call build-deb
|
1 | 1 |
on:
|
2 | 2 |
pull_request_target:
|
3 | |
types: [opened, synchronize]
|
4 | 3 |
paths-ignore:
|
5 | 4 |
- ".github/workflows/**"
|
6 | 5 |
|
5 | 5 |
jobs:
|
6 | 6 |
chatopt:
|
7 | 7 |
uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master
|
|
8 |
secrets:
|
|
9 |
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
|
0 | 0 |
name: cppcheck
|
1 | 1 |
on:
|
2 | 2 |
pull_request_target:
|
|
3 |
paths-ignore:
|
|
4 |
- ".github/workflows/**"
|
3 | 5 |
|
4 | 6 |
concurrency:
|
5 | 7 |
group: ${{ github.workflow }}-pull/${{ github.event.number }}
|
12 | 12 |
### Build from source code
|
13 | 13 |
|
14 | 14 |
1. Make sure you have installed all dependencies.
|
15 | |
|
|
15 |
````
|
|
16 |
sudo apt build-dep .
|
|
17 |
````
|
|
18 |
If you need to use the designer plugin, you should also install:
|
|
19 |
````
|
|
20 |
sudo apt install qttools5-dev
|
|
21 |
````
|
16 | 22 |
2. Build:
|
17 | 23 |
|
18 | 24 |
````
|
50 | 50 |
// TODO: 这里对dialog特殊处理,dialog不需要设置固定的位置,否则里面的坐标会发生偏移导致点击偏移
|
51 | 51 |
// 但是这不是问题的根本原因,还需要进一步分析。该属性在插件中做了特殊处理
|
52 | 52 |
q->QDialog::setProperty("DAbstractDialog", true);
|
|
53 |
auto noTitlebarEnabled = []{
|
|
54 |
QFunctionPointer enableNoTitlebar = qApp->platformFunction("_d_isEnableNoTitlebar");
|
|
55 |
bool enabled = qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool();
|
|
56 |
return enabled && enableNoTitlebar != nullptr;
|
|
57 |
};
|
|
58 |
|
53 | 59 |
if (qApp->isDXcbPlatform()) {
|
54 | 60 |
handle = new DPlatformWindowHandle(q, q);
|
55 | 61 |
|
|
71 | 77 |
|
72 | 78 |
bgBlurWidget->setBlurEnabled(blurIfPossible);
|
73 | 79 |
q->setAttribute(Qt::WA_TranslucentBackground, blurIfPossible);
|
74 | |
} else if (qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool()) {
|
|
80 |
} else if (noTitlebarEnabled()) {
|
75 | 81 |
handle = new DPlatformWindowHandle(q, q);
|
76 | 82 |
// fix wayland no titlebar
|
77 | 83 |
//q->setWindowFlags(q->windowFlags() | Qt::FramelessWindowHint);
|
293 | 293 |
}
|
294 | 294 |
|
295 | 295 |
if (d->follower && watched == d->follower->topLevelWidget()) {
|
296 | |
if (event->type() == QEvent::HoverMove)
|
|
296 |
if (event->type() == QEvent::HoverMove || event->type() == QEvent::UpdateRequest)
|
297 | 297 |
d->updateTooltipPos();
|
298 | 298 |
|
299 | 299 |
if (d->timer.isActive())
|
44 | 44 |
{
|
45 | 45 |
titlebar = new DTitlebar(qq);
|
46 | 46 |
titlebar->setAccessibleName("DMainWindowTitlebar");
|
47 | |
if (DApplication::isDXcbPlatform() || (qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool())) {
|
|
47 |
auto noTitlebarEnabled = []{
|
|
48 |
QFunctionPointer enableNoTitlebar = qApp->platformFunction("_d_isEnableNoTitlebar");
|
|
49 |
bool enabled = qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool();
|
|
50 |
return enabled && enableNoTitlebar != nullptr;
|
|
51 |
};
|
|
52 |
if (DApplication::isDXcbPlatform() || noTitlebarEnabled()) {
|
48 | 53 |
handle = new DPlatformWindowHandle(qq, qq);
|
49 | 54 |
qq->setMenuWidget(titlebar);
|
50 | 55 |
} else {
|
1278 | 1278 |
QPrinterInfo updateinfo(*printer);
|
1279 | 1279 |
|
1280 | 1280 |
QStringList pageSizeList;
|
|
1281 |
int index = -1;
|
1281 | 1282 |
for (int i = 0; i < updateinfo.supportedPageSizes().size(); i++) {
|
1282 | 1283 |
pageSizeList.append(updateinfo.supportedPageSizes().at(i).key());
|
|
1284 |
if (index == -1 && updateinfo.supportedPageSizes().at(i).id() == QPageSize::PageSizeId::A4) {
|
|
1285 |
index = i;
|
|
1286 |
}
|
1283 | 1287 |
}
|
1284 | 1288 |
paperSizeCombo->addItems(pageSizeList);
|
1285 | 1289 |
if (pageSizeList.contains(lastPaperSize)) {
|
|
1287 | 1291 |
} else {
|
1288 | 1292 |
//调用绘制预览
|
1289 | 1293 |
paperSizeCombo->blockSignals(false);
|
1290 | |
paperSizeCombo->setCurrentText("A4");
|
|
1294 |
paperSizeCombo->setCurrentIndex(index == - 1 ? 0 : index);
|
1291 | 1295 |
}
|
1292 | 1296 |
|
1293 | 1297 |
//判断当前打印机是否支持双面打印,不支持禁用双面打印按钮,pdf不做判断
|
170 | 170 |
}
|
171 | 171 |
|
172 | 172 |
QMenu *menu = createStandardContextMenu();
|
|
173 |
if (!menu)
|
|
174 |
return QTextEdit::contextMenuEvent(e);
|
|
175 |
|
173 | 176 |
menu->addSeparator();
|
174 | 177 |
|
175 | 178 |
connect(menu, &QMenu::triggered, this, [this](QAction *pAction) {
|
516 | 516 |
// 另外,让标题栏接收焦点,还是为了避免一个focus控件隐藏时,会把焦点转移给标题栏上的按钮控件
|
517 | 517 |
q->setFocusPolicy(Qt::StrongFocus);
|
518 | 518 |
|
|
519 |
auto noTitlebarEnabled = []{
|
|
520 |
QFunctionPointer enableNoTitlebar = qApp->platformFunction("_d_isEnableNoTitlebar");
|
|
521 |
bool enabled = qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool();
|
|
522 |
return enabled && enableNoTitlebar != nullptr;
|
|
523 |
};
|
519 | 524 |
// fix wayland 下显示了两个应用图标,系统标题栏 和 dtk标题栏 均显示应用图标
|
520 | |
q->setEmbedMode(!(DApplication::isDXcbPlatform()|| (qApp->platformName() == "dwayland" || qApp->property("_d_isDwayland").toBool())));
|
|
525 |
q->setEmbedMode(!(DApplication::isDXcbPlatform()|| noTitlebarEnabled()));
|
521 | 526 |
}
|
522 | 527 |
|
523 | 528 |
QWidget *DTitlebarPrivate::targetWindow()
|
34 | 34 |
\a parent 为创建对象的父控件。
|
35 | 35 |
*/
|
36 | 36 |
DWindowCloseButton::DWindowCloseButton(QWidget * parent)
|
37 | |
: DIconButton(QStyle::SP_TitleBarCloseButton, parent)
|
|
37 |
: DIconButton(parent)
|
38 | 38 |
{
|
|
39 |
//QStyle::SP_TitleBarCloseButton
|
|
40 |
auto iconEngine = new DStyledIconEngine(DDrawUtils::drawTitleBarCloseButton, QStringLiteral("TitleBarCloseButton"));
|
|
41 |
setIcon(QIcon(iconEngine));
|
39 | 42 |
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
40 | 43 |
setFlat(true);
|
41 | 44 |
}
|
25 | 25 |
DWindowMaxButtonPrivate(DWindowMaxButton* qq)
|
26 | 26 |
: DIconButtonPrivate(qq)
|
27 | 27 |
{
|
28 | |
m_isMaximized = false;
|
|
28 |
}
|
|
29 |
|
|
30 |
void setMaximized(bool isMaximized)
|
|
31 |
{
|
|
32 |
if (isMaximized == m_isMaximized)
|
|
33 |
return;
|
|
34 |
|
|
35 |
m_isMaximized = isMaximized;
|
|
36 |
|
|
37 |
updateIcon();
|
|
38 |
|
|
39 |
Q_EMIT q_func()->maximizedChanged(isMaximized);
|
|
40 |
}
|
|
41 |
|
|
42 |
void updateIcon()
|
|
43 |
{
|
|
44 |
auto drawFun = !m_isMaximized ? DDrawUtils::drawTitleBarMaxButton : DDrawUtils::drawTitleBarNormalButton;
|
|
45 |
QString iconName = !m_isMaximized ? QStringLiteral("TitleBarMaxButton") : QStringLiteral("TitleBarNormalButton");
|
|
46 |
|
|
47 |
q_func()->setIcon(QIcon (new DStyledIconEngine(drawFun, iconName)));
|
29 | 48 |
}
|
30 | 49 |
|
31 | 50 |
private:
|
32 | |
bool m_isMaximized;
|
|
51 |
bool m_isMaximized = false;
|
33 | 52 |
Q_DECLARE_PUBLIC(DWindowMaxButton)
|
34 | 53 |
};
|
35 | 54 |
|
|
55 | 74 |
DIconButton(*new DWindowMaxButtonPrivate(this), parent)
|
56 | 75 |
{
|
57 | 76 |
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
58 | |
setIcon(QStyle::SP_TitleBarMaxButton);
|
|
77 |
d_func()->updateIcon();
|
59 | 78 |
setFlat(true);
|
60 | 79 |
}
|
61 | 80 |
|
|
92 | 111 |
{
|
93 | 112 |
D_D(DWindowMaxButton);
|
94 | 113 |
|
95 | |
if (d->m_isMaximized == isMaximized)
|
96 | |
return;
|
97 | |
|
98 | |
d->m_isMaximized = isMaximized;
|
99 | |
|
100 | |
if (isMaximized) {
|
101 | |
setIcon(QStyle::SP_TitleBarNormalButton);
|
102 | |
} else {
|
103 | |
setIcon(QStyle::SP_TitleBarMaxButton);
|
104 | |
}
|
105 | |
|
106 | |
Q_EMIT maximizedChanged(isMaximized);
|
|
114 |
d->setMaximized(isMaximized);
|
107 | 115 |
}
|
108 | 116 |
|
109 | 117 |
void DWindowMaxButton::initStyleOption(DStyleOptionButton *option) const
|
39 | 39 |
DWindowMinButton::DWindowMinButton(QWidget * parent)
|
40 | 40 |
: DIconButton(QStyle::SP_TitleBarMinButton, parent)
|
41 | 41 |
{
|
|
42 |
//QStyle::SP_TitleBarMinButton
|
|
43 |
auto iconEngine = new DStyledIconEngine(DDrawUtils::drawTitleBarMinButton, QStringLiteral("TitleBarMinButton"));
|
|
44 |
setIcon(QIcon(iconEngine));
|
42 | 45 |
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
43 | 46 |
setFlat(true);
|
44 | 47 |
}
|
35 | 35 |
\a parent 为创建对象的父控件。
|
36 | 36 |
*/
|
37 | 37 |
DWindowOptionButton::DWindowOptionButton(QWidget * parent)
|
38 | |
: DIconButton(QStyle::SP_TitleBarMenuButton, parent)
|
|
38 |
: DIconButton(parent)
|
39 | 39 |
{
|
|
40 |
//QStyle::SP_TitleBarMenuButton
|
|
41 |
auto iconEngine = new DStyledIconEngine(DDrawUtils::drawTitleBarMenuButton, QStringLiteral("TitleBarMenuButton"));
|
|
42 |
setIcon(QIcon(iconEngine));
|
40 | 43 |
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
41 | 44 |
setFlat(true);
|
42 | 45 |
}
|
25 | 25 |
DWIDGET_BEGIN_NAMESPACE
|
26 | 26 |
|
27 | 27 |
DWindowQuitFullButton::DWindowQuitFullButton(QWidget * parent)
|
28 | |
: DIconButton(DStyle::SP_TitleQuitFullButton ,parent)
|
|
28 |
: DIconButton(parent)
|
29 | 29 |
{
|
|
30 |
//DStyle::SP_TitleQuitFullButton
|
|
31 |
auto iconEngine = new DStyledIconEngine(DDrawUtils::drawTitleQuitFullButton, QStringLiteral("TitleQuitFullButton"));
|
|
32 |
setIcon(QIcon(iconEngine));
|
30 | 33 |
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
31 | 34 |
setFlat(true);
|
32 | 35 |
}
|