Skip to content

Commit

Permalink
chore: bring back display setting button
Browse files Browse the repository at this point in the history
Log:
  • Loading branch information
Decodetalkers authored and deepin-bot[bot] committed Jan 23, 2024
1 parent 945bb03 commit b5399bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 39 deletions.
12 changes: 11 additions & 1 deletion plugins/display/displaysettingwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ const int ItemSpacing = 10;
DisplaySettingWidget::DisplaySettingWidget(BrightnessModel *model, QWidget *parent)
: QWidget(parent)
, m_brightnessAdjWidget(new BrightnessAdjWidget(model, this))
, m_settingBtn(new QPushButton(tr("Display Settings"), this))
{
initUI();
connect(m_settingBtn, &QPushButton::clicked, this, [ this ](){
DDBusSender().service("org.deepin.dde.ControlCenter1")
.path("/org/deepin/dde/ControlCenter1")
.interface("org.deepin.dde.ControlCenter1")
.method("ShowPage").arg(QString("display")).call();
Q_EMIT requestHide();
});
}

void DisplaySettingWidget::initUI()
Expand All @@ -27,6 +35,7 @@ void DisplaySettingWidget::initUI()
mainLayout->setSpacing(ItemSpacing);

mainLayout->addWidget(m_brightnessAdjWidget);
mainLayout->addWidget(m_settingBtn);
mainLayout->addStretch();

setLayout(mainLayout);
Expand All @@ -39,5 +48,6 @@ void DisplaySettingWidget::initUI()
void DisplaySettingWidget::resizeWidgetHeight()
{
QMargins margins = this->contentsMargins();
setFixedHeight(margins.top() + margins.bottom() + m_brightnessAdjWidget->height());
setFixedHeight(margins.top() + margins.bottom() + m_brightnessAdjWidget->height() +
m_settingBtn->height() + ItemSpacing);
}
1 change: 1 addition & 0 deletions plugins/display/displaysettingwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class DisplaySettingWidget : public QWidget

private:
BrightnessAdjWidget *m_brightnessAdjWidget; // 亮度调整
QPushButton *m_settingBtn; // 设置按钮
};


Expand Down
19 changes: 2 additions & 17 deletions translations/dde-dock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,26 +151,11 @@
</context>
<context>
<name>DateTimeDisplayer</name>
<message>
<source>12-hour time</source>
<translation>12-hour time</translation>
</message>
<message>
<source>24-hour time</source>
<translation>24-hour time</translation>
</message>
<message>
<source>Time settings</source>
<translation>Time settings</translation>
</message>
</context>
<context>
<name>DevCollaborationWidget</name>
<message>
<source>PC collaboration</source>
<translation>PC collaboration</translation>
</message>
</context>
<context>
<name>DialogManager</name>
<message>
Expand Down Expand Up @@ -200,8 +185,8 @@
<context>
<name>DisplaySettingWidget</name>
<message>
<source>Multi-Screen Collaboration</source>
<translation>Multi-Screen Collaboration</translation>
<source>Display Settings</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand Down
25 changes: 4 additions & 21 deletions translations/dde-dock_zh_CN.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="zh_CN">
<context>
<name>AbstractPluginsController</name>
<message>
Expand Down Expand Up @@ -151,26 +149,11 @@
</context>
<context>
<name>DateTimeDisplayer</name>
<message>
<source>12-hour time</source>
<translation>12小时制</translation>
</message>
<message>
<source>24-hour time</source>
<translation>24小时制</translation>
</message>
<message>
<source>Time settings</source>
<translation>时间设置</translation>
</message>
</context>
<context>
<name>DevCollaborationWidget</name>
<message>
<source>PC collaboration</source>
<translation>电脑协同</translation>
</message>
</context>
<context>
<name>DialogManager</name>
<message>
Expand Down Expand Up @@ -200,15 +183,15 @@
<context>
<name>DisplaySettingWidget</name>
<message>
<source>Multi-Screen Collaboration</source>
<translation>电脑协同设置</translation>
<source>Display Settings</source>
<translation>显示设置</translation>
</message>
</context>
<context>
<name>DockPluginController</name>
<message>
<source>The plugin %1 is not compatible with the system.</source>
<translation>The plugin %1 is not compatible with the system.</translation>
<translation>插件%1和系统版本不兼容。</translation>
</message>
</context>
<context>
Expand Down

0 comments on commit b5399bd

Please sign in to comment.