Skip to content

Commit

Permalink
fix: dialog window display position error
Browse files Browse the repository at this point in the history
日历在日程右键删除时, 弹出的确认对话框会显示在左上角
目前推测是窗口的问题, 先在应用层的临时解决

Issues: linuxdeepin/developer-center#10141
  • Loading branch information
myml committed Aug 5, 2024
1 parent c23a05e commit 0730b05
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions calendar-client/src/dialog/schedulectrldlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "scheduledatamanage.h"
#include "cdynamicicon.h"
#include "constants.h"
#include <QTimer>

#include <DMessageBox>
#include <DPushButton>
Expand Down Expand Up @@ -135,8 +136,12 @@ void CScheduleCtrlDlg::changeEvent(QEvent *event)
button->setText(text_button);
}
}
setFixedHeight(36 + 48 + height_firstLabel + height_seconLabel + 30);
gwi->setFixedHeight(height_firstLabel + height_seconLabel);
// 在changeEvent里使用setFixedHeight会导致弹出的确认对话框会显示在左上角
// 推测是窗口的问题, 先通过延迟在应用层临时解决
QTimer::singleShot(10, this, [this, height_firstLabel, height_seconLabel]{
setFixedHeight(36 + 48 + height_firstLabel + height_seconLabel + 30);
gwi->setFixedHeight(height_firstLabel + height_seconLabel);
});
}

void CScheduleCtrlDlg::buttonJudge(int id)
Expand Down

0 comments on commit 0730b05

Please sign in to comment.