Skip to content

Commit

Permalink
fix: correct typos in multiple files
Browse files Browse the repository at this point in the history
Change-Id: I706ccda249a0b855a716d5542afcd5827304b097
  • Loading branch information
felixonmars authored and deepin-gerrit committed Nov 23, 2017
1 parent 4dd3953 commit be8ea41
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
28 changes: 19 additions & 9 deletions src/widgets/dabstractdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,19 @@ QColor DAbstractDialog::borderColor() const
}

/**
* @brief DAbstractDialog::displayPostion
* @brief DAbstractDialog::displayPosition
* @return the display position of this dialog.
*/
DAbstractDialog::DisplayPostion DAbstractDialog::displayPostion() const
DAbstractDialog::DisplayPosition DAbstractDialog::displayPosition() const
{
D_DC(DAbstractDialog);

return d->displayPostion;
return d->displayPosition;
}

DAbstractDialog::DisplayPostion DAbstractDialog::displayPostion() const
{
return static_cast<DisplayPostion>(displayPosition());
}

/**
Expand Down Expand Up @@ -199,16 +204,16 @@ void DAbstractDialog::setBorderColor(QColor borderColor)
}

/**
* @brief DAbstractDialog::setDisplayPostion sets the position of the dialog.
* @param displayPostion is the target position.
* @brief DAbstractDialog::setDisplayPosition sets the position of the dialog.
* @param displayPosition is the target position.
*/
void DAbstractDialog::setDisplayPostion(DAbstractDialog::DisplayPostion displayPostion)
void DAbstractDialog::setDisplayPosition(DAbstractDialog::DisplayPosition displayPosition)
{
D_D(DAbstractDialog);

d->displayPostion = displayPostion;
d->displayPosition = displayPosition;

switch (displayPostion) {
switch (displayPosition) {
case DisplayCenter:
moveToCenter();
break;
Expand All @@ -220,6 +225,11 @@ void DAbstractDialog::setDisplayPostion(DAbstractDialog::DisplayPostion displayP
}
}

void DAbstractDialog::setDisplayPostion(DAbstractDialog::DisplayPostion displayPosition)
{
setDisplayPosition(static_cast<DisplayPosition>(displayPosition));
}

/**
* @brief DAbstractDialog::moveToCenterByRect moves the dialog to the center of the rect.
* @param rect is the target rect.
Expand Down Expand Up @@ -315,7 +325,7 @@ void DAbstractDialog::resizeEvent(QResizeEvent *event)
D_DC(DAbstractDialog);

if (!d->mouseMoved) {
setDisplayPostion(displayPostion());
setDisplayPosition(displayPosition());
}

if (d->bgBlurWidget)
Expand Down
19 changes: 13 additions & 6 deletions src/widgets/dabstractdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,30 @@ class DAbstractDialog : public QDialog, public DTK_CORE_NAMESPACE::DObject

Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
Q_PROPERTY(DisplayPostion displayPostion READ displayPostion WRITE setDisplayPostion)
Q_PROPERTY(DisplayPosition displayPosition READ displayPosition WRITE setDisplayPosition)

public:
/**
* @brief The DisplayPostion enum contains the position options that can be specified by all dialogs.
* @brief The DisplayPosition enum contains the position options that can be specified by all dialogs.
*/
enum DisplayPosition {
Center, /*!< display this dialog in the center of the screen */
TopRight /*!< display this dialog in the top right of the screen */
};
enum DisplayPostion {
DisplayCenter, /*!< display this dialog in the center of the screen */
DisplayTopRight /*!< display this dialog in the top right of the screen */
DisplayCenter = Center, /*!< display this dialog in the center of the screen */
DisplayTopRight = TopRight /*!< display this dialog in the top right of the screen */
};

Q_ENUMS(DisplayPosition)
Q_ENUMS(DisplayPostion)

DAbstractDialog(QWidget *parent = 0);

QColor backgroundColor() const;
QColor borderColor() const;
DisplayPostion displayPostion() const;
DisplayPosition displayPosition() const;
D_DECL_DEPRECATED DisplayPostion displayPostion() const;

public Q_SLOTS:
void moveToCenter();
Expand All @@ -65,7 +71,8 @@ public Q_SLOTS:

void setBackgroundColor(QColor backgroundColor);
void setBorderColor(QColor borderColor);
void setDisplayPostion(DisplayPostion displayPostion);
void setDisplayPosition(DisplayPosition displayPosition);
D_DECL_DEPRECATED void setDisplayPostion(DisplayPostion displayPosition);

Q_SIGNALS:
/**
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/private/dabstractdialogprivate_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DAbstractDialogPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate
QPoint dragPosition;
QColor backgroundColor;
QColor borderColor;
DAbstractDialog::DisplayPostion displayPostion = DAbstractDialog::DisplayCenter;
DAbstractDialog::DisplayPosition displayPosition = DAbstractDialog::Center;

DPlatformWindowHandle *handle = Q_NULLPTR;
DBlurEffectWidget *bgBlurWidget = Q_NULLPTR;
Expand Down

0 comments on commit be8ea41

Please sign in to comment.