Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkwidget
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#541
  • Loading branch information
deepin-ci-robot authored and FeiWang1119 committed Jan 10, 2024
1 parent 53e1c44 commit 31658df
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion include/widgets/danchors.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <QResizeEvent>
#include <QMoveEvent>
#include <QWidget>
#include <QDebug>

#include <dtkwidget_global.h>

Expand Down
1 change: 0 additions & 1 deletion include/widgets/darrowbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <QWidget>
#include <QLabel>
#include <QStyle>
#include <QDebug>

#include <dtkwidget_global.h>
#include <dconstants.h>
Expand Down
4 changes: 0 additions & 4 deletions include/widgets/darrowrectangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPainter>
#include <QTimer>
#include <QDebug>

#include <DObject>
#include <dtkwidget_global.h>
#include <DThemeManager>
#include <dgraphicsgloweffect.h>
#include <DBlurEffectWidget>

DWIDGET_BEGIN_NAMESPACE
Expand Down
1 change: 0 additions & 1 deletion include/widgets/dloadingindicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <QGraphicsPixmapItem>
#include <QGraphicsView>
#include <QEasingCurve>
#include <QDebug>

#include <dtkwidget_global.h>
#include <DObject>
Expand Down
1 change: 1 addition & 0 deletions src/widgets/darrowrectangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "dplatformwindowhandle.h"
#include "dapplication.h"
#include "private/darrowrectangle_p.h"
#include "dgraphicsgloweffect.h"
#include "dstyle.h"

#include <DGuiApplicationHelper>
Expand Down
9 changes: 5 additions & 4 deletions src/widgets/dcrumbedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ class DCrumbEditPrivate : public DCORE_NAMESPACE::DObjectPrivate

void registerHandler(QAbstractTextDocumentLayout *layout)
{
D_Q(DCrumbEdit);

for (int i = QTextFormat::UserObject + 1; ; ++i) {
if (!layout->handlerForObject(i)) {
objectType = i;
Expand Down Expand Up @@ -379,7 +377,9 @@ class DCrumbEditPrivate : public DCORE_NAMESPACE::DObjectPrivate
if (cursor.charFormat().objectType() != objectType)
return false;

DCrumbTextFormat format(cursor.charFormat());
auto fmt = q->document()->documentLayout()->formatAt(mousePos);
DCrumbTextFormat format = formats.value(fmt.stringProperty(QTextFormat::UserProperty + 1));

currentText = format.text();
currentBrush = format.background();

Expand All @@ -391,7 +391,8 @@ class DCrumbEditPrivate : public DCORE_NAMESPACE::DObjectPrivate

makeCrumb();

if (mousePos.x() < q->cursorRect().left())
if (mousePos.x() < q->cursorRect().left() ||
mousePos.y() < q->cursorRect().top())
cursor.setPosition(cursor.position() - 1, QTextCursor::KeepAnchor);
else
cursor.setPosition(cursor.position() + 1, QTextCursor::KeepAnchor);
Expand Down

0 comments on commit 31658df

Please sign in to comment.