Fix a typo: centeral -> central

Change-Id: Iaa1eb358b5577a6553667a53907984815cb9a0e5
This commit is contained in:
Felix Yan 2017-02-06 22:25:47 +08:00
parent b383e9cc7d
commit c71600e578
No known key found for this signature in database
GPG Key ID: 786C63F330D7CB92
Notes: Deepin Code Review 2017-02-07 16:45:37 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Tue, 07 Feb 2017 16:45:36 +0800
Reviewed-on: https://cr.deepin.io/19988
Project: dde/dde-dock
Branch: refs/heads/master
16 changed files with 88 additions and 88 deletions

View File

@ -11,13 +11,13 @@
ContainerWidget::ContainerWidget(QWidget *parent) ContainerWidget::ContainerWidget(QWidget *parent)
: QWidget(parent), : QWidget(parent),
m_centeralLayout(new QHBoxLayout) m_centralLayout(new QHBoxLayout)
{ {
m_centeralLayout->addStretch(); m_centralLayout->addStretch();
m_centeralLayout->setSpacing(0); m_centralLayout->setSpacing(0);
m_centeralLayout->setMargin(0); m_centralLayout->setMargin(0);
setLayout(m_centeralLayout); setLayout(m_centralLayout);
setFixedHeight(ITEM_HEIGHT); setFixedHeight(ITEM_HEIGHT);
setFixedWidth(ITEM_WIDTH); setFixedWidth(ITEM_WIDTH);
setAcceptDrops(true); setAcceptDrops(true);
@ -27,7 +27,7 @@ void ContainerWidget::addWidget(QWidget * const w)
{ {
w->setParent(this); w->setParent(this);
w->setFixedSize(ITEM_WIDTH, ITEM_HEIGHT); w->setFixedSize(ITEM_WIDTH, ITEM_HEIGHT);
m_centeralLayout->addWidget(w); m_centralLayout->addWidget(w);
m_itemList.append(w); m_itemList.append(w);
setFixedWidth(ITEM_WIDTH * std::max(1, m_itemList.size())); setFixedWidth(ITEM_WIDTH * std::max(1, m_itemList.size()));
@ -35,7 +35,7 @@ void ContainerWidget::addWidget(QWidget * const w)
void ContainerWidget::removeWidget(QWidget * const w) void ContainerWidget::removeWidget(QWidget * const w)
{ {
m_centeralLayout->removeWidget(w); m_centralLayout->removeWidget(w);
m_itemList.removeOne(w); m_itemList.removeOne(w);
setFixedWidth(ITEM_WIDTH * std::max(1, m_itemList.size())); setFixedWidth(ITEM_WIDTH * std::max(1, m_itemList.size()));

View File

@ -22,7 +22,7 @@ protected:
void dragEnterEvent(QDragEnterEvent *e); void dragEnterEvent(QDragEnterEvent *e);
private: private:
QHBoxLayout *m_centeralLayout; QHBoxLayout *m_centralLayout;
QList<QWidget *> m_itemList; QList<QWidget *> m_itemList;
}; };

View File

@ -17,19 +17,19 @@ QPoint PluginsItem::MousePressPoint = QPoint();
PluginsItem::PluginsItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent) PluginsItem::PluginsItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent)
: DockItem(parent), : DockItem(parent),
m_pluginInter(pluginInter), m_pluginInter(pluginInter),
m_centeralWidget(m_pluginInter->itemWidget(itemKey)), m_centralWidget(m_pluginInter->itemWidget(itemKey)),
m_itemKey(itemKey), m_itemKey(itemKey),
m_draging(false) m_draging(false)
{ {
Q_ASSERT(m_centeralWidget); Q_ASSERT(m_centralWidget);
QBoxLayout *hLayout = new QHBoxLayout; QBoxLayout *hLayout = new QHBoxLayout;
hLayout->addWidget(m_centeralWidget); hLayout->addWidget(m_centralWidget);
hLayout->setSpacing(0); hLayout->setSpacing(0);
hLayout->setMargin(0); hLayout->setMargin(0);
m_centeralWidget->installEventFilter(this); m_centralWidget->installEventFilter(this);
m_centeralWidget->setVisible(true); m_centralWidget->setVisible(true);
setLayout(hLayout); setLayout(hLayout);
setAccessibleName(pluginInter->pluginName() + "-" + m_itemKey); setAccessibleName(pluginInter->pluginName() + "-" + m_itemKey);
@ -131,7 +131,7 @@ void PluginsItem::paintEvent(QPaintEvent *e)
bool PluginsItem::eventFilter(QObject *o, QEvent *e) bool PluginsItem::eventFilter(QObject *o, QEvent *e)
{ {
if (m_draging) if (m_draging)
if (o == m_centeralWidget && e->type() == QEvent::Paint) if (o == m_centralWidget && e->type() == QEvent::Paint)
return true; return true;
return DockItem::eventFilter(o, e); return DockItem::eventFilter(o, e);

View File

@ -44,7 +44,7 @@ private:
private: private:
PluginsItemInterface * const m_pluginInter; PluginsItemInterface * const m_pluginInter;
QWidget *m_centeralWidget; QWidget *m_centralWidget;
const QString m_itemKey; const QString m_itemKey;
bool m_draging; bool m_draging;

View File

@ -16,16 +16,16 @@ DatetimePlugin::DatetimePlugin(QObject *parent)
m_refershTimer->setInterval(1000); m_refershTimer->setInterval(1000);
m_refershTimer->start(); m_refershTimer->start();
m_centeralWidget = new DatetimeWidget; m_centralWidget = new DatetimeWidget;
connect(m_centeralWidget, &DatetimeWidget::requestContextMenu, [this] {m_proxyInter->requestContextMenu(this, QString());}); connect(m_centralWidget, &DatetimeWidget::requestContextMenu, [this] {m_proxyInter->requestContextMenu(this, QString());});
connect(m_refershTimer, &QTimer::timeout, this, &DatetimePlugin::updateCurrentTimeString); connect(m_refershTimer, &QTimer::timeout, this, &DatetimePlugin::updateCurrentTimeString);
} }
DatetimePlugin::~DatetimePlugin() DatetimePlugin::~DatetimePlugin()
{ {
delete m_centeralWidget; delete m_centralWidget;
delete m_dateTipsLabel; delete m_dateTipsLabel;
} }
@ -51,7 +51,7 @@ QWidget *DatetimePlugin::itemWidget(const QString &itemKey)
{ {
Q_UNUSED(itemKey); Q_UNUSED(itemKey);
return m_centeralWidget; return m_centralWidget;
} }
QWidget *DatetimePlugin::itemTipsWidget(const QString &itemKey) QWidget *DatetimePlugin::itemTipsWidget(const QString &itemKey)
@ -110,5 +110,5 @@ void DatetimePlugin::updateCurrentTimeString()
return; return;
m_currentTimeString = currentString; m_currentTimeString = currentString;
m_centeralWidget->update(); m_centralWidget->update();
} }

View File

@ -34,7 +34,7 @@ private slots:
void updateCurrentTimeString(); void updateCurrentTimeString();
private: private:
DatetimeWidget *m_centeralWidget; DatetimeWidget *m_centralWidget;
QLabel *m_dateTipsLabel; QLabel *m_dateTipsLabel;
QTimer *m_refershTimer; QTimer *m_refershTimer;

View File

@ -58,13 +58,13 @@ DiskControlItem::DiskControlItem(const DiskInfo &info, QWidget *parent)
progressLayout->setSpacing(0); progressLayout->setSpacing(0);
progressLayout->setContentsMargins(10, 0, 0, 5); progressLayout->setContentsMargins(10, 0, 0, 5);
QHBoxLayout *centeralLayout = new QHBoxLayout; QHBoxLayout *centralLayout = new QHBoxLayout;
centeralLayout->addWidget(m_diskIcon); centralLayout->addWidget(m_diskIcon);
centeralLayout->addLayout(progressLayout); centralLayout->addLayout(progressLayout);
centeralLayout->setSpacing(0); centralLayout->setSpacing(0);
centeralLayout->setContentsMargins(0, 0, 5, 0); centralLayout->setContentsMargins(0, 0, 5, 0);
setLayout(centeralLayout); setLayout(centralLayout);
setObjectName("DiskItem"); setObjectName("DiskItem");
setStyleSheet("QFrame #DiskItem:hover {" setStyleSheet("QFrame #DiskItem:hover {"
"background-color:rgba(255, 255, 255, .1);" "background-color:rgba(255, 255, 255, .1);"

View File

@ -6,15 +6,15 @@
DiskControlWidget::DiskControlWidget(QWidget *parent) DiskControlWidget::DiskControlWidget(QWidget *parent)
: QScrollArea(parent), : QScrollArea(parent),
m_centeralLayout(new QVBoxLayout), m_centralLayout(new QVBoxLayout),
m_centeralWidget(new QWidget), m_centralWidget(new QWidget),
m_diskInter(new DBusDiskMount(this)) m_diskInter(new DBusDiskMount(this))
{ {
m_centeralWidget->setLayout(m_centeralLayout); m_centralWidget->setLayout(m_centralLayout);
m_centeralWidget->setFixedWidth(WIDTH); m_centralWidget->setFixedWidth(WIDTH);
setWidget(m_centeralWidget); setWidget(m_centralWidget);
setFixedWidth(WIDTH); setFixedWidth(WIDTH);
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@ -37,7 +37,7 @@ void DiskControlWidget::diskListChanged()
{ {
DiskInfoList diskList = m_diskInter->diskList(); DiskInfoList diskList = m_diskInter->diskList();
while (QLayoutItem *item = m_centeralLayout->takeAt(0)) while (QLayoutItem *item = m_centralLayout->takeAt(0))
{ {
delete item->widget(); delete item->widget();
delete item; delete item;
@ -55,7 +55,7 @@ void DiskControlWidget::diskListChanged()
connect(item, &DiskControlItem::requestUnmount, this, &DiskControlWidget::unmountDisk); connect(item, &DiskControlItem::requestUnmount, this, &DiskControlWidget::unmountDisk);
m_centeralLayout->addWidget(item); m_centralLayout->addWidget(item);
m_diskInfoList.append(info); m_diskInfoList.append(info);
} }
@ -64,7 +64,7 @@ void DiskControlWidget::diskListChanged()
const int contentHeight = mountedCount * 70; const int contentHeight = mountedCount * 70;
const int maxHeight = std::min(contentHeight, 70 * 6); const int maxHeight = std::min(contentHeight, 70 * 6);
m_centeralWidget->setFixedHeight(contentHeight); m_centralWidget->setFixedHeight(contentHeight);
setFixedHeight(maxHeight); setFixedHeight(maxHeight);
} }

View File

@ -24,8 +24,8 @@ private slots:
void unmountFinished(const QString &uuid, const QString &info); void unmountFinished(const QString &uuid, const QString &info);
private: private:
QVBoxLayout *m_centeralLayout; QVBoxLayout *m_centralLayout;
QWidget *m_centeralWidget; QWidget *m_centralWidget;
DBusDiskMount *m_diskInter; DBusDiskMount *m_diskInter;
DiskInfoList m_diskInfoList; DiskInfoList m_diskInfoList;

View File

@ -54,13 +54,13 @@ AccessPointWidget::AccessPointWidget(const AccessPoint &ap)
infoLayout->setSpacing(0); infoLayout->setSpacing(0);
infoLayout->setContentsMargins(15, 0, 0, 0); infoLayout->setContentsMargins(15, 0, 0, 0);
QVBoxLayout *centeralLayout = new QVBoxLayout; QVBoxLayout *centralLayout = new QVBoxLayout;
centeralLayout->addLayout(infoLayout); centralLayout->addLayout(infoLayout);
centeralLayout->setSpacing(0); centralLayout->setSpacing(0);
centeralLayout->setMargin(0); centralLayout->setMargin(0);
setStrengthIcon(ap.strength()); setStrengthIcon(ap.strength());
setLayout(centeralLayout); setLayout(centralLayout);
setStyleSheet("AccessPointWidget #Ssid {" setStyleSheet("AccessPointWidget #Ssid {"
"color:white;" "color:white;"
"background-color:transparent;" "background-color:transparent;"

View File

@ -25,15 +25,15 @@ DeviceControlWidget::DeviceControlWidget(QWidget *parent)
// m_seperator->setFixedHeight(1); // m_seperator->setFixedHeight(1);
// m_seperator->setColor(Qt::black); // m_seperator->setColor(Qt::black);
QVBoxLayout *centeralLayout = new QVBoxLayout; QVBoxLayout *centralLayout = new QVBoxLayout;
centeralLayout->addStretch(); centralLayout->addStretch();
centeralLayout->addLayout(infoLayout); centralLayout->addLayout(infoLayout);
centeralLayout->addStretch(); centralLayout->addStretch();
// centeralLayout->addWidget(m_seperator); // centralLayout->addWidget(m_seperator);
centeralLayout->setMargin(0); centralLayout->setMargin(0);
centeralLayout->setSpacing(0); centralLayout->setSpacing(0);
setLayout(centeralLayout); setLayout(centralLayout);
setFixedHeight(30); setFixedHeight(30);
connect(m_switchBtn, &DSwitchButton::checkedChanged, this, &DeviceControlWidget::deviceEnableChanged); connect(m_switchBtn, &DSwitchButton::checkedChanged, this, &DeviceControlWidget::deviceEnableChanged);

View File

@ -25,8 +25,8 @@ WirelessList::WirelessList(const QSet<NetworkDevice>::const_iterator &deviceIter
m_pwdDialog(new DInputDialog(nullptr)), m_pwdDialog(new DInputDialog(nullptr)),
m_autoConnBox(new DCheckBox), m_autoConnBox(new DCheckBox),
m_centeralLayout(new QVBoxLayout), m_centralLayout(new QVBoxLayout),
m_centeralWidget(new QWidget), m_centralWidget(new QWidget),
m_controlPanel(new DeviceControlWidget), m_controlPanel(new DeviceControlWidget),
m_networkInter(new DBusNetwork(this)) m_networkInter(new DBusNetwork(this))
{ {
@ -45,14 +45,14 @@ WirelessList::WirelessList(const QSet<NetworkDevice>::const_iterator &deviceIter
m_updateAPTimer->setSingleShot(true); m_updateAPTimer->setSingleShot(true);
m_updateAPTimer->setInterval(100); m_updateAPTimer->setInterval(100);
m_centeralWidget->setFixedWidth(WIDTH); m_centralWidget->setFixedWidth(WIDTH);
m_centeralWidget->setLayout(m_centeralLayout); m_centralWidget->setLayout(m_centralLayout);
// m_centeralLayout->addWidget(m_controlPanel); // m_centralLayout->addWidget(m_controlPanel);
m_centeralLayout->setSpacing(0); m_centralLayout->setSpacing(0);
m_centeralLayout->setMargin(0); m_centralLayout->setMargin(0);
setWidget(m_centeralWidget); setWidget(m_centralWidget);
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
setFixedWidth(300); setFixedWidth(300);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@ -204,7 +204,7 @@ void WirelessList::updateAPList()
Q_ASSERT(sender() == m_updateAPTimer); Q_ASSERT(sender() == m_updateAPTimer);
// remove old items // remove old items
while (QLayoutItem *item = m_centeralLayout->takeAt(0)) while (QLayoutItem *item = m_centralLayout->takeAt(0))
{ {
delete item->widget(); delete item->widget();
delete item; delete item;
@ -229,9 +229,9 @@ void WirelessList::updateAPList()
connect(apw, &AccessPointWidget::requestDeactiveAP, this, &WirelessList::deactiveAP); connect(apw, &AccessPointWidget::requestDeactiveAP, this, &WirelessList::deactiveAP);
if(apw->active()) { if(apw->active()) {
m_centeralLayout->insertWidget(0, apw); m_centralLayout->insertWidget(0, apw);
} else { } else {
m_centeralLayout->addWidget(apw); m_centralLayout->addWidget(apw);
} }
++avaliableAPCount; ++avaliableAPCount;
@ -240,7 +240,7 @@ void WirelessList::updateAPList()
// m_controlPanel->setSeperatorVisible(avaliableAPCount); // m_controlPanel->setSeperatorVisible(avaliableAPCount);
const int contentHeight = avaliableAPCount * ITEM_HEIGHT; const int contentHeight = avaliableAPCount * ITEM_HEIGHT;
m_centeralWidget->setFixedHeight(contentHeight); m_centralWidget->setFixedHeight(contentHeight);
setFixedHeight(std::min(contentHeight, MAX_HEIGHT)); setFixedHeight(std::min(contentHeight, MAX_HEIGHT));
} }

View File

@ -63,8 +63,8 @@ private:
QString m_lastConnPath; QString m_lastConnPath;
QString m_lastConnSecurity; QString m_lastConnSecurity;
QVBoxLayout *m_centeralLayout; QVBoxLayout *m_centralLayout;
QWidget *m_centeralWidget; QWidget *m_centralWidget;
DeviceControlWidget *m_controlPanel; DeviceControlWidget *m_controlPanel;
DBusNetwork *m_networkInter; DBusNetwork *m_networkInter;
}; };

View File

@ -19,18 +19,18 @@ SinkInputWidget::SinkInputWidget(const QString &inputPath, QWidget *parent)
m_volumeSlider->setAccessibleName("app-" + iconName + "-slider"); m_volumeSlider->setAccessibleName("app-" + iconName + "-slider");
m_volumeSlider->setValue(m_inputInter->volume() * 1000); m_volumeSlider->setValue(m_inputInter->volume() * 1000);
QHBoxLayout *centeralLayout = new QHBoxLayout; QHBoxLayout *centralLayout = new QHBoxLayout;
centeralLayout->addWidget(m_volumeIcon); centralLayout->addWidget(m_volumeIcon);
centeralLayout->addSpacing(10); centralLayout->addSpacing(10);
centeralLayout->addWidget(m_volumeSlider); centralLayout->addWidget(m_volumeSlider);
centeralLayout->setSpacing(2); centralLayout->setSpacing(2);
centeralLayout->setMargin(0); centralLayout->setMargin(0);
connect(m_volumeSlider, &VolumeSlider::valueChanged, this, &SinkInputWidget::setVolume); connect(m_volumeSlider, &VolumeSlider::valueChanged, this, &SinkInputWidget::setVolume);
connect(m_volumeIcon, &DImageButton::clicked, this, &SinkInputWidget::setMute); connect(m_volumeIcon, &DImageButton::clicked, this, &SinkInputWidget::setMute);
connect(m_inputInter, &DBusSinkInput::MuteChanged, this, &SinkInputWidget::setMuteIcon); connect(m_inputInter, &DBusSinkInput::MuteChanged, this, &SinkInputWidget::setMuteIcon);
setLayout(centeralLayout); setLayout(centralLayout);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
setFixedHeight(30); setFixedHeight(30);

View File

@ -14,7 +14,7 @@ DWIDGET_USE_NAMESPACE
SoundApplet::SoundApplet(QWidget *parent) SoundApplet::SoundApplet(QWidget *parent)
: QScrollArea(parent), : QScrollArea(parent),
m_centeralWidget(new QWidget), m_centralWidget(new QWidget),
m_applicationTitle(new QWidget), m_applicationTitle(new QWidget),
m_volumeBtn(new DImageButton), m_volumeBtn(new DImageButton),
m_volumeSlider(new VolumeSlider), m_volumeSlider(new VolumeSlider),
@ -69,18 +69,18 @@ SoundApplet::SoundApplet(QWidget *parent)
m_volumeSlider->setMinimum(0); m_volumeSlider->setMinimum(0);
m_volumeSlider->setMaximum(1000); m_volumeSlider->setMaximum(1000);
m_centeralLayout = new QVBoxLayout; m_centralLayout = new QVBoxLayout;
m_centeralLayout->addLayout(deviceLineLayout); m_centralLayout->addLayout(deviceLineLayout);
m_centeralLayout->addSpacing(8); m_centralLayout->addSpacing(8);
m_centeralLayout->addLayout(volumeCtrlLayout); m_centralLayout->addLayout(volumeCtrlLayout);
m_centeralLayout->addWidget(m_applicationTitle); m_centralLayout->addWidget(m_applicationTitle);
m_centeralWidget->setLayout(m_centeralLayout); m_centralWidget->setLayout(m_centralLayout);
m_centeralWidget->setFixedWidth(WIDTH); m_centralWidget->setFixedWidth(WIDTH);
m_centeralWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); m_centralWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
setFixedWidth(WIDTH); setFixedWidth(WIDTH);
setWidget(m_centeralWidget); setWidget(m_centralWidget);
setFrameStyle(QFrame::NoFrame); setFrameStyle(QFrame::NoFrame);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@ -148,8 +148,8 @@ void SoundApplet::volumeSliderValueChanged()
void SoundApplet::sinkInputsChanged() void SoundApplet::sinkInputsChanged()
{ {
m_centeralWidget->setVisible(false); m_centralWidget->setVisible(false);
QVBoxLayout *appLayout = m_centeralLayout; QVBoxLayout *appLayout = m_centralLayout;
while (QLayoutItem *item = appLayout->takeAt(4)) while (QLayoutItem *item = appLayout->takeAt(4))
{ {
delete item->widget(); delete item->widget();
@ -164,9 +164,9 @@ void SoundApplet::sinkInputsChanged()
appLayout->addWidget(si); appLayout->addWidget(si);
} }
const int contentHeight = m_centeralWidget->sizeHint().height(); const int contentHeight = m_centralWidget->sizeHint().height();
m_centeralWidget->setFixedHeight(contentHeight); m_centralWidget->setFixedHeight(contentHeight);
m_centeralWidget->setVisible(true); m_centralWidget->setVisible(true);
setFixedHeight(std::min(contentHeight, MAX_HEIGHT)); setFixedHeight(std::min(contentHeight, MAX_HEIGHT));
} }

View File

@ -34,11 +34,11 @@ private slots:
void toggleMute(); void toggleMute();
private: private:
QWidget *m_centeralWidget; QWidget *m_centralWidget;
QWidget *m_applicationTitle; QWidget *m_applicationTitle;
Dtk::Widget::DImageButton *m_volumeBtn; Dtk::Widget::DImageButton *m_volumeBtn;
VolumeSlider *m_volumeSlider; VolumeSlider *m_volumeSlider;
QVBoxLayout *m_centeralLayout; QVBoxLayout *m_centralLayout;
DBusAudio *m_audioInter; DBusAudio *m_audioInter;
DBusSink *m_defSinkInter; DBusSink *m_defSinkInter;