mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
Fix a typo: centeral -> central
Change-Id: Iaa1eb358b5577a6553667a53907984815cb9a0e5
This commit is contained in:
parent
b383e9cc7d
commit
c71600e578
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
@ -11,13 +11,13 @@
|
||||
ContainerWidget::ContainerWidget(QWidget *parent)
|
||||
: QWidget(parent),
|
||||
|
||||
m_centeralLayout(new QHBoxLayout)
|
||||
m_centralLayout(new QHBoxLayout)
|
||||
{
|
||||
m_centeralLayout->addStretch();
|
||||
m_centeralLayout->setSpacing(0);
|
||||
m_centeralLayout->setMargin(0);
|
||||
m_centralLayout->addStretch();
|
||||
m_centralLayout->setSpacing(0);
|
||||
m_centralLayout->setMargin(0);
|
||||
|
||||
setLayout(m_centeralLayout);
|
||||
setLayout(m_centralLayout);
|
||||
setFixedHeight(ITEM_HEIGHT);
|
||||
setFixedWidth(ITEM_WIDTH);
|
||||
setAcceptDrops(true);
|
||||
@ -27,7 +27,7 @@ void ContainerWidget::addWidget(QWidget * const w)
|
||||
{
|
||||
w->setParent(this);
|
||||
w->setFixedSize(ITEM_WIDTH, ITEM_HEIGHT);
|
||||
m_centeralLayout->addWidget(w);
|
||||
m_centralLayout->addWidget(w);
|
||||
m_itemList.append(w);
|
||||
|
||||
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)
|
||||
{
|
||||
m_centeralLayout->removeWidget(w);
|
||||
m_centralLayout->removeWidget(w);
|
||||
m_itemList.removeOne(w);
|
||||
|
||||
setFixedWidth(ITEM_WIDTH * std::max(1, m_itemList.size()));
|
||||
|
@ -22,7 +22,7 @@ protected:
|
||||
void dragEnterEvent(QDragEnterEvent *e);
|
||||
|
||||
private:
|
||||
QHBoxLayout *m_centeralLayout;
|
||||
QHBoxLayout *m_centralLayout;
|
||||
|
||||
QList<QWidget *> m_itemList;
|
||||
};
|
||||
|
@ -17,19 +17,19 @@ QPoint PluginsItem::MousePressPoint = QPoint();
|
||||
PluginsItem::PluginsItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent)
|
||||
: DockItem(parent),
|
||||
m_pluginInter(pluginInter),
|
||||
m_centeralWidget(m_pluginInter->itemWidget(itemKey)),
|
||||
m_centralWidget(m_pluginInter->itemWidget(itemKey)),
|
||||
m_itemKey(itemKey),
|
||||
m_draging(false)
|
||||
{
|
||||
Q_ASSERT(m_centeralWidget);
|
||||
Q_ASSERT(m_centralWidget);
|
||||
|
||||
QBoxLayout *hLayout = new QHBoxLayout;
|
||||
hLayout->addWidget(m_centeralWidget);
|
||||
hLayout->addWidget(m_centralWidget);
|
||||
hLayout->setSpacing(0);
|
||||
hLayout->setMargin(0);
|
||||
|
||||
m_centeralWidget->installEventFilter(this);
|
||||
m_centeralWidget->setVisible(true);
|
||||
m_centralWidget->installEventFilter(this);
|
||||
m_centralWidget->setVisible(true);
|
||||
|
||||
setLayout(hLayout);
|
||||
setAccessibleName(pluginInter->pluginName() + "-" + m_itemKey);
|
||||
@ -131,7 +131,7 @@ void PluginsItem::paintEvent(QPaintEvent *e)
|
||||
bool PluginsItem::eventFilter(QObject *o, QEvent *e)
|
||||
{
|
||||
if (m_draging)
|
||||
if (o == m_centeralWidget && e->type() == QEvent::Paint)
|
||||
if (o == m_centralWidget && e->type() == QEvent::Paint)
|
||||
return true;
|
||||
|
||||
return DockItem::eventFilter(o, e);
|
||||
|
@ -44,7 +44,7 @@ private:
|
||||
|
||||
private:
|
||||
PluginsItemInterface * const m_pluginInter;
|
||||
QWidget *m_centeralWidget;
|
||||
QWidget *m_centralWidget;
|
||||
const QString m_itemKey;
|
||||
bool m_draging;
|
||||
|
||||
|
@ -16,16 +16,16 @@ DatetimePlugin::DatetimePlugin(QObject *parent)
|
||||
m_refershTimer->setInterval(1000);
|
||||
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);
|
||||
}
|
||||
|
||||
DatetimePlugin::~DatetimePlugin()
|
||||
{
|
||||
delete m_centeralWidget;
|
||||
delete m_centralWidget;
|
||||
delete m_dateTipsLabel;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ QWidget *DatetimePlugin::itemWidget(const QString &itemKey)
|
||||
{
|
||||
Q_UNUSED(itemKey);
|
||||
|
||||
return m_centeralWidget;
|
||||
return m_centralWidget;
|
||||
}
|
||||
|
||||
QWidget *DatetimePlugin::itemTipsWidget(const QString &itemKey)
|
||||
@ -110,5 +110,5 @@ void DatetimePlugin::updateCurrentTimeString()
|
||||
return;
|
||||
|
||||
m_currentTimeString = currentString;
|
||||
m_centeralWidget->update();
|
||||
m_centralWidget->update();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ private slots:
|
||||
void updateCurrentTimeString();
|
||||
|
||||
private:
|
||||
DatetimeWidget *m_centeralWidget;
|
||||
DatetimeWidget *m_centralWidget;
|
||||
QLabel *m_dateTipsLabel;
|
||||
|
||||
QTimer *m_refershTimer;
|
||||
|
@ -58,13 +58,13 @@ DiskControlItem::DiskControlItem(const DiskInfo &info, QWidget *parent)
|
||||
progressLayout->setSpacing(0);
|
||||
progressLayout->setContentsMargins(10, 0, 0, 5);
|
||||
|
||||
QHBoxLayout *centeralLayout = new QHBoxLayout;
|
||||
centeralLayout->addWidget(m_diskIcon);
|
||||
centeralLayout->addLayout(progressLayout);
|
||||
centeralLayout->setSpacing(0);
|
||||
centeralLayout->setContentsMargins(0, 0, 5, 0);
|
||||
QHBoxLayout *centralLayout = new QHBoxLayout;
|
||||
centralLayout->addWidget(m_diskIcon);
|
||||
centralLayout->addLayout(progressLayout);
|
||||
centralLayout->setSpacing(0);
|
||||
centralLayout->setContentsMargins(0, 0, 5, 0);
|
||||
|
||||
setLayout(centeralLayout);
|
||||
setLayout(centralLayout);
|
||||
setObjectName("DiskItem");
|
||||
setStyleSheet("QFrame #DiskItem:hover {"
|
||||
"background-color:rgba(255, 255, 255, .1);"
|
||||
|
@ -6,15 +6,15 @@
|
||||
DiskControlWidget::DiskControlWidget(QWidget *parent)
|
||||
: QScrollArea(parent),
|
||||
|
||||
m_centeralLayout(new QVBoxLayout),
|
||||
m_centeralWidget(new QWidget),
|
||||
m_centralLayout(new QVBoxLayout),
|
||||
m_centralWidget(new QWidget),
|
||||
|
||||
m_diskInter(new DBusDiskMount(this))
|
||||
{
|
||||
m_centeralWidget->setLayout(m_centeralLayout);
|
||||
m_centeralWidget->setFixedWidth(WIDTH);
|
||||
m_centralWidget->setLayout(m_centralLayout);
|
||||
m_centralWidget->setFixedWidth(WIDTH);
|
||||
|
||||
setWidget(m_centeralWidget);
|
||||
setWidget(m_centralWidget);
|
||||
setFixedWidth(WIDTH);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@ -37,7 +37,7 @@ void DiskControlWidget::diskListChanged()
|
||||
{
|
||||
DiskInfoList diskList = m_diskInter->diskList();
|
||||
|
||||
while (QLayoutItem *item = m_centeralLayout->takeAt(0))
|
||||
while (QLayoutItem *item = m_centralLayout->takeAt(0))
|
||||
{
|
||||
delete item->widget();
|
||||
delete item;
|
||||
@ -55,7 +55,7 @@ void DiskControlWidget::diskListChanged()
|
||||
|
||||
connect(item, &DiskControlItem::requestUnmount, this, &DiskControlWidget::unmountDisk);
|
||||
|
||||
m_centeralLayout->addWidget(item);
|
||||
m_centralLayout->addWidget(item);
|
||||
m_diskInfoList.append(info);
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ void DiskControlWidget::diskListChanged()
|
||||
const int contentHeight = mountedCount * 70;
|
||||
const int maxHeight = std::min(contentHeight, 70 * 6);
|
||||
|
||||
m_centeralWidget->setFixedHeight(contentHeight);
|
||||
m_centralWidget->setFixedHeight(contentHeight);
|
||||
setFixedHeight(maxHeight);
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,8 @@ private slots:
|
||||
void unmountFinished(const QString &uuid, const QString &info);
|
||||
|
||||
private:
|
||||
QVBoxLayout *m_centeralLayout;
|
||||
QWidget *m_centeralWidget;
|
||||
QVBoxLayout *m_centralLayout;
|
||||
QWidget *m_centralWidget;
|
||||
DBusDiskMount *m_diskInter;
|
||||
|
||||
DiskInfoList m_diskInfoList;
|
||||
|
@ -54,13 +54,13 @@ AccessPointWidget::AccessPointWidget(const AccessPoint &ap)
|
||||
infoLayout->setSpacing(0);
|
||||
infoLayout->setContentsMargins(15, 0, 0, 0);
|
||||
|
||||
QVBoxLayout *centeralLayout = new QVBoxLayout;
|
||||
centeralLayout->addLayout(infoLayout);
|
||||
centeralLayout->setSpacing(0);
|
||||
centeralLayout->setMargin(0);
|
||||
QVBoxLayout *centralLayout = new QVBoxLayout;
|
||||
centralLayout->addLayout(infoLayout);
|
||||
centralLayout->setSpacing(0);
|
||||
centralLayout->setMargin(0);
|
||||
|
||||
setStrengthIcon(ap.strength());
|
||||
setLayout(centeralLayout);
|
||||
setLayout(centralLayout);
|
||||
setStyleSheet("AccessPointWidget #Ssid {"
|
||||
"color:white;"
|
||||
"background-color:transparent;"
|
||||
|
@ -25,15 +25,15 @@ DeviceControlWidget::DeviceControlWidget(QWidget *parent)
|
||||
// m_seperator->setFixedHeight(1);
|
||||
// m_seperator->setColor(Qt::black);
|
||||
|
||||
QVBoxLayout *centeralLayout = new QVBoxLayout;
|
||||
centeralLayout->addStretch();
|
||||
centeralLayout->addLayout(infoLayout);
|
||||
centeralLayout->addStretch();
|
||||
// centeralLayout->addWidget(m_seperator);
|
||||
centeralLayout->setMargin(0);
|
||||
centeralLayout->setSpacing(0);
|
||||
QVBoxLayout *centralLayout = new QVBoxLayout;
|
||||
centralLayout->addStretch();
|
||||
centralLayout->addLayout(infoLayout);
|
||||
centralLayout->addStretch();
|
||||
// centralLayout->addWidget(m_seperator);
|
||||
centralLayout->setMargin(0);
|
||||
centralLayout->setSpacing(0);
|
||||
|
||||
setLayout(centeralLayout);
|
||||
setLayout(centralLayout);
|
||||
setFixedHeight(30);
|
||||
|
||||
connect(m_switchBtn, &DSwitchButton::checkedChanged, this, &DeviceControlWidget::deviceEnableChanged);
|
||||
|
@ -25,8 +25,8 @@ WirelessList::WirelessList(const QSet<NetworkDevice>::const_iterator &deviceIter
|
||||
m_pwdDialog(new DInputDialog(nullptr)),
|
||||
m_autoConnBox(new DCheckBox),
|
||||
|
||||
m_centeralLayout(new QVBoxLayout),
|
||||
m_centeralWidget(new QWidget),
|
||||
m_centralLayout(new QVBoxLayout),
|
||||
m_centralWidget(new QWidget),
|
||||
m_controlPanel(new DeviceControlWidget),
|
||||
m_networkInter(new DBusNetwork(this))
|
||||
{
|
||||
@ -45,14 +45,14 @@ WirelessList::WirelessList(const QSet<NetworkDevice>::const_iterator &deviceIter
|
||||
m_updateAPTimer->setSingleShot(true);
|
||||
m_updateAPTimer->setInterval(100);
|
||||
|
||||
m_centeralWidget->setFixedWidth(WIDTH);
|
||||
m_centeralWidget->setLayout(m_centeralLayout);
|
||||
m_centralWidget->setFixedWidth(WIDTH);
|
||||
m_centralWidget->setLayout(m_centralLayout);
|
||||
|
||||
// m_centeralLayout->addWidget(m_controlPanel);
|
||||
m_centeralLayout->setSpacing(0);
|
||||
m_centeralLayout->setMargin(0);
|
||||
// m_centralLayout->addWidget(m_controlPanel);
|
||||
m_centralLayout->setSpacing(0);
|
||||
m_centralLayout->setMargin(0);
|
||||
|
||||
setWidget(m_centeralWidget);
|
||||
setWidget(m_centralWidget);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setFixedWidth(300);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@ -204,7 +204,7 @@ void WirelessList::updateAPList()
|
||||
Q_ASSERT(sender() == m_updateAPTimer);
|
||||
|
||||
// remove old items
|
||||
while (QLayoutItem *item = m_centeralLayout->takeAt(0))
|
||||
while (QLayoutItem *item = m_centralLayout->takeAt(0))
|
||||
{
|
||||
delete item->widget();
|
||||
delete item;
|
||||
@ -229,9 +229,9 @@ void WirelessList::updateAPList()
|
||||
connect(apw, &AccessPointWidget::requestDeactiveAP, this, &WirelessList::deactiveAP);
|
||||
|
||||
if(apw->active()) {
|
||||
m_centeralLayout->insertWidget(0, apw);
|
||||
m_centralLayout->insertWidget(0, apw);
|
||||
} else {
|
||||
m_centeralLayout->addWidget(apw);
|
||||
m_centralLayout->addWidget(apw);
|
||||
}
|
||||
|
||||
++avaliableAPCount;
|
||||
@ -240,7 +240,7 @@ void WirelessList::updateAPList()
|
||||
// m_controlPanel->setSeperatorVisible(avaliableAPCount);
|
||||
|
||||
const int contentHeight = avaliableAPCount * ITEM_HEIGHT;
|
||||
m_centeralWidget->setFixedHeight(contentHeight);
|
||||
m_centralWidget->setFixedHeight(contentHeight);
|
||||
setFixedHeight(std::min(contentHeight, MAX_HEIGHT));
|
||||
}
|
||||
|
||||
|
@ -63,8 +63,8 @@ private:
|
||||
QString m_lastConnPath;
|
||||
QString m_lastConnSecurity;
|
||||
|
||||
QVBoxLayout *m_centeralLayout;
|
||||
QWidget *m_centeralWidget;
|
||||
QVBoxLayout *m_centralLayout;
|
||||
QWidget *m_centralWidget;
|
||||
DeviceControlWidget *m_controlPanel;
|
||||
DBusNetwork *m_networkInter;
|
||||
};
|
||||
|
@ -19,18 +19,18 @@ SinkInputWidget::SinkInputWidget(const QString &inputPath, QWidget *parent)
|
||||
m_volumeSlider->setAccessibleName("app-" + iconName + "-slider");
|
||||
m_volumeSlider->setValue(m_inputInter->volume() * 1000);
|
||||
|
||||
QHBoxLayout *centeralLayout = new QHBoxLayout;
|
||||
centeralLayout->addWidget(m_volumeIcon);
|
||||
centeralLayout->addSpacing(10);
|
||||
centeralLayout->addWidget(m_volumeSlider);
|
||||
centeralLayout->setSpacing(2);
|
||||
centeralLayout->setMargin(0);
|
||||
QHBoxLayout *centralLayout = new QHBoxLayout;
|
||||
centralLayout->addWidget(m_volumeIcon);
|
||||
centralLayout->addSpacing(10);
|
||||
centralLayout->addWidget(m_volumeSlider);
|
||||
centralLayout->setSpacing(2);
|
||||
centralLayout->setMargin(0);
|
||||
|
||||
connect(m_volumeSlider, &VolumeSlider::valueChanged, this, &SinkInputWidget::setVolume);
|
||||
connect(m_volumeIcon, &DImageButton::clicked, this, &SinkInputWidget::setMute);
|
||||
connect(m_inputInter, &DBusSinkInput::MuteChanged, this, &SinkInputWidget::setMuteIcon);
|
||||
|
||||
setLayout(centeralLayout);
|
||||
setLayout(centralLayout);
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
setFixedHeight(30);
|
||||
|
||||
|
@ -14,7 +14,7 @@ DWIDGET_USE_NAMESPACE
|
||||
SoundApplet::SoundApplet(QWidget *parent)
|
||||
: QScrollArea(parent),
|
||||
|
||||
m_centeralWidget(new QWidget),
|
||||
m_centralWidget(new QWidget),
|
||||
m_applicationTitle(new QWidget),
|
||||
m_volumeBtn(new DImageButton),
|
||||
m_volumeSlider(new VolumeSlider),
|
||||
@ -69,18 +69,18 @@ SoundApplet::SoundApplet(QWidget *parent)
|
||||
m_volumeSlider->setMinimum(0);
|
||||
m_volumeSlider->setMaximum(1000);
|
||||
|
||||
m_centeralLayout = new QVBoxLayout;
|
||||
m_centeralLayout->addLayout(deviceLineLayout);
|
||||
m_centeralLayout->addSpacing(8);
|
||||
m_centeralLayout->addLayout(volumeCtrlLayout);
|
||||
m_centeralLayout->addWidget(m_applicationTitle);
|
||||
m_centralLayout = new QVBoxLayout;
|
||||
m_centralLayout->addLayout(deviceLineLayout);
|
||||
m_centralLayout->addSpacing(8);
|
||||
m_centralLayout->addLayout(volumeCtrlLayout);
|
||||
m_centralLayout->addWidget(m_applicationTitle);
|
||||
|
||||
m_centeralWidget->setLayout(m_centeralLayout);
|
||||
m_centeralWidget->setFixedWidth(WIDTH);
|
||||
m_centeralWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
m_centralWidget->setLayout(m_centralLayout);
|
||||
m_centralWidget->setFixedWidth(WIDTH);
|
||||
m_centralWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
|
||||
setFixedWidth(WIDTH);
|
||||
setWidget(m_centeralWidget);
|
||||
setWidget(m_centralWidget);
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@ -148,8 +148,8 @@ void SoundApplet::volumeSliderValueChanged()
|
||||
|
||||
void SoundApplet::sinkInputsChanged()
|
||||
{
|
||||
m_centeralWidget->setVisible(false);
|
||||
QVBoxLayout *appLayout = m_centeralLayout;
|
||||
m_centralWidget->setVisible(false);
|
||||
QVBoxLayout *appLayout = m_centralLayout;
|
||||
while (QLayoutItem *item = appLayout->takeAt(4))
|
||||
{
|
||||
delete item->widget();
|
||||
@ -164,9 +164,9 @@ void SoundApplet::sinkInputsChanged()
|
||||
appLayout->addWidget(si);
|
||||
}
|
||||
|
||||
const int contentHeight = m_centeralWidget->sizeHint().height();
|
||||
m_centeralWidget->setFixedHeight(contentHeight);
|
||||
m_centeralWidget->setVisible(true);
|
||||
const int contentHeight = m_centralWidget->sizeHint().height();
|
||||
m_centralWidget->setFixedHeight(contentHeight);
|
||||
m_centralWidget->setVisible(true);
|
||||
setFixedHeight(std::min(contentHeight, MAX_HEIGHT));
|
||||
}
|
||||
|
||||
|
@ -34,11 +34,11 @@ private slots:
|
||||
void toggleMute();
|
||||
|
||||
private:
|
||||
QWidget *m_centeralWidget;
|
||||
QWidget *m_centralWidget;
|
||||
QWidget *m_applicationTitle;
|
||||
Dtk::Widget::DImageButton *m_volumeBtn;
|
||||
VolumeSlider *m_volumeSlider;
|
||||
QVBoxLayout *m_centeralLayout;
|
||||
QVBoxLayout *m_centralLayout;
|
||||
|
||||
DBusAudio *m_audioInter;
|
||||
DBusSink *m_defSinkInter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user